How to authenticate API requests
API Key
Every request must include your API key in the Authorization header using the Bearer scheme:
Authorization: Bearer YOUR_API_KEY
Example
curl https://api.nbility.dev/v1/chat/completions \
-H "Authorization: Bearer sk-xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hi"}]}'
Getting Your API Key
- Log in to the user dashboard
- Navigate to Console → Token
- Click Create new key and copy the generated key
Warning Keep your API key confidential. Do not commit it to version control or expose it in client-side code.
Format Variants
Some endpoints accept alternative authentication headers for third-party format compatibility:
| Format | Header |
|---|---|
| OpenAI (default) | Authorization: Bearer KEY |
| Anthropic | x-api-key: KEY + anthropic-version: 2023-06-01 |
| Gemini | x-goog-api-key: KEY or ?key=KEY query param |
The platform automatically detects the format based on the request headers.