ZBStream

Error Codes

ZBStream uses standard HTTP status codes. Error responses usually carry a readable message; clients should log the request time, model, and status code.

What should I do about 429 / 5xx errors?

CodeMeaningSuggested action
400Invalid parameters or message formatCheck the JSON body, model, and messages
401API key missing, invalid, or revokedCheck the Authorization header
402Insufficient credit balanceTop up credits and retry
403API key not authorized for this modelCheck the key's model scope
404Route not foundCheck the base URL and path; verify the model via /v1/models
429Upstream provider rate limitRetry with exponential backoff
500Internal server errorKeep the request details and retry later
502Failed to connect to or read the model serviceRetry later or check channel configuration
503Service not configured or temporarily unavailableRetry later or check service status
504Upstream gateway timeoutRetry later or switch channels

Retry Policy

  • Retry only 429, 502, 503, 504, and network interruptions, with a bounded number of attempts.
  • Never auto-retry parameter errors, authentication errors, or insufficient balance.
  • Keep your own request idempotency keys for non-idempotent operations to avoid double processing.