Skip to main content

Error Codes

Every HTTP status and error code the CallMissed API returns, what causes it, and how to recover.

Error Format

The API returns errors in one of two shapes, depending on the surface. Neither ever contains an upstream provider's raw error or a stack trace.

Inference endpoints (/v1/*, /anthropic/v1/*) use the OpenAI error envelope, so existing SDK error handling works unchanged. code is stable and machine-readable; message is for humans.

{
  "error": {
    "message": "Insufficient credits (balance: 0.0). Purchase more at https://console.callmissed.com/org/billing",
    "type": "insufficient_quota",
    "code": "insufficient_credits"
  }
}

Platform endpoints (/api/v1/*: agents, conversations, CRM, support, knowledge, webhooks, telephony and the rest) return a detail string:

{ "detail": "API key missing required scope: contacts:write. Add it under the key's 'Permissions' section in your dashboard." }

A request that fails schema validation returns 422 with detail as a list of the fields that failed:

{
  "detail": [
    { "loc": ["body", "k"], "msg": "Input should be less than or equal to 50", "type": "less_than_equal" }
  ]
}

HTTP Status Codes

StatusMeaningTypical cause
200 / 201 / 202 / 204Success201 created, 202 accepted for async work, 204 deleted with no body
400Bad RequestInvalid parameter value, unsupported option for this model
401UnauthorizedMissing, unknown, revoked or expired API key
402Payment RequiredOut of credits, the key's own budget is spent, or the account has no payment method on file
403ForbiddenKey lacks the permission, scope or model; origin not allowlisted; account inactive
404Not FoundThe id does not exist, or belongs to another account
409ConflictDuplicate resource, or an Idempotency-Key reused for a different request
413Payload Too LargeUpload over the endpoint's size cap
422Unprocessable EntitySchema validation failed (bad enum, out-of-range number, missing field)
429Too Many RequestsPer-key rate limit, monthly plan cap or budget cap, or too many requests in flight
500 / 502Server ErrorUnexpected failure, or the model failed upstream. Safe to retry
503Service UnavailableThe model or service is temporarily unavailable or under maintenance

Error codes on the inference endpoints

CodeStatusMeaning
invalid_api_key401The cm_ key is missing, unknown or revoked
api_key_expired401The key passed its expiry date. Issue a new one
insufficient_credits402Your credit balance is too low. Top up
budget_exceeded402This key's own budget is spent. Raise it on the key
payment_method_required402The account has no verified payment method. Add a card or UPI Autopay on the billing page of the console, then retry
permission_denied403The key lacks the service permission (llm, stt, tts, image, search)
model_not_available403The model needs a paid plan
model_not_allowed403The model is outside the key's allowed-models list
search_provider_not_allowed403The key's allowed search providers exclude the one requested
domain_not_allowed403The request origin is not in the key's domain allowlist
account_inactive / account_terminated403The account is not active. Contact support
model_not_found404No model with that id. See GET /api/v1/models
context_length_exceeded400The input is longer than the model's context window
content_policy_violation400An image-generation prompt was refused by the content policy. Rephrase it
rate_limit_exceeded429Over the key's requests-per-minute limit
quota_exceeded429The plan's monthly call cap for this service, or your monthly budget cap, is reached. Retry-After gives the seconds until the 1st
too_many_concurrent_requests429Too many requests from this key are still in flight. Retry after a few seconds
upstream_error / provider_error502 / 503The model failed to answer. Retry with backoff, or switch model
model_under_maintenance503The model is temporarily out of service

Notice header

While an account is inside its grace period for adding a payment method, successful responses carry X-CallMissed-Notice: payment_method_required; deadline=YYYY-MM-DD; …. Add a payment method before that date; after it, the same calls return 402 payment_method_required.

Retrying

  • On 429 with Retry-After, wait at least that many seconds. Without the header, back off exponentially with jitter. A quota_exceeded 429 lasts until the 1st of next month, so upgrade or raise the cap rather than wait.
  • On 500, 502 and 503, retry once or twice with jittered backoff. Send an Idempotency-Key on inference POSTs so a retry never runs or bills a call twice.
  • On 401, 402 and 403, do not retry. Fix the key, credits, permission or scope first.