Error codes
SparkAPI returns the same HTTP status codes and error shape as the upstream provider would. If you can decode an Anthropic or OpenAI error, you can decode ours.
Client errors (4xx)
Your request body is malformed — missing required field, wrong type, or invalid value.
- Check that
model,messages/input, andmax_tokensare present and the right type. - For tool calls, make sure
toolsis a JSON array (not a JSON string of an array — common copy-paste mistake). - The
typefield on each message must be one ofuser/assistant(Anthropic) oruser/system/assistant/tool(OpenAI).
The API key is missing, malformed, or doesn't match an active account.
- Confirm the key starts with
cr_and is 32+ characters. - Use
x-api-keyfor Claude / Anthropic requests, andAuthorization: Bearer ...for Codex/OpenAI-compatible and Gemini requests. See the endpoints page. - If the key used to work, check the dashboard — accounts with zero balance and no recent activity are sometimes suspended.
The key is valid but isn't allowed to use the requested model. Most often happens when a Claude key tries to call a GPT model by accident.
- Check the
modelfield — all keys have access to all 12 curated models, so this is almost always a typo.
The model you sent isn't in our catalog. We proxy 12 curated models plus a long tail of others — but not every model that exists on Anthropic / OpenAI / Google's site.
You sent too many requests in a short window, or hit a per-model concurrency cap.
- Default per-key limit is 60 requests / minute. For higher limits, email support.
- Exponential backoff: wait 1s, retry. Double on each failure (1s → 2s → 4s → 8s, max 30s).
- If you see this on a single concurrent request, the model itself may be rate-limited upstream. Switch to a different model in the same family (e.g.
claude-sonnet-4-6→claude-haiku-4-5).
The upstream model is temporarily overloaded. Not your fault — the model is at capacity.
- Wait 5–15 seconds and retry. The error usually clears within a minute.
- For production, set up a fallback: try
claude-sonnet-4-6first, fall back toclaude-haiku-4-5on 529.
Payment & account errors
Your account balance is zero or negative.
- Top up from the dashboard. The key resumes working within seconds of payment.
- If you were charged but the balance didn't update, refresh the dashboard — webhook delivery can lag by 30s.
The account has been suspended (chargeback, ToS violation, or fraud signal).
- Email support@sparkapi.cc — we reply within 12 hours.
Server errors (5xx)
Something on our side went wrong. Safe to retry after a few seconds.
- If you see the same 500 on 3+ consecutive retries, email support with the
x-request-idheader from the response.
Could not reach the upstream provider. Usually transient (sub-30s).
- Retry with backoff. If it persists past a minute, check the dashboard status indicator.
The upstream provider took too long to respond. Default timeout is 120s.
- For very long generations, increase your client-side timeout, or switch to a streaming request and read tokens as they arrive.
Still stuck?
Open a ticket at support@sparkapi.cc with:
- The full error body (status code + JSON)
- The
x-request-idresponse header - The model and a redacted request body (replace any sensitive content with placeholders)
We reply within 12 hours, weekdays.