Skip to main content
If you already use the official OpenAI client, switching to Corvex is a three-line constructor change: your API key, the base URL, and the closing of the constructor block. Everything else — request shape, response shape, streaming, tools, models — is identical.
The examples below are the canonical sources validated in CI on every docs PR. They are copy-paste runnable: set OPENAI_API_KEY to your virtual key (sk-corvex-...) and the script makes one real /v1/chat/completions call against https://inference.corvex.studio.

The 3-line swap

import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],
    base_url="https://inference.corvex.studio/v1",
)
print(client.chat.completions.create(
    model="Qwen/Qwen2.5-0.5B-Instruct",
    messages=[{"role": "user", "content": "Hello, Corvex."}],
).choices[0].message.content)
The highlighted lines are the only difference from a stock OpenAI client call. No new SDK, no custom auth header — Corvex uses Authorization: Bearer, just like OpenAI.

Run it

# Python
pip install openai
export OPENAI_API_KEY=sk-corvex-your-virtual-key
python python.py

# Node (requires Node 18+ for native fetch + top-level await)
npm install openai
export OPENAI_API_KEY=sk-corvex-your-virtual-key
node node.mjs
A successful run prints the model’s reply to stdout. Any non-200 response throws — the OpenAI SDKs raise APIError (Python) or OpenAI.APIError (Node) with the gateway’s structured error body.

Model naming

Corvex uses bare lab-canonical Hugging Face repo ids for every model (e.g. zai-org/GLM-5.1-FP8, deepseek-ai/DeepSeek-V4-Flash). There is no Corvex prefix; legacy corvex/<…> and corvex-pd/<…> ids return HTTP 404 since the Day-1 dogfooding cutover (ADR 024 / RD-651). PD vs regular topology is decided server-side from the catalog, not from the request. List the models your virtual key can access:
curl https://inference.corvex.studio/v1/models \
  -H "Authorization: Bearer sk-corvex-YOUR_VIRTUAL_KEY"

What’s next