> ## 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

> Create a Token Factory API key and send your first chat-completions request.

This quickstart calls the Corvex Token Factory OpenAI-compatible Chat
Completions API with `curl`. The same API key works with the SDK and
developer-tool integrations documented on this site.

**1. Create an API key**

Sign in to the [Token Factory dashboard](https://tokenfactory.corvex.cloud/app/settings/keys),
select **Create API key**, and copy the value when it appears. New keys start
with `sk-corvex-` and are shown only once.

**2. Store the key in your shell**

```bash theme={null}
export CORVEX_API_KEY="sk-corvex-YOUR_VIRTUAL_KEY"
```

Keep the key server-side. Do not commit it, paste it into a screenshot, or
include it in browser code.

**3. Send a chat completion**

```bash theme={null}
curl https://api.tokenfactory.corvex.cloud/v1/chat/completions \
  -H "Authorization: Bearer ${CORVEX_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org/GLM-5.3",
    "messages": [
      {"role": "user", "content": "Explain token-based inference pricing in one sentence."}
    ]
  }'
```

**4. Check the response**

A successful request returns HTTP `200` and an OpenAI-compatible response:

```json theme={null}
{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "zai-org/GLM-5.3",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Token-based pricing charges separately for the tokens sent to and generated by a model."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 15,
    "total_tokens": 25
  }
}
```

## Choose a model

Model IDs use the model publisher's repository ID in `namespace/model` format.
List the live public catalog before hard-coding an ID:

```bash theme={null}
curl https://api.tokenfactory.corvex.cloud/v1/models
```

Legacy IDs with a `corvex/` prefix are not supported. See [Models and
pricing](https://docs.corvex.cloud/models/overview.md) for context windows, input types, and rates.

## Use an SDK or developer tool

> [card] [OpenAI SDK](https://docs.corvex.cloud/integrations/openai-drop-in.md)
>
> Configure the official OpenAI Python or TypeScript client.

> [card] [Claude Code](https://docs.corvex.cloud/integrations/claude-code.md)
>
> Connect through the Anthropic-compatible Messages API.

> [card] [OpenCode](https://docs.corvex.cloud/integrations/opencode.md)
>
> Add Token Factory as an OpenAI-compatible provider.

> [card] [API reference](https://docs.corvex.cloud/api-reference/openapi.md)
>
> Review request fields, response schemas, and supported endpoints.

## Troubleshoot the first request

An invalid or missing key returns HTTP `401`:

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

Check that `CORVEX_API_KEY` is set in the shell running `curl` and does not
contain spaces or a trailing newline. For other status codes, see the [error
reference](https://docs.corvex.cloud/reference/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.