POST /v1/chat/completions, POST /v1/messages), customer and deposit endpoints, and the billing primitives you use for work you price yourself (POST /v1/billing/freeze, /v1/billing/consume, /v1/billing/deduct, /v1/billing/unfreeze).
Most failures on the model gateway come down to one of two things: the request did not resolve an end-customer to bill (no
X-Velobase-Customer header and a project key, or an expired customer-scoped key), or the customer’s wallet has no available funds. See the gateway section below.Error Format
All errors return a structurederror object containing three fields:
Error Codes Reference
Below is a list of commonerror.code values you may encounter, organized by category.
Model gateway: customer resolution and routing
Model gateway: customer resolution and routing
These errors occur on billable model calls (
POST /v1/chat/completions, POST /v1/messages) when Velobase cannot decide which customer to bill, or the request targets a model that is not available. Non-billable endpoints such as GET /v1/models do not require a resolvable customer.Payment required: 402
Payment required: 402
Two distinct
402 cases on billable gateway calls:Validation and routing: 400 Bad Request / 404 Not Found
Validation and routing: 400 Bad Request / 404 Not Found
These errors occur when request parameters are invalid or a referenced resource does not exist.
Wallet and deduction
Wallet and deduction
These errors occur when a billing operation cannot be completed because the customer’s wallet has no available funds, or the freeze/consume/deduct sequence is invalid. They apply both to per-call model billing and to the billing primitives you use for work you price yourself.All amounts are positive integer credits (1 USD = 1,000,000 credits). Unit-suffixed fields such as
amount_usd, amount_cents, or amount_credits are rejected.Concurrency and rate limiting: 409 Conflict / 429 Too Many Requests
Concurrency and rate limiting: 409 Conflict / 429 Too Many Requests
Server errors: 500 Internal Server Error
Server errors: 500 Internal Server Error