Docs menu
Getting started
API
Account
Authentication
Bearer API keys, created in your dashboard, billing prepaid credits.
Every API request is authenticated with a Bearer API key in the Authorization header. Keys are created in your dashboard.
curl https://api.dipoleml.com/v1/models \
-H "Authorization: Bearer $RAVEN_API_KEY"#Creating keys
- Sign in at your dashboard and open the API keys panel.
- Create a key with a label that says what it is for, for example staging-backend.
- The full key is shown once at creation. Copy it immediately; the dashboard stores only a hash and can never show it again.
- Revoke a key at any time. Revocation is immediate: the next request with that key returns 401.
#How keys bill
API keys bill prepaid credits. Each request is debited after it completes, based on the actual token usage reported by the model. Cached input tokens bill at the discounted cached rate automatically. If the balance would go below zero, the request is rejected up front with 402 and a clear error. See API Credits for prices and the debit formula.
This is separate from the raven app and DCode, which bill against your plan allowance when you are signed in. You never need an API key to use DCode or the raven app; keys are for your own code.
Provisioning keys for a team, a CI pipeline, or an agent? Management keys create and govern API keys over the API, with per-key spend limits and expirations. See Management Keys.
#Auth errors
A missing, malformed, or revoked key returns 401:
{
"error": {
"message": "Invalid API key provided.",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}All error responses share the same envelope. The full list of codes lives in Errors and Quotas.