SourceB · Customer API

Pricing API

Give your product evidence-backed model costs. Integer token math, fail-closed stale prices, zero LLM on the hot path. Free keys available now — paid entitlement tiers are not activated yet.

1. Get an API key

Mint a free key for customer integrations. Store the secret once — we only keep a hash.

2. List models

curl -s https://sourceb.app/api/pricing/models \ -H "Authorization: Bearer sbpk_live_YOUR_KEY"

3. Calculate cost

curl -s https://sourceb.app/api/pricing/calculate \ -H "Authorization: Bearer sbpk_live_YOUR_KEY" \ -H "content-type: application/json" \ -d '{ "modelSlug": "gpt-4o-mini", "inputTokens": 1000000, "cachedInputTokens": 0, "outputTokens": 200000 }'

Endpoints

Auth: Authorization: Bearer … or X-SourceB-Api-Key. CORS is enabled for browser apps. Anonymous calls work for the public calculator; customer products should use a key.

UI calculator · OpenAPI JSON · Compare models