Skip to main content
All requests to the Sunra API are authenticated with an API key. You can create and manage your keys in your dashboard.

Setting your API key

Set your API key as an environment variable:
The official client libraries read SUNRA_KEY from the environment automatically, so no further configuration is needed. Each client also accepts credentials explicitly if you prefer to pass the key in code.

Raw HTTP requests

If you call the API directly over HTTP, pass the key in the Authorization header. The two product APIs use different schemes:
APIBase URLHeader
Multimodal (predictions)api.sunra.aiAuthorization: Key $SUNRA_KEY
LLM (completions)api-llm.sunra.aiAuthorization: Bearer $SUNRA_KEY
The same API key works for both APIs.

Keeping your key secure

Your API key grants access to your account balance — treat it like a password. Never embed it in client-side code (browsers or mobile apps); route requests through your own backend instead. See Server-side integration for the recommended setup.