DOCS · SETTINGS

Providers & API keys

The Settings dialog uses a provider dropdown instead of displaying a wall of credential fields. Choose a provider, store or replace its key, and Cortex keeps the credential in its private data directory.

Execution support

Cortex can now run OpenCode with keys stored for OpenCode Zen, OpenRouter, OpenAI, Anthropic, Google AI and DeepSeek. Each provider also has an editable OpenCode model ID in Settings, so the model can be changed as provider catalogs evolve.

Cortex also exposes ChatGPT Plus / Pro and GitHub Copilot as subscription-backed options. These use OpenCode's own OAuth support rather than an API key. Authenticate once on the Cortex host with opencode auth login --provider openai or opencode auth login --provider github-copilot; Cortex detects that credential and copies it into the isolated session data when that provider is selected.

Subscription support depends on OpenCode.OpenCode documents ChatGPT Plus/Pro and GitHub Copilot as supported subscription providers. Copilot support in particular can vary with the installed OpenCode version and model, so treat it as an integration to dogfood rather than a Cortex guarantee.

Model IDs

Cortex passes models to OpenCode as provider/model. Settings shows a sensible starting model for each provider, but it is editable. To inspect the exact models supported by your installed OpenCode version, run opencode models PROVIDER.

Authenticated settings

Provider configuration is available only after signing in to Cortex. Stored API keys remain server-side and are never returned to the browser.

Credential boundary

Keys are stored in a mode-0600 JSON file and are never returned by the settings API. Each Cortex session receives isolated OpenCode data on the server, while individual runs use temporary OpenCode configuration and receive the selected credential through the child process environment.

Storage and failure recovery

Cortex stores provider keys in settings.json with owner-only permissions and atomic replacement. Invalid or oversized configuration stops startup without overwriting the original file. Public settings return only whether a provider is configured.

Process exposure

The selected key is passed only to the isolated OpenCode process environment and is redacted from surfaced subprocess errors together with every other configured key and the Google OAuth secret. Host administrators and processes running as the Cortex account remain inside the credential trust boundary.