InferexAI uses JWT-based API keys. Every request must include a valid key in the Authorization header.
Pass your API key as a Bearer token in every request:
Authorization: Bearer sk-live-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxSet api_key to your InferexAI key. The SDK sends it as a Bearer token automatically.
from openai import OpenAI
client = OpenAI(
api_key="sk-live-your-key-here", # your InferexAI key
base_url="https://inferexapi.cloudvoice.in/v1",
)Keys are normally created through the dashboard UI. If you need to create them programmatically (e.g. for CI/CD), use the portal API:
# Keys are created via the dashboard UI or the portal API
curl https://inferexapi.cloudvoice.in/portal/keys \
-X POST \
-H "Authorization: Bearer <your-session-token>" \
-H "Content-Type: application/json" \
-d '{"name": "my-app-key"}'{
"id": 42,
"name": "my-app-key",
"token": "sk-live-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"prefix": "sk-live-a1b2c3d4",
"created_at": "2026-05-20T10:00:00Z"
}# .env
INFEREXAI_API_KEY=sk-live-your-key-here
INFEREXAI_BASE_URL=https://inferexapi.cloudvoice.in/v1