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

# Connect Kilo Code to Token Factory

> Add Corvex Token Factory as a custom OpenAI Compatible provider in Kilo Code.

Corvex Token Factory connects to Kilo Code as a **custom provider** that uses the
OpenAI Compatible API. Kilo Code can fetch the model list from the public Token
Factory catalog, so you select models instead of typing their IDs.

## Prerequisites

* A Token Factory API key. See [Authentication](/getting-started/authentication).
* [Kilo Code](https://kilo.ai/docs/) installed in VS Code, JetBrains, or as the
  CLI.
* A model from the [Token Factory catalog](/models/overview).

<Steps>
  <Step title="Add a custom provider">
    Open the Kilo Code settings (gear icon), choose **Global Config**, select
    the **Providers** tab, scroll to the bottom, and choose **Custom provider**.
  </Step>

  <Step title="Enter the Token Factory details">
    | Field        | Value                                                               |
    | ------------ | ------------------------------------------------------------------- |
    | Provider ID  | `corvex` (lowercase letters, numbers, hyphens, or underscores only) |
    | Display name | `Corvex Token Factory`                                              |
    | Provider API | **OpenAI Compatible**                                               |
    | Base URL     | `https://api.tokenfactory.corvex.cloud/v1`                          |
    | API key      | your `sk-corvex-...` key                                            |

    After you enter the Base URL, Kilo Code fetches available models from
    `GET /v1/models`. Under **Models**, choose `zai-org/GLM-5.3`,
    `deepseek-ai/DeepSeek-V4-Flash-0731`, or both. Leave the **reasoning**
    toggle on and the **image** toggle off for each model, then select
    **Submit**. If a model does not appear, add its catalog ID manually.
  </Step>

  <Step title="Set the model limits">
    Kilo Code does not read context limits from the endpoint and assumes a
    256K window. Open the global config at `~/.config/kilo/kilo.jsonc`. The
    provider you saved in the previous step is already there under
    `provider.corvex`; add `limit` to each model you selected:

    ```jsonc theme={null}
    {
      "provider": {
        "corvex": {
          "models": {
            "zai-org/GLM-5.3": {
              "limit": { "context": 393216, "output": 32000 }
            },
            "deepseek-ai/DeepSeek-V4-Flash-0731": {
              "limit": { "context": 1048576, "output": 32000 }
            }
          }
        }
      }
    }
    ```

    Kilo Code reads this file when it starts, so reload the VS Code window
    (**Developer: Reload Window**) after saving. The output limit is a
    per-response budget and is sent as `max_tokens`; leave room in the
    context window for the request.

    Neither model accepts image input.
  </Step>

  <Step title="Select the model and verify the connection">
    New sessions start on **Auto Free**, Kilo Code's own model router, which
    does not use Token Factory. Select the model button next to the mode
    selector under the chat box, find the **Corvex Token Factory** group, and
    choose `zai-org/GLM-5.3`. The button then shows the model ID and the
    context bar shows the configured window (`393.2K`).

    Start a task that reads a file in your repository. A completed **Read**
    tool call confirms the provider configuration and key.
  </Step>
</Steps>

## Compatibility notes

* **Model IDs.** Use the exact `id` from `GET /v1/models`. IDs are
  case-sensitive and use `namespace/model` format. Do not add a `corvex/`
  prefix.
* **Context length.** If a long task exceeds the model's window, the gateway
  returns `context_length_exceeded`. Start a new task or shorten the context. See
  [Errors](/reference/errors#context_length_exceeded-400).
* **Reasoning.** Both models reason before answering. Reasoning tokens count
  toward the output budget.

## Related documentation

* [Connect Cline](/integrations/cline) — the same provider settings in a
  related extension.
* [Use the OpenAI SDK](/integrations/openai-drop-in) — the same endpoint from
  Python or TypeScript.
* [Errors](/reference/errors) — authentication, rate-limit, and validation
  responses.
