Integration GuideAuthenticationEndpoint conventionsModelsErrors
StarmodelStarmodel
Get StartedAPI Reference

Errors

Every Starmodel gateway error returns a structured JSON body with a stable code. Branch on code, not the human-readable message.

Error format

All errors share one envelope:

{  "error": {    "code": "insufficient_credits",    "message": "Insufficient credits. Please top up and try again.",    "type": "error"  }}

The Anthropic-compatible /v1/messages endpoint returns errors in Anthropic's own shape instead — a top-level type: "error" with a nested error object holding type and message.

Common errors

StatusCodeMeaning
401unauthorizedMissing, invalid, or disabled API key.
403model_not_allowedThe API key is not permitted to call the requested model.
400invalid_modelThe model value is not a known model id.
400no_available_channelNo upstream channel is currently available for this model.
402insufficient_creditsWallet balance is too low to cover the request.
402subscription_quota_exceededThe subscription's token quota for this cycle is exhausted.
400model_pricing_missingThe model has no published sale price and cannot be billed yet.
429rpm_exceededRequests-per-minute limit exceeded.
429tpm_exceededTokens-per-minute limit exceeded.
429concurrency_exceededToo many concurrent requests.
502upstream_errorThe upstream provider returned an error.
500internalUnexpected gateway error — retry, then contact support if it persists.

Rate limits & retries

429 responses include a Retry-After header (in seconds) — wait that long before retrying. rpm_exceeded / tpm_exceeded are per-minute request / token limits; concurrency_exceeded means too many requests are in flight at once.

Billing & pricing

A 402 means the wallet can't cover the request — top up (insufficient_credits) or wait for the next cycle (subscription_quota_exceeded). The 400 model_pricing_* / model_not_billable codes mean the model has no published sale price yet; contact the administrator to configure and publish pricing.

Handling errors

Read error.code to branch programmatically — it is stable. error.message is meant for humans and may change. Retry 429 and 502 with backoff; do not retry 4xx billing or validation errors without changing the request first.

On this page

Error formatCommon errorsRate limits & retriesBilling & pricingHandling errors
{
  "error": {
    "code": "insufficient_credits",
    "message": "Insufficient credits. Please top up and try again.",
    "type": "error"
  }
}