> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corvex.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Send your first inference request to Corvex.

This guide assumes you already have:

* A **virtual key** with the `sk-corvex-` prefix. If you don't, ask your team
  admin or see [Authentication](/getting-started/authentication).
* The Corvex API base URL — the examples below use
  `https://api.tokenfactory.corvex.cloud`.

<Tip>
  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.
</Tip>

## Send a chat completion

<Card title="Already on the OpenAI SDK? Swap 2 lines." icon="arrow-right-arrow-left" href="/integrations/openai-drop-in">
  The base-URL/API-key swap shown on the drop-in page is copy-paste runnable against the Corvex public endpoint.
</Card>

<CodeGroup>
  ```bash curl theme={null}
  curl https://api.tokenfactory.corvex.cloud/v1/chat/completions \
    -H "Authorization: Bearer sk-corvex-YOUR_VIRTUAL_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "zai-org/GLM-5.2-FP8",
      "messages": [
        {"role": "user", "content": "Hello, world."}
      ]
    }'
  ```

  ```python python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="sk-corvex-YOUR_VIRTUAL_KEY",
      base_url="https://api.tokenfactory.corvex.cloud/v1",
  )

  resp = client.chat.completions.create(
      model="zai-org/GLM-5.2-FP8",
      messages=[{"role": "user", "content": "Hello, world."}],
  )
  print(resp.choices[0].message.content)
  ```

  ```typescript node theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "sk-corvex-YOUR_VIRTUAL_KEY",
    baseURL: "https://api.tokenfactory.corvex.cloud/v1",
  });

  const resp = await client.chat.completions.create({
    model: "zai-org/GLM-5.2-FP8",
    messages: [{ role: "user", content: "Hello, world." }],
  });
  console.log(resp.choices[0].message.content);
  ```
</CodeGroup>

<Tip>
  If your client library defaults to OpenAI's hosted endpoint, set
  `base_url` (Python) / `baseURL` (TypeScript) — pointing it at your Corvex
  gateway is the only change needed.
</Tip>

## What you'll get back

A successful call returns HTTP 200 and a JSON body shaped like this:

```json theme={null}
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1763472000,
  "model": "zai-org/GLM-5.2-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
  }
}
```

## Model naming

Corvex models use **bare lab-canonical Hugging Face repo ids** —
`<hf-namespace>/<model-name>` (e.g. `zai-org/GLM-5.2-FP8`,
`moonshotai/Kimi-K2.7-Code`). There is no `corvex/` prefix; legacy
`corvex/<…>` ids return HTTP 404. Serving is handled server-side — you
only send the model id, and the platform routes it for you.

Get the current list of available models for your virtual key:

```bash theme={null}
curl https://api.tokenfactory.corvex.cloud/v1/models \
  -H "Authorization: Bearer sk-corvex-YOUR_VIRTUAL_KEY"
```

## When something goes wrong

If the `Authorization` header is missing, malformed, or the key is unknown to
the workspace, the gateway returns HTTP 401:

```json theme={null}
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key"
  }
}
```

Most often this is one of:

* The key is unset in the shell that ran `curl`.
* 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](/reference/errors).

## What's next

* **[Authentication →](/getting-started/authentication)** — how your
  virtual key works and where to create one.
* **[API Reference →](/api-reference/openapi)** — every endpoint,
  request/response schemas, and error codes.

<Note>
  The OpenAI SDK drop-in examples on the [drop-in page](/integrations/openai-drop-in)
  are copy-paste runnable. The broader samples on this page are illustrative.
</Note>
