Skip to main content
Velobase is an AI gateway first: point your existing OpenAI or Anthropic SDK at it, and every model call is billed to one of your end-customers’ wallets. It is also a billing ledger (freeze, consume, deduct) for work you price yourself. This quickstart covers the gateway path first, then the billing ledger primitives.
1

Get your API key

  1. Sign in to the Velobase Dashboard.
  2. Create a project if you haven’t already.
  3. Go to Keys and generate a new key.
You can create two kinds of keys:
  • vb_live_ is a project key. Use it server-side and tell Velobase who to bill with the X-Velobase-Customer: <user-id> header.
  • vb_customer_ is a customer-scoped key. It carries its own customer binding, so no header is needed.
2

Fund a customer wallet

Add funds to a customer’s wallet. If the customer does not exist yet, Velobase creates them automatically.Amounts use explicit unit fields: amount_usd, amount_cents, or amount_credits, where 1 USD = 100 cents = 1,000,000 credits. Prefer amount_usd.
3

Make a model call

Point your OpenAI or Anthropic SDK at https://api.velobase.io/v1 and pass X-Velobase-Customer to say which wallet to bill. Velobase is model-agnostic: live models include deepseek/deepseek-v4-pro (supports streaming) and the anthropic/claude-* family such as anthropic/claude-opus-4.8, anthropic/claude-sonnet-4.6, and anthropic/claude-haiku-4.5 (served on Bedrock, non-streaming). More are available via upstreams.
Velobase forwards the request upstream, settles the real token cost against the customer’s wallet, and returns per-call billing details in the response headers:
  • x-velobase-cost-cents and x-velobase-cost-credits: what this call cost.
  • x-velobase-balance-credits: the wallet balance after the call.
  • x-velobase-transaction-id: the ledger transaction for this call.
You can list available models with GET /v1/models and review aggregated spend with GET /v1/usage.
4

Bill work you price yourself (optional)

For work that is not a model call (for example image generation or a fixed-price feature), use the billing ledger primitives directly. Charge a customer in two ways:
  • Use direct deduction when the cost is known upfront.
  • Use staged deduction when the final cost is only known after execution.
Use this for fixed-price operations such as image generation or a known API call cost.
This deducts $0.20 immediately.
5

Check the wallet

Response:
Wallet amounts are reported in credits (1,000,000 credits = 1 USD).

SDKs

Prefer a typed client? Install the Velobase billing SDK and pin the version:

Next steps

Funding wallets

Wallet categories, validity periods, and balance breakdown.

Direct deduction

Charge immediately when cost is known.

Staged deduction

Freeze first, then settle the actual cost.

API reference

Complete endpoint reference.