Skip to main content
From Python you need two things, and neither requires a Velobase-specific package:
  • Model calls: point the official OpenAI SDK at the gateway. See OpenAI-Compatible Gateway.
  • Billing control-plane (deposits, balances, freeze / consume / deduct): call the REST endpoints directly with requests, httpx, or any HTTP client.
A velobase-billing package exists on PyPI, but it is outdated and does not track the current API. Prefer the REST calls below. If you are on Node, the JavaScript SDK (@velobaseai/billing@^1.2.0) is the maintained, typed client.

Model calls (OpenAI SDK)

Deposit credits to a customer

amount is a positive integer number of credits. 1 credit = 1 micro-USD, so 1 USD = 1,000,000 credits.

Read a balance

GET /v1/customers/{id} returns the customer with their wallets, each broken down by source:

Read the ledger

Paginate with the returned cursor; filter with operation_type or transaction_id.

Billing primitives

For metering work you price yourself (not model calls, which bill automatically), use freeze → consume for unknown-cost work, or deduct for fixed-cost work. All amounts are integer credits.

Errors

All failures return a structured error object with message, type, and a stable code. See Errors.