Error Codes

SilvaMux's error format depends on the API type. This page summarizes the common error format, model-call error codes, and retry advice.

Gateway API Errors (Model Calls)

The error format of chat, image, and video model APIs is determined by the model protocol, rendered in one of four shapes — OpenAI / Anthropic / Gemini / Volcengine — with a unified code string.

{
  "error": {
    "message": "Detailed error message",
    "type": "gateway_error",
    "code": "ERROR_CODE"
  }
}

When the model side returns 4xx/5xx, SilvaMux passes the error response through after sanitization, preserving the HTTP status code; no charges are incurred in that case.

Gateway API Error Codes

Chat, image, and video model calls share the following error codes:

CodeHTTPDescription
MODEL_REQUIRED400Request body missing the model field
MODEL_NOT_FOUND400Model does not exist or is unavailable
INVALID_REQUEST400Invalid request parameters
INVALID_REQUEST_BODY400Failed to parse the request body
UNAUTHORIZED401Authentication failed (invalid API key/JWT)
MODEL_ACCESS_DENIED403Organization lacks the permission flags required by the model
INSUFFICIENT_BALANCE402Insufficient balance
PRE_DEDUCT_FAILED400/402Pre-deduction failed (bad parameters = 400, storage failure = 402)
RATE_LIMITED429Rate limit hit (see Rate Limits)
UPSTREAM_UNAVAILABLE502Failed to send the request to the model side
UPSTREAM_HTTP_ERROR502Model side returned 4xx/5xx
UPSTREAM_PROVIDER_ERROR502Model-side business error
UPSTREAM_INVALID_RESPONSE502Model-side response could not be parsed
INTERNAL500Internal error

Image Generation Only

CodeHTTPDescription
REQUEST_TOO_LARGE413Request body exceeds 64MB
CONCURRENCY_LIMIT_EXCEEDED429Image generation concurrency cap

Video & Tasks Only

CodeHTTPDescription
INVALID_CALLBACK_URL400Invalid callback URL
CONCURRENCY_LIMIT_EXCEEDED429Video generation concurrency cap

Task cancellation errors:

HTTPCodeDescription
404NOT_FOUNDTask not found
409INVALID_STATETask is not in the queued state
502UPSTREAM_CANCEL_FAILEDModel-side cancellation failed

Billing / Business API Errors (Management APIs)

Account, billing, and proprietary asset management APIs use an RFC 7807-style body:

{
  "status": 400,
  "detail": "Detailed error message",
  "type": "tag:hub,2026-03:ERROR_CODE"
}

Validation errors include an errors array:

{
  "status": 422,
  "detail": "validation failed",
  "type": "tag:hub,2026-03:VALIDATION_FAILED",
  "errors": [{"location": "body.email", "message": "required"}]
}

Error codes of the customer query APIs (balance/usage) are listed in Query Balance and Query Usage.

Retry Advice

HTTP statusAdvice
400Do not retry; fix the request parameters
401Do not retry; check your credentials
402Do not retry; top up first
403Do not retry; contact an administrator
429Retry after waiting; exponential backoff recommended
500Retrying is fine; wait 1–5 seconds between attempts
502Retrying is fine; the model side is temporarily unavailable

Request IDs

Every response carries an X-Request-Id header (format REQ-xxxx). Provide this ID when troubleshooting. You may also set your own X-Request-Id on requests; the system keeps it.