CLI Guide
Connect Claude Code, Codex, Kilo Code, and other agentic CLI tools to the Cortyxia memory layer.
Agentic CLI Setup
Cortyxia exposes an OpenAI-compatible bridge that works with any CLI agent that supports a custom provider URL, an API key, and a model name. Whether you use Claude Code, OpenAI Codex, Kilo Code, or another tool, the setup is the same: point the client at the Cortyxia bridge, set the token, and provide the model string.
This guide uses placeholder tokens and model names. Replace <ISO_TOKEN> with your Cortyxia ISO key and <MODEL_NAME> with the model your project is configured to use.
Universal Setup Checklist
Before you configure any CLI tool, make sure these three values are set. The exact environment variable names differ between tools, but the values are the same.
Base URL
The Cortyxia cloud endpoint: https://app.cortyxia.com. Append /v1/ for OpenAI-style clients.
API Key
Your Cortyxia ISO token. Paste it into the API key field or set it as an environment variable.
Model Name
The exact model string your project is configured to route to. Tools do not auto-detect this.
Provider Notes
- Add the Base URL, API key, and model name in the tool's custom provider settings.
- Leave extra header fields blank unless your project requires them.
- Set the context window to at least 30,000 tokens for best results.
- Turn streaming off if the client has issues with streamed responses.
Kilo Code
Kilo Code supports custom providers directly in its settings. Add a new provider, paste the Cortyxia endpoint, and select the model name.
Settings
1Provider: Custom2Base URL: https://app.cortyxia.com/v1/3API Key: <ISO_TOKEN>4Model Name: <MODEL_NAME>5Streaming: Off6Context Window: 30000
Verification
Submit a test prompt. If the model responds, the provider is configured correctly. The session will be memory-backed automatically.
Claude Code
Claude Code can be pointed at a local or hosted bridge with environment variables. Clear the sticky internal cache first to avoid stale configuration.
Clear Cached Configuration
#!/bin/bash# Clear sticky internal validator session cachesrm -rf ~/.claude/
Local Bridge
1#!/bin/bash2# Bind to local port 30003export ANTHROPIC_BASE_URL="https://app.cortyxia.com"4export ANTHROPIC_AUTH_TOKEN="<ISO_TOKEN>"56# Force routing slots to the model you want7export ANTHROPIC_DEFAULT_OPUS_MODEL="<MODEL_NAME>"8export ANTHROPIC_DEFAULT_SONNET_MODEL="<MODEL_NAME>"9export ANTHROPIC_DEFAULT_HAIKU_MODEL="<MODEL_NAME>"1011# Suppress undocumented client-side tracking probes12export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=113export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=true1415claude1617# Or invoke without a global install18npx claude --model <MODEL_NAME>
Cloud Bridge
1#!/bin/bash2rm -rf ~/.claude/34export ANTHROPIC_BASE_URL="https://app.cortyxia.com"5export ANTHROPIC_AUTH_TOKEN="<ISO_TOKEN>"6export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=true78export ANTHROPIC_DEFAULT_OPUS_MODEL="<MODEL_NAME>"9export ANTHROPIC_DEFAULT_SONNET_MODEL="<MODEL_NAME>"10export ANTHROPIC_DEFAULT_HAIKU_MODEL="<MODEL_NAME>"1112npx claude --model <MODEL_NAME>
OpenAI Codex
Codex uses a TOML config file in ~/.codex to define a custom provider. Create the file once, then launch Codex with the OSS flag and the model override.
Create Provider Config
1# Set up the local provider in your config file2mkdir -p ~/.codex3cat << 'EOF' > ~/.codex/config.toml4oss_provider = "local_bridge"56[model_providers.local_bridge]7name = "Local API Bridge"8base_url = "https://app.cortyxia.com/v1/"9env_key = "OPENAI_API_KEY"10wire_api = "responses"11requires_openai_auth = false12EOF
Launch Codex
# Export your credentials and launchexport OPENAI_API_KEY="<ISO_TOKEN>"codex --oss --config model='"<MODEL_NAME>"'
Cloud Bridge
1mkdir -p ~/.codex2cat << 'EOF' > ~/.codex/config.toml3oss_provider = "local_bridge"45[model_providers.local_bridge]6name = "Local API Bridge"7base_url = "https://app.cortyxia.com/v1/"8env_key = "OPENAI_API_KEY"9wire_api = "responses"10requires_openai_auth = false11EOF1213export OPENAI_API_KEY="<ISO_TOKEN>"14codex --oss --config model='"<MODEL_NAME>"'
Other CLI Tools
Any CLI agent that accepts a custom OpenAI-compatible endpoint will follow the same pattern. Use the table below to map the common settings to the Cortyxia bridge.
| Setting | Value | Notes |
|---|---|---|
| Base URL | https://app.cortyxia.com | Use the Cortyxia root URL for Claude, /v1 for OpenAI-style clients. |
| API Key | <ISO_TOKEN> | Set as the provider key or the tool-specific env variable. |
| Model | <MODEL_NAME> | Must match the model configured in your Cortyxia key. |
| Streaming | Off | Disable if you see partial response or timeout errors. |
| Context Window | ≥ 30,000 tokens | Lower limits may truncate injected memory context. |
Resources
CLI instructions, SDK source, and latest model strings are maintained in the GitHub repository. The TypeScript SDK is published on npm and the Python SDK is published on PyPI.