Authentication
Copy Page as Markdown
Every API request requires an API key in the Authorization header using the
Bearer scheme.
Create an API key
Generate a key from console.subq.ai, store it outside your source tree, and send it with each request. Listing models is a quick way to check a key:
cURLTypeScriptPython
Use environment variables
Set the key in your local shell or deployment environment:
export SUBQ_API_KEY="sk-your-api-key"Then read SUBQ_API_KEY from your application configuration and pass it to your
HTTP client or OpenAI SDK.
Key security
- Store securely. Keys are shown once at creation and cannot be retrieved later.
- Rotate regularly. Create new keys and revoke old ones from the console.
- Never commit to source control. Use environment variables or a secrets manager.