DocsAPI reference
Errors
Errors use the OpenAI shape on every endpoint but /v1/messages, which uses Anthropic's, so the client you already have shows them properly.
Error body
HTTP/1.1 402 Payment Required
{
"error": {
"message": "You are out of credits. Buy more on your Velaron.AI dashboard.",
"type": "invalid_request_error",
"code": "insufficient_credits"
}
}type is server_error for 5xx answers and invalid_request_error otherwise. code is the field to switch on.
Codes#
| Status | Code | What happened |
|---|---|---|
401 | invalid_api_key | The key is missing, mistyped or revoked. |
402 | insufficient_credits | The balance is at zero, or cannot cover this call even with a shortened answer. The message says how many credits it needs. |
400 | invalid_body | The JSON is missing what the endpoint needs, such as model and messages, or a video option the model does not offer. |
400 | model_not_supported | The model exists but is the wrong kind for the endpoint, such as an embedding model sent to chat. |
404 | model_not_found | No model of that id is on this server. GET /v1/models lists them. |
400 | invalid_query | A from or to date on GET /v1/usage could not be parsed. |
429 | rate_limit_exceeded | More than 60 requests in a minute on one key. |
499 | cancelled | You cancelled an image or video request before it finished. Nothing was charged. |
502 | provider_unreachable | The AI provider, or its model list, could not be reached. You were not charged. |
502 | provider_error | The provider failed while making an image or video. You were not charged. |
503 | provider_not_configured | This server has no AI provider yet; only velaron/test answers. Images and video also need Vercel AI Gateway as the provider. |
When the provider itself fails#
If the provider answers a chat, responses, messages or embeddings call with an error of its own, Velaron.AI relays that status and body to you unchanged and charges nothing. So a provider's 400 for a malformed tool schema, or its 429, reaches you exactly as the provider wrote it, wrapped only in CORS headers.
Anthropic shape#
/v1/messages answers { "type": "error", "error": { "type", "message", "code" } } with the Anthropic type derived from the status; the table on the Messages page maps them.
