DrıftstackAPI errors

API error type

Anthropic key required, or refused

HTTP 502 https://errors.driftstack.dev/byok-anthropic-required

What it means

An AI agent-session turn could not run on a key. With no extension fields: there was no Anthropic key for it — none sent with the request, none stored on the account, and Driftstack’s included AI not available to it. With key_rejected: true: Anthropic refused the key it did have, on the turn’s first planning call. No step ran either way.

How to fix it

Without key_rejected: save a key in the dashboard’s Settings, send x-byok-anthropic-api-key with the request, or opt in to Driftstack’s included AI where your plan offers it — some plans run AI only on your own key and cannot opt in, and on those a key is the only route. With key_rejected: true: key_source says which key was refused (header, the one sent with the request, or stored, the one saved on the account) and key_rejected_reason says why — replace the key for invalid_or_unauthorized, settle billing with Anthropic for billing, or, for organization_disabled, resolve the disabled organization with Anthropic or use a key from another one. Sending the same request again without fixing the key fails the same way.

Where it appears

In the type field of the RFC 9457 application/problem+json error body, alongside title, status, detail, and an instance correlation id.

Related