Skip to main content
Corvex Token Factory connects to OpenCode through a custom OpenAI-compatible provider. Store the API key with /connect, add the provider configuration, then select a Token Factory model from /models.

Prerequisites

1

Store the API key

Start opencode and run /connect. Select Other, enter corvex as the provider ID, and paste your sk-corvex-... key. OpenCode stores the key in its credential store.To use an environment variable instead, skip /connect, add "apiKey": "{env:CORVEX_API_KEY}" to options in the next step, and export CORVEX_API_KEY before starting OpenCode.
2

Add the provider configuration

Add the following configuration to opencode.json in the project root, or to ~/.config/opencode/opencode.json for global use. The provider ID must match the corvex value used with /connect.
OpenCode does not read context limits from the endpoint, so the configuration declares each model’s current limit. To make GLM the default, add "model": "corvex/zai-org/GLM-5.3" at the top level.
3

Select and test a model

Start OpenCode in your repository and run /models. Select a model under Corvex Token Factory, then run a short task that exercises a tool call. A successful response confirms the provider configuration and stored key.

Output-token limit

OpenCode currently limits each step to 32,000 output tokens through its built-in OUTPUT_TOKEN_MAX. The larger limit.output values above record each model’s Token Factory limit but do not override the OpenCode limit. Reasoning tokens count toward the 32,000-token step budget. If a response or tool call is truncated, retry with a shorter prompt or divide the task into smaller steps.