DocsAPI reference

API reference

One key, four protocols.

Base URLs

https://myusapi.com/v1OpenAI- and Anthropic-compatible routes
https://myusapi.com/v1betaGemini-native routes

Authentication

Send the key in any of these headers; the gateway normalises it. Keep keys out of URLs; only /v1beta accepts ?key= for Google SDK compatibility.

Authorization: Bearer <KEY>All routes (recommended)
x-api-key: <KEY>All routes; the Anthropic SDK default
x-goog-api-key: <KEY>/v1beta routes; the Google SDK default

Request examples

Set MYUSAPI_API_KEY first; each one runs as copied. GET /v1/models shows the models your key can call.

OpenAI Chat Completions

cURL
curl https://myusapi.com/v1/chat/completions \
  -H "Authorization: Bearer $MYUSAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Hello"}]}'

OpenAI Responses

cURL
curl https://myusapi.com/v1/responses \
  -H "Authorization: Bearer $MYUSAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-6.1-sol","input":"Hello"}'

Anthropic Messages

cURL
curl https://myusapi.com/v1/messages \
  -H "x-api-key: $MYUSAPI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-opus-5-5","max_tokens":64,"messages":[{"role":"user","content":"Hello"}]}'

Gemini native

cURL
curl https://myusapi.com/v1beta/models/gemini-4-argon:generateContent \
  -H "x-goog-api-key: $MYUSAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"Hello"}]}]}'

Endpoints

  • GET/v1/modelsCatalogList the models your key can call.
  • GET/v1/models/{model}CatalogRead one model.
  • POST/v1/chat/completionsChat CompletionsStreamingOpenAI Chat Completions. Works for all four providers; the gateway converts non-OpenAI models.
  • POST/v1/responsesResponsesStreamingOpenAI Responses, the protocol Codex CLI uses. GPT-6 tool calling requires it.
  • POST/v1/messagesAnthropic MessagesStreamingAnthropic Messages, the protocol Claude Code and the Anthropic SDK use.
  • POST/v1/messages/count_tokensAnthropic MessagesCount input tokens for a Messages request before sending it.
  • GET/v1beta/modelsGemini nativeGemini-native model list for Gemini CLI and the Google SDK.
  • GET/v1beta/models/{model}Gemini nativeRead one Gemini model.
  • POST/v1beta/models/{model}:generateContentGemini nativeGemini-native generation.
  • POST/v1beta/models/{model}:streamGenerateContentGemini nativeStreamingGemini-native streaming. Use ?alt=sse.
  • POST/v1beta/models/{model}:countTokensGemini nativeGemini-native token counting.
  • GET/v1/usageUsageRead status and token usage for the calling key. Balances and spend are not returned; check the customer portal or your workspace.

Streaming

Set "stream": true to receive SSE; Gemini-native calls use :streamGenerateContent?alt=sse. While a request waits for a concurrency slot, the gateway sends a keep-alive every 10 seconds. Errors after the stream starts arrive as an SSE error event.

Response headers

x-client-request-idx-request-idrequest-idretry-afterx-should-retryx-ratelimit-limit-requestsx-ratelimit-remaining-requestsx-ratelimit-reset-requestsx-ratelimit-limit-tokensx-ratelimit-remaining-tokensx-ratelimit-reset-tokens

Machine-readable specs

The OpenAPI file and llms.txt are generated from the same definition as this page and the gateway.

Service availabilityAccounts and key delivery live in your workspace (/workspace). Available endpoints and models depend on current service status and account access. Top up in US dollars by card, or by Alipay or WeChat Pay where the checkout lists them; if you already hold USDC, you can use native USDC on Solana. View service status