Endpoints and Base URL
Distinguish the API root, SDK base and complete endpoint.
URL reference
| Purpose | URL |
|---|---|
| Claude Code / Anthropic SDK root | https://api.neatrouter.com |
| OpenAI SDK / compatible clients | https://api.neatrouter.com/v1 |
| Messages endpoint | https://api.neatrouter.com/v1/messages |
| Chat Completions endpoint | https://api.neatrouter.com/v1/chat/completions |
| Model list | https://api.neatrouter.com/v1/models |
| Responses / Codex | https://api.neatrouter.com/v1/responses |
| Key balance and spending | https://api.neatrouter.com/v1/balance |
| Recent usage for this key | https://api.neatrouter.com/v1/usage |
Use the root or SDK base from the table, without a complete endpoint path. Do not append /v1 twice. Responses uses GPT models; Messages uses Claude models.
Model catalog
List the models allowed for the current key. See model pricing for rates. Example IDs are claude-sonnet-5-5 for Claude and gpt-6.1-sol for GPT. Copy the exact ID rather than the display name.
curl --fail-with-body "https://api.neatrouter.com/v1/models" \
-H "Authorization: Bearer $RELAY_API_KEY"Responses
curl --fail-with-body "https://api.neatrouter.com/v1/responses" \
-H "Authorization: Bearer $RELAY_API_KEY" \
-H 'content-type: application/json' \
-d '{"model":"gpt-6.1-sol","input":"Hello","max_output_tokens":128}'Balance and usage
Both read-only endpoints require Authorization: Bearer <API_KEY>. Amounts are decimal USD strings to preserve precision. These queries consume no model tokens. Caller-supplied user or key identifiers cannot change their scope.
curl --fail-with-body "https://api.neatrouter.com/v1/balance" \
-H "Authorization: Bearer $RELAY_API_KEY"key.remaining is the key allowance left, and key.used is cumulative spending. Unlimited keys return null for remaining and limit; this does not mean the account has unlimited funds. The account balance is included only if the key permits account quota queries. Requests still require account funds. expires_at=0 means no expiration is configured.
curl --fail-with-body "https://api.neatrouter.com/v1/usage" \
-H "Authorization: Bearer $RELAY_API_KEY"data contains recent records for the current key, newest first. limit is the server maximum; pagination is not supported. Records expose the platform request ID, model, input/output tokens, actual cost, stream flag and duration. Use the console usage logs for complete history, filtering and exports.
Records settled under the current pricing policy also include pricing: list_price_cost is the published-price amount, savings is the request discount, and price_version identifies the rate used. cost always means the actual charge; all amounts are USD strings. Introductory and volume discounts use the better eligible rate and never stack. Check the console wallet for eligibility, expiry and remaining allowance; see billing.
Exhausted or expired keys retain access to their own read-only usage. Disabled keys, banned accounts and requests outside an IP allowlist are rejected. Responses use Cache-Control: no-store; never place authenticated queries in a public cache.
Authentication
OpenAI-compatible requests use Authorization: Bearer <API_KEY>. Messages supports x-api-key and requires anthropic-version: 2023-06-01. Use content-type: application/json for JSON and a complete key created on this platform.
Models and streaming
Use the exact allowed model ID in model, rather than a display name. Protocols and capabilities depend on the selected model.
Set stream: true, read SSE events and support cancellation. Once content has arrived, avoid automatically replaying the entire request to prevent duplicate output and extra usage.
Local request ID
Keep the local request ID, time and model for support. Do not send complete keys or sensitive prompts. See the error reference.
Still have a question?
Support details have not been published.