Skip to content
docs

Authentication

Every API request needs an API key of the form sk_live_.... Create one in the console: chat.waibee.com/api-keys. Send it as a Bearer token in the Authorization header.

Authorization: Bearer sk_live_...

The POST /v1/messages endpoint accepts both x-api-key (the header clients built on the Anthropic SDK send) and Authorization: Bearer. If both arrive, x-api-key is used. All other endpoints accept only Authorization: Bearer.

x-api-key: sk_live_...
Terminal window
curl https://api.waibee.com/v1/models \
-H "Authorization: Bearer $WAIBEE_API_KEY"

On success you get 200 with the list of models. A wrong key returns 401 with the code invalid_api_key, and a missing header returns 401 with the code authentication_required:

401.json
{ "error": { "code": "invalid_api_key", "message": "Invalid API key", "extra": {} } }

On /v1/responses the codes are the same and the envelope is in Responses format; see Errors. On /v1/chat/completions and /v1/messages, a rejected key comes back in a short form, without a code:

{ "error": "unauthorized" }