---
title: "API reference: Chat, Responses, Messages & Gemini | MYUSAPI"
description: "Every MYUSAPI endpoint: OpenAI Chat Completions and Responses, Anthropic Messages and Gemini-native routes, with authentication and request examples."
url: https://myusapi.com/en/docs/api
---

# API reference

One key, four protocols.

## Base URLs

https://myusapi.com/v1 OpenAI- and Anthropic-compatible routes

https://myusapi.com/v1beta Gemini-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 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 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 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 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/models Catalog List the models your key can call.
- GET /v1/models/{model} Catalog Read one model.
- POST /v1/chat/completions Chat Completions Streaming OpenAI Chat Completions. Works for all four providers; the gateway converts non-OpenAI models.
- POST /v1/responses Responses Streaming OpenAI Responses, the protocol Codex CLI uses. GPT-6 tool calling requires it.
- POST /v1/messages Anthropic Messages Streaming Anthropic Messages, the protocol Claude Code and the Anthropic SDK use.
- POST /v1/messages/count_tokens Anthropic Messages Count input tokens for a Messages request before sending it.
- GET /v1beta/models Gemini native Gemini-native model list for Gemini CLI and the Google SDK.
- GET /v1beta/models/{model} Gemini native Read one Gemini model.
- POST /v1beta/models/{model}:generateContent Gemini native Gemini-native generation.
- POST /v1beta/models/{model}:streamGenerateContent Gemini native Streaming Gemini-native streaming. Use?alt=sse.
- POST /v1beta/models/{model}:countTokens Gemini native Gemini-native token counting.
- GET /v1/usage Usage Read 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-id x-request-id request-id retry-after x-should-retry x-ratelimit-limit-requests x-ratelimit-remaining-requests x-ratelimit-reset-requests x-ratelimit-limit-tokens x-ratelimit-remaining-tokens x-ratelimit-reset-tokens

## Machine-readable specs

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

[openapi.yaml](https://myusapi.com/openapi.yaml)[llms.txt](https://myusapi.com/llms.txt)

Service availability Accounts 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](https://myusapi.com/en/status)
