Qubax AI uses Bearer token authentication. Every API request must include your API key in the Authorization header.
Your API key starts with qbx_live_. You can create and manage keys in the API Keys dashboard.
All requests require an Authorization header:
Authorization: Bearer qbx_live_...With the OpenAI SDK (recommended):
from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key="qbx_live_..."
)With cURL:
curl https://api.qubax.ai/v1/models \
-H "Authorization: Bearer $QUBAX_API_KEY"# .env
export QUBAX_API_KEY="qbx_live_..."import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key=os.environ["QUBAX_API_KEY"]
)If authentication fails, you'll get a 401 response:
{
"error": {
"message": "Invalid API key provided.",
"type": "authentication_error",
"code": "invalid_api_key"
}
}