https://api.velobase.io/v1 and bill every model call to an end-customer’s wallet by sending the X-Velobase-Customer: <user-id> header. It is also a billing ledger (freeze, consume, deduct) for work you price yourself.
This page covers the REST surface for managing customers and their wallets, plus the billing primitives. It accepts JSON-encoded request bodies and returns JSON-encoded responses. For the model gateway itself (POST /v1/chat/completions, POST /v1/messages, GET /v1/models, GET /v1/usage), see the gateway reference.
Base URL: https://api.velobase.io
Customer wallet deposit uses
amount as integer credits. Other billing
primitives that price work yourself may expose explicit fiat/credit unit
fields such as amount_usd, amount_cents, or amount_credits. 1 USD =
100 cents = 1,000,000 credits.Model gateway
The gateway is OpenAI- and Anthropic-compatible. Set your SDK’s base URL tohttps://api.velobase.io/v1, authenticate with a project key, and name the end-customer to bill with the X-Velobase-Customer header. The call is relayed upstream and the real token cost is settled against that customer’s wallet.
| Endpoint | Description |
|---|---|
POST /v1/chat/completions | OpenAI-compatible chat completions. Supports streaming. |
POST /v1/messages | Anthropic-compatible messages. |
GET /v1/models | List available models. Authenticated, not billed. |
GET /v1/usage | Per-call usage and cost records. |
Health check is unauthenticated at
GET /health (no /v1 prefix). For a quick authenticated check, call GET /v1/models.Authentication and routing
Two key types decide which customer is billed:vb_live_is a project key for server-side use. Pair it withX-Velobase-Customer: <user-id>to name the customer to bill.vb_customer_is a customer-scoped key that already carries its own customer binding, so no header is needed. It supports anallowedModelswhitelist andexpiresAt.
GET /v1/models do not.
Per-call billing headers
Each billed response includes settlement details:x-velobase-cost-centsx-velobase-cost-creditsx-velobase-balance-creditsx-velobase-transaction-id
Models
Velobase is model-agnostic. Live models include:deepseek/deepseek-v4-pro(supports streaming)anthropic/claude-opus-4.5,anthropic/claude-opus-4.6,anthropic/claude-opus-4.7,anthropic/claude-opus-4.8,anthropic/claude-sonnet-4.6,anthropic/claude-haiku-4.5(served via Bedrock, non-streaming)
GET /v1/models for the current list.
Example request
SDKs
The Velobase billing SDKs wrap the customer and wallet endpoints below. The gateway itself works with any OpenAI or Anthropic SDK.Customers
Get a customer
Retrieve a customer’s profile and their wallets. Each wallet reportstotal, used, frozen, and available, plus a per-source breakdown.
GET /v1/customers/:customer_id
Path parameters
The unique identifier for this customer in your system.
Response fields
The customer identifier.
The customer’s display name.
The customer’s email address.
Arbitrary key-value metadata you attached to this customer.
A map of wallet name to wallet balance. Each wallet reports its aggregate totals and a per-source breakdown.
ISO 8601 datetime when this customer record was created.
Example request
Example response
Wallet balances are reported in credits. The example above shows 1,500,000,000 credits, which is $1,500.00 (1 USD = 1,000,000 credits). There is a separate
GET /v1/customers/:customer_id/balance endpoint that returns an object-shaped summary if you need it.Customer wallets
These endpoints fund and settle a customer’s wallet directly. Use them for work you price yourself, such as a fixed credit grant or a one-shot charge. Model calls made through the gateway settle automatically against the wallet, so you do not need these for per-token billing.Deposit to a wallet
Add integer credits to a customer’s wallet. If the customer does not exist yet, Velobase automatically creates them using thename and email fields you provide.
POST /v1/customers/deposit
Request parameters
The unique identifier for this customer in your system.
Positive integer credits to deposit.
Unique identifier for this deposit to prevent double processing.
The wallet category. Defaults to
"default".ISO 8601 datetime. Credits are ignored before this date.
ISO 8601 datetime. Credits are ignored after this date.
Customer’s display name. Used only when creating a new customer.
Customer’s email address. Used only when creating a new customer.
Optional note for the ledger.
Response fields
The customer identifier.
The wallet (account) that received the credits.
The wallet category.
Total credits in this wallet after the deposit.
Credits added in this operation. 1 USD = 1,000,000 credits.
ISO 8601 credit activation date, if set.
ISO 8601 credit expiry date, if set.
The unique ledger record ID.
true if this was a duplicate request that returned the original result.Example request
Example response
Billing primitives
The freeze, consume, deduct, and unfreeze primitives let you reserve and settle a customer’s wallet for work you price yourself, keyed by your owntransaction_id. Model calls made through the gateway settle automatically and do not need these.
Direct deduct
Atomically deduct from a customer’s available balance in a single step. Use this for immediate, one-shot charges where you do not need to reserve funds first.POST /v1/billing/deduct
Request parameters
The unique identifier for this customer in your system.
Amount to deduct, in US dollars. You may instead send
amount_cents or amount_credits (1 USD = 100 cents = 1,000,000 credits). A bare amount is legacy and is interpreted as cents.Unique identifier for this task or job.
Whitelist of wallet categories to deduct from.
Optional note for the ledger.
Response fields
Echo of the request identifier.
Total credits deducted.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the deduction.
true if this was a duplicate request.Example request
Example response
Freeze credits
Reserve a specific amount for an ongoing task. Frozen credits are held exclusively for that task and cannot be spent by any other operation until they are consumed or unfrozen.POST /v1/billing/freeze
Request parameters
The unique identifier for this customer in your system.
Amount to freeze, in US dollars. You may instead send
amount_cents or amount_credits (1 USD = 100 cents = 1,000,000 credits). A bare amount is legacy and is interpreted as cents.Unique identifier for this task or job.
Whitelist of wallet categories to freeze from.
Optional note for the ledger.
Response fields
Echo of the request identifier.
Total credits frozen.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.true if this was a duplicate request.Example request
Example response
Consume frozen credits
Permanently deduct from a previously frozen transaction. You supply the actual amount used, which may be less than what was originally frozen, and Velobase returns any remainder to the customer’s available balance.POST /v1/billing/consume
Request parameters
The
transaction_id used in the original freeze call.Amount to actually deduct, in US dollars. You may instead send
actual_amount_cents or actual_amount_credits (1 USD = 100 cents = 1,000,000 credits). A bare actual_amount is legacy and is interpreted as cents. Must be less than or equal to the originally frozen amount.Response fields
Echo of the request identifier.
Credits permanently deducted from the frozen amount.
Unused credits returned to the available balance (
frozen - consumed).Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the consumption.
true if this was a duplicate request.Example request
Example response
Unfreeze credits
Release all unused frozen credits back to the customer’s available balance. Use this when a task is canceled or fails and you want to return the reserved credits without consuming any.POST /v1/billing/unfreeze
Request parameters
The
transaction_id used in the original freeze call.Response fields
Echo of the request identifier.
Total credits released back to the available balance.
Breakdown by wallet. Each item contains
account_id, credit_type, and amount.ISO 8601 timestamp of the unfreeze.
true if this was a duplicate request.