Authentication

Authenticate Bitdeer AI API requests with a bearer API key.

All API requests must include a bearer token in the Authorization header.

GET /v1/models HTTP/1.1
Host: api-inference.bitdeer.ai
Authorization: Bearer $BITDEER_API_KEY

Get your API key

  1. Log in to Bitdeer AI Console.
  2. Navigate to Models → API Keys (direct link).
  3. Click Generate API Key and copy it — the secret is only shown once.

Usage examples

curl https://api-inference.bitdeer.ai/v1/models \
  -H "Authorization: Bearer $BITDEER_API_KEY"

Anthropic-style x-api-key header

Anthropic SDKs and tools can send the key in the x-api-key header instead:

curl https://api-inference.bitdeer.ai/v1/messages \
  -H "x-api-key: $BITDEER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "Qwen/Qwen3.8-27B", "max_tokens": 256, "messages": [{"role": "user", "content": "Hello!"}]}'
  • x-api-key is accepted only for 20-character API keys (keys that do not start with ak-), and only when no Authorization header is sent.
  • Keys that start with ak- must use Authorization: Bearer.
  • Authorization: Bearer works for every key format and every endpoint.

Key handling best practices

  • Never commit keys or bundle them into client-side code.
  • Load from environment variables or a secrets manager.
  • Rotate by creating a new key, deploying it, then revoking the old key.

Unauthorized responses

Missing, malformed, unknown or expired API keys return 401 Unauthorized (code invalid_api_key) — see Errors for the response body shape. A Bearer token shaped like a JWT (starting with eyJ and containing two dots) is not an API key and is refused with 501.

Last updated on

On this page