Skip to content
Get API key
On this page

Authentication

Send your router.africa API key as a Bearer token. Key format, handling and the errors you can get.

Every request to https://api.router.africa/v1 needs an API key. Send it in the Authorization header as a Bearer token. This is the same form the OpenAI SDK uses, so the SDK only needs a new base URL and key.

curl https://api.router.africa/v1/models \
-H "Authorization: Bearer $ROUTER_AFRICA_API_KEY"

Key format

Rules

Authentication errors

Status reason Meaning
401 missing_api_key No Authorization header, or it isn’t a Bearer token. On POST /v1/messages, no x-api-key either.
401 invalid_api_key The key is unknown, malformed, revoked, expired or not yet active. You get the same answer for all of these.
403 account_suspended The account or workspace is suspended. Contact support.

Every 401 carries WWW-Authenticate: Bearer realm="router.africa". See Errors for the response body. On POST /v1/messages the body is in Anthropic’s format.

You can limit what a key can do. See Spend caps and key scoping.