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
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
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, moonshotai/Kimi-K2.7-Code). There is no Corvex
prefix — just send the bare model id. Serving topology is handled
server-side; you never encode it in the request. List the models your virtual
key can access:
What’s next
- Quickstart → — broader guide
including the curl reference and authentication notes.
- Authentication → — how your
virtual key works and where to create one.
- API Reference → — every endpoint,
request/response schemas, and error codes.