Skip to content

GetAPI

Common errors, limits and billing. Find the cause of a problem and how to resolve it. To connect an app, open the setup guide.

On this page

API errors

Check HTTP status and the structured error code first. The human-readable message can change. Stream errors also require handling, even when the HTTP status is 200.

Example error envelope
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded",
    "request_id": "example-request-id",
    "retryable": true
  }
}

Scroll horizontally to see all columns.

HTTPcodeCauseAction
400VALIDATION_ERRORInvalid JSON, parameters or context size.Fix the request body before retrying.
400context_length_exceededInput and maximum output do not fit the model context.Shorten history or start a new conversation. Input plus maximum output must fit in context.
400invalid_output_tokensThe output limit is invalid or conflicts with another parameter.Use one compatible positive output limit for the selected protocol.
400conflicting_output_tokensThe output limit is invalid or conflicts with another parameter.Use one compatible positive output limit for the selected protocol.
400unsupported_output_tokensThis endpoint does not support the supplied output limit.Fix the request body before retrying.
400request_too_complexThe JSON structure is too deep or complex.Reduce history or attachments.
400tool_declarations_missingTool history is present without the required tool definitions.Refresh client configuration and send current tool declarations with call history.
400safeguards_unsupportedThe model route does not support the safeguards check.Update Claude Code and follow its built-in safety-check flow.
400invalid_mediaAn attachment has an unsupported format or URL.Reduce history or attachments.
400too_many_media_partsThe request contains too many attachments.Reduce history or attachments.
400media_too_largeAttachments exceed the supported size.Reduce history or attachments.
401UNAUTHORIZEDMissing, invalid or expired key.Check the key and its expiry in API Keys.
401api_key_expiredMissing, invalid or expired key.Check the key and its expiry in API Keys.
402INSUFFICIENT_BALANCEInsufficient balance or key budget.Top up your wallet or choose a cheaper model.
402spend_cap_exceededThe key’s own spending cap has been reached.Increase the cap in API Keys or use another permitted key.
402SPEND_CAP_EXCEEDEDThe key’s own spending cap has been reached.Increase the cap in API Keys or use another permitted key.
403FORBIDDENAccess denied.Check key permissions and model access.
400 / 404invalid_modelIncorrect path or unavailable model.Check Base URL and the exact model ID.
404NOT_FOUNDIncorrect path or unavailable model.Check Base URL and the exact model ID.
409CONFLICTThe request ID was already used or the operation conflicts with the current state.Check the result and billing status in request history before resending.
413body_too_largeRequest too large.Reduce history or attachments.
413 / 415REQUEST_FAILEDThe request body exceeds a limit or uses an unsupported format.Fix the request body before retrying.
400 / 404 / 409 / 413 / 422request_rejectedThe model request was rejected; provider-specific error codes are not exposed.Fix the request body before retrying.
429request_rate_limitedThe request rate limit for the current time window was reached.Respect Retry-After and reduce concurrency.
429RATE_LIMITEDRequest, token or concurrency limit.Respect Retry-After and reduce concurrency.
429concurrent_request_limitToo many requests are running at once.Respect Retry-After and reduce concurrency.
429token_rate_limitedThe token allowance for the current time window is exhausted.Respect Retry-After and reduce concurrency.
429context_upload_busyToo many large requests are being uploaded at once.Respect Retry-After and reduce concurrency.
429request_capacity_busyOther running requests temporarily reserve the available balance.Respect Retry-After and reduce concurrency.
503billing_unavailableThe rate or billing service is temporarily unavailable.Retry with backoff and a bounded number of attempts.
503billing_pendingUsage is being reconciled; the reservation is not a final charge.Check the result and billing status in request history before resending.
502 / 503provider_unavailableTemporary service error.Retry with backoff and a bounded number of attempts.
503SERVICE_UNAVAILABLETemporary service error.Retry with backoff and a bounded number of attempts.
500INTERNAL_SERVER_ERRORTemporary service error.Retry with backoff and a bounded number of attempts.

These are GetAPI codes. Provider messages and codes are not passed through unchanged. For another code, save the HTTP status and request ID for support.

Common problems

Scroll horizontally to see all columns.

Symptom or codeSolution
context_length_exceededShorten history or start a new conversation. Input plus maximum output must fit in context.
invalid_output_tokens / conflicting_output_tokensUse one compatible positive output limit for the selected protocol.
invalid_modelFetch available IDs through GET /v1/models.
api_key_expiredCheck the key’s expiry in the dashboard.
spend_cap_exceeded / SPEND_CAP_EXCEEDEDCheck the key’s own budget; a positive account balance does not override it.
tool_declarations_missingRefresh client configuration and send current tool declarations with call history.
404 in an appCheck whether the app expects a Base URL or a full endpoint. Do not add /v1 twice.
Timeout or resetCheck the network, client timeout and direct Base URL. Save any request ID already received.

Rate limits and retries

Scroll horizontally to see all columns.

ResultRetry policy
429Wait for Retry-After when present. Otherwise increase backoff and reduce concurrency.
5xxBounded retries with increasing backoff and jitter.
Other 4xxFix the request, access or balance first.
Disconnect after text or tool deltaDo not replay the entire request automatically. Preserve the partial result and handle the failure.

Account for SDK retries: do not combine unbounded application loops with automatic client retries. Configure a finite timeout for your task. A new request can become a separate billable generation.

Usage and billing

Scroll horizontally to see all columns.

ProtocolUsage fields
Chat Completionsprompt_tokens, completion_tokens, total_tokens
Responsesinput_tokens, output_tokens, total_tokens
Messagesinput_tokens, output_tokens

Cache read and write usage can appear in separate protocol-specific fields. Check final charges in request history and current rates on the pricing page.

Part of the available balance is reserved before generation. After actual usage is calculated, unused reservation is returned. A failure before billable generation does not imply token usage; for partial responses, check the actual result and settlement status in history.

What is charged

  • Completed requests are billed for input, cache and output at the selected model’s rate. A reservation is not a final charge.
  • A confirmed failure before billable generation is not charged, and its reservation is released. Uncertain outcomes are verified first.
  • Missing text alone does not mean an empty response: the model may return reasoning or a tool call. An empty result without confirmed usage is not charged.
  • Internal routing attempts do not create separate customer charges. A retry sent by your app is a new request and may be billed separately.
  • If a stream disconnects after generation starts, completed usage may be charged. Check final usage in request history.
  • A model refusal may be billed as a response when usage is confirmed. A rejection before generation is handled as a failed request.
  • billing_pending means settlement is still being verified. The reservation is released or settled after verification.

Service limitations

  • Availability. Response times, uninterrupted operation and constant model availability are not guaranteed. See current checks on the status page.
  • Models. The catalog can change as models are added or retired. GET /v1/models returns the current models for your key.
  • Pricing. Rates can change. Current public rates are on the pricing page; an individual key rate may differ.
  • Notices. We do not promise advance notice of every price, model or API change. Check current terms before integrating.
  • Compatibility. GetAPI supports OpenAI-compatible and Anthropic-compatible protocols. Features depend on the model; support for every parameter is not guaranteed.

For AI agents

Markdown versions of this help: Russian and English. Site index: llms.txt.

  • Read keys from environment variables or a secret store. Never print them or include them in logs, prompts, URLs, commits or client-side code.
  • Discover model IDs with GET /v1/models. Never guess identifiers.
  • Use HTTP status and error.code, not the wording of message. Handle stream errors even after HTTP 200.
  • On 429, wait for Retry-After. For 5xx, use increasing backoff and bounded retries. Do not retry an unchanged failing 4xx request.
  • After text or tool arguments arrive, do not automatically replay the entire request. Preserve the partial result.
  • Model calls cost money. Run loops, load tests or large batches only when the operator explicitly requests them.
  • For support, report the GetAPI ID from X-Request-Id or error.request_id, the model, time and time zone. Do not include keys or private request content.