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/ai

Every 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

EndpointWire formatUse with
POST /chat/completionsOpenAI Chat Completionsopenai SDKs, LangChain, most tools
POST /responsesOpenAI Responsesnewer openai SDKs, Codex CLI
GET /modelsOpenAImodel discovery
POST /v1/messagesAnthropic Messagesanthropic SDKs, Claude Code
POST /v1/messages/count_tokensAnthropictoken counting
GET /quotaqBraidyour 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
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." }]
  }'
Python (OpenAI SDK)
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)
TypeScript (OpenAI SDK)
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);
Python (Anthropic SDK)
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"
claude

ANTHROPIC_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:

ModelServed byInput $/MOutput $/MNotes
gpt-5.6-solAzure OpenAI5.0030.00cutting-edge default
gpt-5.6-terraAzure OpenAI2.5015.00experimental
gpt-5.6-lunaAzure OpenAI1.006.00experimental
gpt-5.5Azure OpenAI5.0030.00strong default
gpt-5.4Azure OpenAI2.5015.00balanced
gpt-5.4-miniAzure OpenAI0.754.50fast
gpt-5.4-nanoAzure OpenAI0.201.25fastest, cheapest
gpt-5.3-codexAzure OpenAI1.7514.00code-tuned
claude-opus-5AWS Bedrock5.0025.00most capable
claude-opus-4-8AWS Bedrock5.0025.00capable
claude-sonnet-4-6AWS Bedrock3.0015.00balanced
claude-haiku-4-5AWS Bedrock1.005.00fastest

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.