Connect any model
One API key, one endpoint, every available model — native Anthropic, OpenAI, and Gemini protocols plus an OpenAI-compatible API for any client. Your AI agent configures and verifies the connection.
For your agent
Connection help
IDE, SDK, endpoint, models, and request errors.
Quick start
Connect apiToken.sale to the coding agent that reads, edits, and runs your project. Choose the stack — the exact setup appears below.
One endpoint, every protocol
router.apitoken.sale is the single entry point for all providers. Coding agents and official SDKs get byte-faithful native APIs; any OpenAI-compatible client reaches every catalog model through one universal route. Same sk-pool key, same prepaid balance, everywhere.
Balance and usage API
The same key that spends the money reads what it spent. One route returns the live balance and the exact spend over any window, across every provider — no dashboard, no second credential.
| Parameter | What it does |
|---|---|
from | Start of the window, inclusive. RFC3339 UTC — 2026-08-01T00:00:00Z, an explicit numeric offset, or a bare 2026-08-01. Defaults to to minus 30 days. |
to | End of the window, **exclusive**. Same forms. Defaults to now; a future value is clamped to now. |
group_by | model (default), provider, day, day,provider, day,model or api_key. Order inside the list does not matter, and model,provider is simply an alias of model — a model row already names its provider. |
Two prices, both exact. cost is what you were charged; list_cost is the provider list price for the same traffic — the difference is your discount. Each also comes as an integer *_nano string. Read money as a string, never as a float.
Explicit UTC only. Local time without an offset is rejected: guessing a zone would silently move the boundaries of a money report. The window must be positive and at most 366 days, otherwise the answer is 400 in the host protocol error envelope (Anthropic, OpenAI or Google of that host), with the reason in error.message.
Slices that add up. Every slice of one window sums to the same total, because all of them are read from a single consistent snapshot. Token counts live in the model, provider and day,model slices; the plain day slices carry money and request counts. day,model — the per-model daily series — is capped at 92 days and answers 400 beyond that instead of silently dropping rows. Keys are masked. GET /balance returns the balance alone.
Models & pricing
All providers, every available model, and exact per-1M-token rates — official list price vs. what you actually pay at the flat 50% discount.
Claude · Anthropic Messages API
router.apitoken.salePOST /v1/messages| Model | Context | Max output | Input | Cached input | Cache write | Output |
|---|---|---|---|---|---|---|
Claude Fable 5.1Latestclaude-fable-5-1 | 1M | 128K | $5 | $0.125 | $6.25 | $25 |
Claude Opus 5claude-opus-5 | 1M | 128K | $2.5 | $0.25 | $3.125 | $12.5 |
Claude Fable 5claude-fable-5 | 1M | 128K | $5 | $0.5 | $6.25 | $25 |
Claude Opus 4.8claude-opus-4-8 | 1M | 128K | $2.5 | $0.25 | $3.125 | $12.5 |
Claude Opus 4.7claude-opus-4-7 | 1M | 128K | $2.5 | $0.25 | $3.125 | $12.5 |
Claude Sonnet 5claude-sonnet-5 | 1M | 128K | $1 | $0.1 | $1.25 | $5 |
Claude Sonnet 4.6claude-sonnet-4-6 | 200K | 128K | $1.5 | $0.15 | $1.875 | $7.5 |
Claude Haiku 4.5claude-haiku-4-5 | 200K | 64K | $0.5 | $0.05 | $0.625 | $2.5 |
GPT · OpenAI Responses API
router.apitoken.salePOST /v1/responses · POST /v1/chat/completions| Model | Context | Max output | Input | Cached input | Cache write | Output |
|---|---|---|---|---|---|---|
GPT-6 AstraLatestgpt-6-astra | 872K | 128K | $5 | $0.5 | $6.25 | $25 |
GPT-5.6 Solgpt-5.6-sol | 1.05M | 128K | $2 | $0.2 | $2.5 | $10 |
GPT-5.6 Terragpt-5.6-terra | 1.05M | 128K | $1 | $0.1 | $1.25 | $6 |
GPT-5.6 Lunagpt-5.6-luna | 1.05M | 128K | $0.1 | $0.01 | $0.125 | $0.6 |
GPT-5.5gpt-5.5 | 1.05M | 128K | $2.5 | $0.25 | $2.5 | $15 |
GPT-5.4gpt-5.4 | 1.05M | 128K | $1.25 | $0.125 | $1.25 | $7.5 |
GPT Image 2gpt-image-2 | per request | 1 image | $2.5 | $0.625 | $0 | $15 |
Gemini · Google Gemini API
router.apitoken.salePOST /v1beta/models/{model}:generateContent| Model | Context | Max output | Input | Cached input | Cache write | Output |
|---|---|---|---|---|---|---|
Gemini 3.8 FlashLatestgemini-3.8-flash | 1M | 64K | $0.375 | $0.0375 | — | $1.875 |
Gemini 3.7 Flashgemini-3.7-flash | 1M | 64K | $0.375 | $0.0375 | — | $1.875 |
Gemini 3.6 Flashgemini-3.6-flash | 1M | 64K | $0.375 | $0.0375 | — | $1.875 |
Gemini 3.5 Flashgemini-3.5-flash | 1M | 64K | $0.75 | $0.075 | — | $4.5 |
Gemini 3 Flash Previewgemini-3-flash-preview | 1M | 64K | $0.25 | $0.025 | — | $1.5 |
Gemini 3.1 Pro Previewgemini-3.1-pro-preview | 1M | 64K | $1 | $0.1 | — | $6 |
Gemini 3.1 Flash-Litegemini-3.1-flash-lite | 1M | 64K | $0.125 | $0.0125 | — | $0.75 |
Gemini 2.5 Flashgemini-2.5-flash | 1M | 64K | $0.15 | $0.015 | — | $1.25 |
Gemini 2.5 Flash-Litegemini-2.5-flash-lite | 1M | 64K | $0.05 | $0.005 | — | $0.2 |
Kimi · Anthropic Messages API
router.apitoken.salePOST /v1/messages| Model | Context | Max output | Input | Cached input | Cache write | Output |
|---|---|---|---|---|---|---|
Kimi K3Latestk3 | 1M | not published | $1.5 | $0.15 | $1.5 | $7.5 |
Kimi K3 (256K)k3-256k | 256K | not published | $1.5 | $0.15 | $1.5 | $7.5 |
Kimi for Codingkimi-for-coding | 256K | not published | $0.475 | $0.095 | $0.475 | $2 |
Kimi for Coding HighSpeedkimi-for-coding-highspeed | 256K | not published | $0.95 | $0.19 | $0.95 | $4 |
2M input × $10 = $20400K output × $50 = $20Official total = $40- Rates are per 1M tokens; billing is metered per token at official provider rates, then the flat 50% discount is subtracted.
- Thinking and reasoning tokens bill as output on both providers.
- GPT requests above 272K input tokens bill at official long-context rates: 2× input and 1.5× output on the whole request.
- Gemini rates follow the official Google standard paid tier.
- The live enabled set is always available at
GET /v1/modelson the unified endpoint — one aggregated catalog for all providers.
Gemini Batch API
Run many independent Gemini requests asynchronously, poll one durable operation, and retrieve every generated response or per-item error. The same native API works through the unified router and direct Gemini endpoint.
https://router.apitoken.sale or the direct https://gemini.api.apitoken.sale. Only the hostname changes: paths, bodies and x-goog-api-key authentication are identical. Keep the key server-side.Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /v1beta/models/{model}:batchGenerateContent | Create an asynchronous operation |
GET | /v1beta/batches/{id} | Poll state and read item results |
GET | /v1beta/batches?pageSize={n}&pageToken={token} | List this account’s operations |
POST | /v1beta/batches/{id}:cancel | Request cancellation; already dispatched items may finish |
DELETE | /v1beta/batches/{id} | Delete a terminal operation |
POST | /upload/v1beta/files | Start or continue a resumable JSONL upload |
GET | /v1beta/files | List account-scoped gateway files |
GET | /v1beta/files/{id} | Read file metadata |
GET | /v1beta/files/{id}:download | Stream or range-download an active file |
DELETE | /v1beta/files/{id} | Delete a file not referenced by live work |
Large input with JSONL
A nonempty line must be one JSON object with a unique correlation key and a request object. Do not wrap lines in an array. Blank lines and CRLF are accepted. Upload the file to this gateway, then pass the returned files/{id} as inputConfig.fileName.
Limits and retention
| Limit | Value |
|---|---|
| Inline create body | 20 MiB |
| Items per Batch | No product ceiling. One client job stays one job. |
| Nonterminal Batches per account | 100 |
| JSONL line | 20 MiB |
| Upload chunk | 8 MiB |
| Uploaded file TTL | 48 hours |
| Queue deadline | 48 hours |
| Terminal result retention | 42 days |
| List page | 1–1,000 |
The account must have a positive prepaid balance. Accepted work is durable and may remain queued during temporary capacity pressure. Ultra subscriptions use up to 20 durable Batch slots; every other plan uses 2, with a random durable 2–5 second interval between starts on one subscription. Standard Gemini token pricing and your normal account discount apply; there is no separate Batch discount or completion-time SLA.
How this differs from Google Batch
| Area | apiToken.sale behavior |
|---|---|
| Execution | Asynchronous non-streaming gateway jobs; not Vertex AI Batch, GCS or BigQuery. |
| Pricing | Normal Gemini tariff and your account discount. No separate Batch discount or completion SLA. |
| Inline schema | Official InlinedRequests wrapping (requests.requests[]) and a raw array are both accepted. Proto-JSON snake_case aliases are accepted. |
| Files | Files belong to your apiToken.sale account, not to a Google Cloud project. Foreign Google files are invisible. |
| fileData | Synchronous fileData is 400 INVALID_ARGUMENT / FILE_URI_UNSUPPORTED: the official Gemini API accepts it; send inlineData instead. Batch JSONL uses inputConfig.fileName. |
| File output | File-input jobs publish an ordered encrypted JSONL responsesFile before done=true; inline jobs retain inlinedResponses. |
| Timestamps | Operation timestamps are RFC 3339 UTC (google-datetime). |
| Unsupported | No webhooks, embedding/update Batch methods, image-output models, Google IAM or stock Vertex resource semantics. |
Batch troubleshooting
| Status | What to do |
|---|---|
400 INVALID_ARGUMENT | Fix malformed JSON, both/neither input forms, invalid JSONL, unsupported model or field. Do not retry unchanged. |
400 INVALID_ARGUMENT / API_KEY_INVALID | Missing, invalid or revoked key: the Gemini lane answers 400 with `error.details` reason API_KEY_INVALID, mirroring the official Google API (not 401). Send an active sk-pool key in x-goog-api-key and never retry a revoked key. |
402 FAILED_PRECONDITION | Paid Batch create requires a positive prepaid balance. HTTP 402 FAILED_PRECONDITION is engine-account money, not RESOURCE_EXHAUSTED and not 429. |
404 NOT_FOUND | Wrong, deleted, expired or foreign-account job/file; verify the full resource name and account. |
409 ABORTED | Idempotency key reused with changed content, or upload offset mismatch. |
FAILED_PRECONDITION | Wait/cancel before deleting a live Batch; a live Batch reference also blocks file deletion. |
429 / 503 | Temporary quota, capacity or authority condition. Poll/retry with capped exponential backoff and jitter. |
Sending files to Gemini
Synchronous generateContent requires inline bytes: files/… from any Google project is invisible to this gateway. For large Gemini Batch input, upload an account-scoped JSONL file to this gateway and pass its returned name as inputConfig.fileName. Uploaded files expire after 48 hours.
| Input | Supported | How to send it |
|---|---|---|
| Images (PNG, JPEG, WebP) | Yes | inline_data with mime_type and base64. Up to ~23 MB of source file. |
| PDF documents | Yes | inline_data with application/pdf. The model reads the text inside. |
| Text files | Yes | inline_data with text/plain, or simply paste into the text part. |
| Audio | All text models | Any text model, as inline audio/wav. |
Files API (file_uri / fileData) | One model | Batch JSONL input only: upload to this gateway and pass the returned files/{id} as inputConfig.fileName. fileData embedding is not supported. For synchronous generateContent, inline the bytes. |
cachedContent | No | Not available. Send the content inline. |
When we refuse. An input this gateway cannot accept is rejected before dispatch, as 400 INVALID_ARGUMENT with a stable ErrorInfo reason — FILE_URI_UNSUPPORTED, CACHED_CONTENT_UNSUPPORTED, AUDIO_INPUT_UNSUPPORTED. The message follows {field} cannot be honoured on this endpoint. The official Gemini API accepts it; {workaround}. FILE_URI_UNSUPPORTED applies to synchronous generateContent and foreign Google files; Batch may resolve only files uploaded to this gateway under the same account. Those refusals are final: changing the request is the fix, retrying is not. Every error also carries an x-request-id header — quote it to support and we can find your exact request.
Common response codes
On the unified endpoint every protocol keeps its own error envelope: Anthropic lanes (including the KIMI lane on kimi/*) return Anthropic's JSON (gateway limitations add `error.details.error_code` / `param`), OpenAI lanes return {"error":{"message","type","param","code"}}, and the Gemini lane returns {"error":{"code","message","status","details"}}. Treat 401 and 402 as account-state failures; retry only transient 429 and 5xx. The full exact-text catalog is /docs/errors.
| Status | Meaning | What to do |
|---|---|---|
400 | Malformed request, unsupported_parameter, or documented_limitation | Fix the body. If error.code or error.details.error_code is documented_limitation or unsupported_parameter, omit or relocate the named field — the official API of that protocol accepts it; this endpoint does not. Do not retry unchanged. |
401 | API key is missing, invalid, or revoked | Send an active sk-pool key in x-api-key. If it was revoked, create a replacement; do not retry the same key. On the native Gemini lane the same failure arrives as 400 INVALID_ARGUMENT with `error.details` reason `API_KEY_INVALID` — mirroring the official Google API; treat it exactly like a 401. |
402 | Available prepaid balance is too low | Top up the account, confirm the balance is available, then retry. Backoff alone will not resolve a 402. Anthropic lanes: 402 billing_error. OpenAI lanes: 402 insufficient_quota (not 429 — SDKs retry 429). Gemini native: 402 FAILED_PRECONDITION. |
429 | Rate limit or temporary upstream capacity limit | Honor Retry-After when present; retry with capped exponential backoff and jitter. |
5xx | Temporary gateway or provider upstream failure | Retry with bounded exponential backoff. Keep the request ID and avoid unbounded duplicate attempts. |
Prompt caching
Claude requests get a 5-minute prompt cache automatically. You can set an explicit breakpoint or select the 1-hour TTL; every later read bills at 10% of the input price.
Next steps
Everything referenced from this page, in one place.