Authorization header of your HTTP requests.
Overview
- Register an account.
- Login to obtain an access token.
- Include the token in your requests.
Registration
To start using the API, you need to create an account. You have two options:- Web: Sign up at https://api.sunbird.ai/register, then grab your access token / API key from the tokens page.
- API: Register programmatically via the
/auth/registerendpoint.
You will need a valid email address.
Getting an Access Token
After registering, exchange your credentials for an access token using the/auth/token endpoint. Note that this endpoint expects form-encoded data, not JSON.
Using the Token
Include the token in theAuthorization header of your requests:
Example Request
Token Lifetime
Access tokens do not expire. Your token effectively acts as your API key — use the same token to authenticate every request to the Sunbird AI API. Generate it once (from the tokens page or the/auth/token endpoint), store it securely, and reuse it.
If a request returns a 401 Unauthorized error, the token is missing or invalid — double-check that it is included correctly in the Authorization header.
Security Best Practices
- Environment Variables: Store your tokens in environment variables (e.g.,
SUNBIRD_API_TOKEN). - Backend Proxy: If you are building a frontend application, route requests through your own backend to keep your credentials hidden. Do not expose your token in client-side code.

