AI Gateway
Call GPT and Claude models through the qBraid API with one API key.
The AI Gateway is an LLM proxy inside the qBraid API. It speaks the OpenAI wire format and the Anthropic wire format. You keep your existing SDK and change two things: the base URL and the key.
https://api-v2.qbraid.com/api/v1/aiEvery request authenticates with your qBraid API key in the X-API-Key
header. Create a key at
account.qbraid.com/account/api-keys.
The API Keys guide explains how to manage and
rotate keys.
Endpoints
| Endpoint | Wire format | Use with |
|---|---|---|
POST /chat/completions | OpenAI Chat Completions | openai SDKs, LangChain, most tools |
POST /responses | OpenAI Responses | newer openai SDKs, Codex CLI |
GET /models | OpenAI | model discovery |
POST /v1/messages | Anthropic Messages | anthropic SDKs, Claude Code |
POST /v1/messages/count_tokens | Anthropic | token counting |
GET /quota | qBraid | your remaining LLM quota |
Why the double v1 on the Anthropic routes: Anthropic SDKs append
/v1/messages to whatever base URL you give them. The gateway matches that
shape, so the same base URL works for both wire formats.
Quickstart
The Anthropic SDK sends the x-api-key header on its own, so its api_key
argument takes your qBraid key directly. The OpenAI SDK only sends a bearer
header, so give it the key through default_headers instead.
curl https://api-v2.qbraid.com/api/v1/ai/chat/completions \
-H "X-API-Key: $QBRAID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [{ "role": "user", "content": "Explain the GHZ state in two sentences." }]
}'from openai import OpenAI
client = OpenAI(
base_url="https://api-v2.qbraid.com/api/v1/ai",
api_key="unused", # the gateway reads X-API-Key below
default_headers={"X-API-Key": QBRAID_API_KEY},
)
response = client.chat.completions.create(
model="gpt-5.5",
messages=[{"role": "user", "content": "Explain the GHZ state in two sentences."}],
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api-v2.qbraid.com/api/v1/ai",
apiKey: "unused", // the gateway reads X-API-Key below
defaultHeaders: { "X-API-Key": process.env.QBRAID_API_KEY },
});
const response = await client.chat.completions.create({
model: "gpt-5.5",
messages: [
{ role: "user", content: "Explain the GHZ state in two sentences." },
],
});
console.log(response.choices[0].message.content);from anthropic import Anthropic
client = Anthropic(
base_url="https://api-v2.qbraid.com/api/v1/ai",
api_key=QBRAID_API_KEY, # the SDK sends this as x-api-key
)
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain the GHZ state in two sentences."}],
)
print(response.content[0].text)Use with Claude Code
Claude Code talks the Anthropic wire format, so it can run on your qBraid quota. Set the base URL and your key, then start it:
export ANTHROPIC_BASE_URL="https://api-v2.qbraid.com/api/v1/ai"
export ANTHROPIC_API_KEY="$QBRAID_API_KEY"
claudeANTHROPIC_API_KEY reaches the gateway as the x-api-key header.
Available models
The /models endpoint is the source of truth. Model lineups change, so
query it rather than trusting a list you read somewhere:
curl https://api-v2.qbraid.com/api/v1/ai/models \
-H "X-API-Key: $QBRAID_API_KEY"The lineup and pay-as-you-go pricing as of August 2026, in USD per million tokens:
| Model | Served by | Input $/M | Output $/M | Notes |
|---|---|---|---|---|
gpt-5.6-sol | Azure OpenAI | 5.00 | 30.00 | cutting-edge default |
gpt-5.6-terra | Azure OpenAI | 2.50 | 15.00 | experimental |
gpt-5.6-luna | Azure OpenAI | 1.00 | 6.00 | experimental |
gpt-5.5 | Azure OpenAI | 5.00 | 30.00 | strong default |
gpt-5.4 | Azure OpenAI | 2.50 | 15.00 | balanced |
gpt-5.4-mini | Azure OpenAI | 0.75 | 4.50 | fast |
gpt-5.4-nano | Azure OpenAI | 0.20 | 1.25 | fastest, cheapest |
gpt-5.3-codex | Azure OpenAI | 1.75 | 14.00 | code-tuned |
claude-opus-5 | AWS Bedrock | 5.00 | 25.00 | most capable |
claude-opus-4-8 | AWS Bedrock | 5.00 | 25.00 | capable |
claude-sonnet-4-6 | AWS Bedrock | 3.00 | 15.00 | balanced |
claude-haiku-4-5 | AWS Bedrock | 1.00 | 5.00 | fastest |
Costs draw from your plan’s monthly AI quota first, then from credits at 100 credits = $1. Usage Quotas explains the switch-over.
Aliases such as openai/gpt-5.5 and qbraid/claude-opus-5 resolve to the
same models. Configs written for other gateways usually work unchanged.
Check your quota
curl https://api-v2.qbraid.com/api/v1/ai/quota \
-H "X-API-Key: $QBRAID_API_KEY"Returns your LLM subscription state and remaining quota. Streaming responses also carry standard rate-limit headers.
The gateway gives your code raw model access. If you want an AI client to act on the qBraid platform itself, with tools for devices, jobs, and credits, connect the MCP Server. The two work well together.
Thanks for your feedback.

