Skip to main content
When an API request fails, Velobase returns a standard JSON error response alongside an appropriate HTTP status code. The same error shape applies to every surface: model gateway calls (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 structured error object containing three fields:

Error Codes Reference

Below is a list of common error.code values you may encounter, organized by category.
These errors occur when the Authorization header is missing, malformed, or the key has been deactivated. Both project keys (vb_live_) and customer-scoped keys (vb_customer_) authenticate here.
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.
Two distinct 402 cases on billable gateway calls:
These errors occur when request parameters are invalid or a referenced resource does not exist.
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.