Skip to main content
If you already use the official OpenAI client, switching to Corvex is a two-line change: set your Corvex virtual key as the API key and point the base URL at Corvex. Everything else — request shape, response shape, streaming, tools, models — stays the same.
The examples below 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://api.tokenfactory.corvex.cloud.

The 2-line swap

import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],
    base_url="https://api.tokenfactory.corvex.cloud/v1",
)
print(client.chat.completions.create(
    model="zai-org/GLM-5.2-FP8",
    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.2-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://api.tokenfactory.corvex.cloud/v1/models \
  -H "Authorization: Bearer sk-corvex-YOUR_VIRTUAL_KEY"

What’s next