Skip to main content
This walks the full loop: get a key, fund an end-customer, make a model call that bills that customer, and reconcile the spend. About 10 minutes.
1

Get a project key

Sign in to the Velobase Dashboard, open your project, and create an API key under Keys. It looks like vb_live_…. This is your backend key; never ship it to a browser or mobile client.
2

Fund an end-customer

A model call needs a funded customer wallet. Create/fund one with your app’s own user id:
The customer is created on first deposit. In production you call this from your backend after the user pays you, using the payment event id as the idempotency_key.
3

Make a billed model call

Point the OpenAI SDK at Velobase and tag the call with the customer to bill:
The call debits user_123’s wallet and returns the cost on the response headers. If you see 402 insufficient_funds, the customer wallet is empty; if you see 402 project_balance_insufficient, top up your project wallet.
4

Check the balance

The available figure dropped by the call’s cost. Or read it through a Python / JavaScript SDK.
5

Reconcile usage

Every call shows up in usage with its cost, tokens, and transaction id:
Match each row’s transaction_id to the x-velobase-transaction-id you got back from the call. That is the full loop: charge per customer, per call, fully reconcilable.

Where to go next

OpenAI-Compatible Gateway

Streaming, billing headers, two-wallet model, and the Copy-for-AI prompt.

Depositing Credits

Amount units, wallet categories, and idempotency.