Skip to main content
1

Get your API Key

  1. Sign in to the Velobase Dashboard.
  2. Create a new organization and project if you haven’t already.
  3. Go to Project Settings → API Keys and generate a new key.
2

Add Credits to a User

Start by giving a user some credits. If the user does not exist yet, Velobase creates them automatically.
curl -X POST https://api.velobase.io/v1/customers/deposit \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "user_123",
    "amount": 100
  }'
3

Choose a Billing Flow

Once the user has credits, you can charge them 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.
curl -X POST https://api.velobase.io/v1/billing/deduct \
  -H "Authorization: Bearer your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "user_123",
    "transaction_id": "img_gen_001",
    "amount": 20
  }'
This deducts 20 credits immediately.
4

Check the Balance

curl https://api.velobase.io/v1/customers/user_123 \
  -H "Authorization: Bearer your_api_key_here"
Response:
{
  "id": "user_123",
  "balance": {
    "total": 100,
    "used": 12,
    "frozen": 0,
    "available": 88
  }
}

Next Steps

Depositing Credits

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.