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: Custom
2Base URL: https://app.cortyxia.com/v1/
3API Key: <ISO_TOKEN>
4Model Name: <MODEL_NAME>
5Streaming: Off
6Context 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

bash
#!/bin/bash
# Clear sticky internal validator session caches
rm -rf ~/.claude/

Local Bridge

bash
1#!/bin/bash
2# Bind to local port 3000
3export ANTHROPIC_BASE_URL="https://app.cortyxia.com"
4export ANTHROPIC_AUTH_TOKEN="<ISO_TOKEN>"
5
6# Force routing slots to the model you want
7export ANTHROPIC_DEFAULT_OPUS_MODEL="<MODEL_NAME>"
8export ANTHROPIC_DEFAULT_SONNET_MODEL="<MODEL_NAME>"
9export ANTHROPIC_DEFAULT_HAIKU_MODEL="<MODEL_NAME>"
10
11# Suppress undocumented client-side tracking probes
12export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
13export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=true
14
15claude
16
17# Or invoke without a global install
18npx claude --model <MODEL_NAME>

Cloud Bridge

bash
1#!/bin/bash
2rm -rf ~/.claude/
3
4export ANTHROPIC_BASE_URL="https://app.cortyxia.com"
5export ANTHROPIC_AUTH_TOKEN="<ISO_TOKEN>"
6export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=true
7
8export ANTHROPIC_DEFAULT_OPUS_MODEL="<MODEL_NAME>"
9export ANTHROPIC_DEFAULT_SONNET_MODEL="<MODEL_NAME>"
10export ANTHROPIC_DEFAULT_HAIKU_MODEL="<MODEL_NAME>"
11
12npx 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

bash
1# Set up the local provider in your config file
2mkdir -p ~/.codex
3cat << 'EOF' > ~/.codex/config.toml
4oss_provider = "local_bridge"
5
6[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 = false
12EOF

Launch Codex

bash
# Export your credentials and launch
export OPENAI_API_KEY="<ISO_TOKEN>"
codex --oss --config model='"<MODEL_NAME>"'

Cloud Bridge

bash
1mkdir -p ~/.codex
2cat << 'EOF' > ~/.codex/config.toml
3oss_provider = "local_bridge"
4
5[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 = false
11EOF
12
13export 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.

SettingValueNotes
Base URLhttps://app.cortyxia.comUse 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.
StreamingOffDisable if you see partial response or timeout errors.
Context Window≥ 30,000 tokensLower 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.