Skip to main content
Corvex Token Factory connects to Kilo Code as a custom provider that uses the OpenAI Compatible API. The Kilo Code CLI and the VS Code and JetBrains extensions read the same global configuration file, so one provider entry serves all of them. Verified with Kilo Code 7.8.8, October 2026, using the Kilo Code CLI.

Prerequisites

Context window and compaction

Kilo Code does not read limits from the endpoint, so each model declares them under limit:
  • limit.context is the model’s context_window.
  • limit.output is the model’s max_output_tokens. Kilo Code sends max_tokens = the smaller of this and its built-in 32,000-token cap, reduced only when the context is nearly full.
  • limit.input sets where Kilo Code compacts: it summarizes the conversation once a request reaches limit.input minus 20,000 tokens (its default compaction.reserved while the output cap is at least 20,000). Without limit.input, Kilo Code compacts only at limit.context − max_tokens, with no headroom.
A single turn with large tool results can push the context past the compaction point before compaction runs, so leave about 15% headroom: the compaction window is (context_window − max_tokens) / 1.15, rounded down, and limit.input is that value plus 20,000: GET /v1/models reports each model’s current context_window and max_output_tokens.
1

Store the API key

Export the key in your shell profile. The configuration below reads it with {env:CORVEX_API_KEY}, which Kilo Code resolves only in the global configuration file.
2

Add the provider configuration

Add the provider to the global configuration file, ~/.config/kilo/kilo.jsonc:
kilo.jsonc
In the extensions you can also add the provider from the settings (gear icon) under Providers → Custom provider, with the Base URL https://api.tokenfactory.corvex.cloud/v1 and OpenAI Compatible as the API. Then add the limit entries above to the same file and reload the window (Developer: Reload Window in VS Code).
3

Select the model and verify the connection

New sessions in the extension can start on Kilo Code’s own model router, which does not use Token Factory. Select the model button under the chat box and choose a model in the Corvex Token Factory group. The context bar shows the configured window (393.2K for zai-org/GLM-5.3).From the CLI, run one prompt non-interactively:
kilo models corvex --verbose prints the limits Kilo Code loaded for each model.

Compatibility notes

  • Model IDs. Use the exact id from GET /v1/models. IDs are case-sensitive and use namespace/model format; add the corvex/ provider prefix only when you select a model on the command line.
  • Output budget. Reasoning tokens count toward the 32,000-token budget. The KILO_EXPERIMENTAL_OUTPUT_TOKEN_MAX environment variable changes the cap; recompute the compaction window if you change it.
  • Context length. If a long task still exceeds the model’s window, the gateway returns context_length_exceeded. Start a new task or shorten the context. See Errors.
  • Debug output. kilo debug config prints the resolved API key in plain text. Do not paste its output into issues or logs.
Last modified on October 23, 2026