Skip to main content
This is the no-SDK path. If you prefer Python or TypeScript, see the Quickstart instead.

Prerequisites

  • A workspace API key with the sk-corvex- prefix. If you don’t have one yet, see Authentication or ask your workspace admin.
  • curl 7.x or newer.

Set your API key

Export the key once so the rest of this page is copy-paste runnable:
export CORVEX_API_KEY="sk-corvex-..."
Never paste a key into a public Gist, a screenshot, or a client-side bundle. Treat it like a password — it carries spend and rate-limit authority for the whole workspace.

Send your first chat completion

curl https://api.corvex.ai/v1/chat/completions \
  -H "Authorization: Bearer $CORVEX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org/GLM-5.1-FP8",
    "messages": [
      {"role": "user", "content": "Hello"}
    ],
    "stream": false
  }'
The endpoint is OpenAI-compatible, so any client library that lets you set a base URL works the same way — https://api.corvex.ai/v1 is the only thing that changes.

What you’ll get back

A successful call returns HTTP 200 and a JSON body shaped like this:
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1763472000,
  "model": "zai-org/GLM-5.1-FP8",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 9,
    "total_tokens": 17
  }
}
For the full request and response schemas — including streaming, tool calls, and every optional parameter — see the API Reference.

When something goes wrong

If the Authorization header is missing, malformed, or the key is unknown to the workspace, the gateway returns HTTP 401 with this body:
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key"
  }
}
Most often this is one of:
  • CORVEX_API_KEY is unset in the shell that ran curl (check with echo "${CORVEX_API_KEY:0:12}…").
  • The key was copied with whitespace or a trailing newline.
  • The key belongs to a different workspace than the model you’re calling.
For the full error taxonomy (429 rate-limit, 403 model-blocked, etc.) see the Errors reference.

What’s next

Embeddings (/v1/embeddings) ship in Alpha alongside REQ-023; a curl example will land on this page once the endpoint is generally available.