Skip to content
tacita.chat
Docs · Errors & rate limits

Developers

Errors & rate limits

Error format, every error code the API returns, what to do about each, and the per-key rate limit.

On this page

Errors use the familiar JSON shape. The OpenAI SDKs turn them into their usual error classes (APIError, AuthenticationError, RateLimitError, …).

{ "error": { "code": "spend_limit_reached", "message": "This API key reached its monthly spend limit", "monthlyLimitMicro": 5000000, "spentThisPeriodMicro": 5000000, "periodResetsAt": "2026-11-01T00:00:00.000Z" } }

Branch on error.code, not on the message. Amounts ending in Micro are in micro-USD: 1,000,000 equals $1.

HTTPcodeWhat to do
400invalid_requestFix the request. message names the field.
400upstream_rejectedThe model rejected the input, e.g. it's longer than the context window.
401invalid_api_keyThe key is wrong or revoked. Create a new one.
402insufficient_creditsFree credits plus paid balance can't cover the request. Lower max_tokens, pick a different model, or top up. resetsAt says when free credits refill.
402spend_limit_reachedThe key hit its monthly limit. Raise it on the Developers page, or wait for periodResetsAt.
403tee_api_not_availableTEE through the API isn't available yet. Use mode: "anonymous".
404model_not_foundUnknown model id. Check GET /v1/models.
404model_unavailableThe model can't answer right now. Try another one or add fallback_models. You were not charged.
404not_foundUnknown or expired video job or media link.
409request_in_progressAn image request with the same X-Tacita-Request-Id is still running. Poll GET /media/by-request/{id}.
413payload_too_largeThe body is over 4 MB.
422content_blockedThe image or video prompt was refused by the safety check.
429rate_limitedSlow down. Respect Retry-After.
502upstream_errorThe provider failed. Retry. You were not charged.
503upstream_unavailable, upstream_rate_limitedTemporary. Retry with backoff. You were not charged.
503moderation_unavailableThe image and video safety check is down. Retry shortly.
503media_unavailableThe image could not be stored for delivery. You were not charged. Retry.
500internal_errorOur bug. Retry, and tell us if it persists.

Rate limits#

  • 120 requests per minute per API key, the same for every key.
  • Over the limit, you get 429 rate_limited with Retry-After in seconds.
  • The OpenAI SDKs retry 429 and 5xx automatically, twice by default.

Retries and charges#

  • A failed request is never charged.
  • If the stream fails after it started, you pay only for what was generated.
  • Retrying is safe. A retry is a new request and is charged on its own.