Authentication & keys
API keys, per-key limits, and the free tier.
Every request to /v1/* (except the public GET /v1/models) authenticates
with a bearer key:
Authorization: Bearer sk-gpm-...
Keys are stored as SHA-256 hashes — the raw key is shown exactly once at creation and cannot be recovered. Treat it like a password; if it leaks, disable it and mint a new one.
Per-key controls
Each key can carry its own limits, enforced at admission time:
| Control | Behavior when exceeded |
|---|---|
| Spend cap (lifetime, day or month) | 403 key_limit_exceeded |
| Expiration date | 401 invalid_api_key |
| Requests per minute | 429 rate_limited with Retry-After |
| Concurrent streams | 429 too_many_concurrent |
| Model allowlist | 403 model_not_allowed |
Inspect the key you're holding:
curl -s https://api.gopuram.net/v1/key \
-H "Authorization: Bearer $GOPURAM_API_KEY"
{ "data": { "key_id": "…", "account_id": "…", "free_tier": false, "spend_usd": 0.42 } }
Credits
Balances are prepaid. Check yours at any time:
curl -s https://api.gopuram.net/v1/credits \
-H "Authorization: Bearer $GOPURAM_API_KEY"
{ "data": { "balance_usd": 24.99, "free_tier": false } }
When the balance reaches zero, new requests return 402 insufficient_credits.
A stream that is already running is never cut off mid-response for billing —
we absorb the small overrun rather than truncating your output.
The free tier
Accounts that have never topped up are on the free tier: they can use any
model marked free_tier: true in the catalog (at conservative rate limits),
which is enough to evaluate the full API surface — streaming, tools,
reasoning and cost accounting all behave identically to paid traffic.
Requesting a non-free model returns a 403 that names the models you can
use. The first top-up permanently unlocks the whole catalog.