FocalAPI Docs

Error Codes

Error response format and troubleshooting for common error codes

Error response format

Errors return a non-2xx status with a JSON body:

{
  "error": {
    "message": "no available channel (distributor) (request id: ...)",
    "type": "focal_api_error",
    "code": "insufficient_quota"
  }
}

When troubleshooting, record the HTTP status, error.code, and the request id from the response.

Common error codes

HTTPcodeMeaningWhat to do
400invalid_request_errorMissing/illegal parameters (e.g. duration out of range, wrong model name)Check parameters against the API reference
401invalid_api_keyKey missing, invalid or deletedVerify the Authorization header and token status
402insufficient_quotaInsufficient balance (including pre-charge cap)Top up and retry; check token quota limits
403permission_deniedNo access to the model/featureConfirm group and token model scope
429rate_limit_exceededRate limitedReduce concurrency; retry with exponential backoff
500internal_errorServer errorContact the operator with the request id
501endpoint_unavailableEndpoint not implemented/open (e.g. Files, Fine-tunes)Use an available endpoint instead
502/503upstream_errorUpstream model service failureRetry later; report persistent failures

Async task errors

A failed video task is not an HTTP error — the task status becomes failed, details live in the task's error field, and the charge is refunded automatically.

Troubleshooting checklist

  1. What are the HTTP status and error.code?
  2. Does the same key work in the console Playground? (Separates config issues from code issues)
  3. Does the model name match GET /v1/models exactly?
  4. For streaming, are SSE frames handled correctly?

On this page