CLI Agent Integrations

Point any LLM CLI agent at Cosen so every command is priced, traced, and scanned.

How it works

Cosen exposes both the OpenAI-compatible /v1/chat/completions and the Anthropic /v1/messages endpoints. CLI agents that talk to either of those formats can use Cosen as a local gateway.

OpenAI Codex CLI

bash
# Start Cosen first cosen serve --mock # In another terminal export OPENAI_BASE_URL=http://127.0.0.1:8080/v1 codex "refactor this function"

Anthropic Claude CLI

bash
# Start Cosen first cosen serve --mock # In another terminal export ANTHROPIC_BASE_URL=http://127.0.0.1:8080/v1 claude "explain this code"

Claude CLI sends Anthropic Messages API requests. Cosen translates them internally, runs security scanners, checks budgets, and converts the response back seamlessly.

Simon Willison's llm

bash
# Register Cosen as an OpenAI-compatible endpoint llm -o base_url http://127.0.0.1:8080/v1 -m gpt-4o-mini "what is the refund window?"

Use llm templates or aliases to make Cosen the default for daily use.

aider

bash
export OPENAI_API_BASE=http://127.0.0.1:8080/v1 aider --model gpt-4o-mini

What gets traced

View traces in the web app at http://127.0.0.1:8080 or run cosen report.

Cursor and other editors

For Cursor, use the MCP config to expose Cosen tools directly inside the editor. For other editors that support OpenAI-compatible endpoints, set their base URL to http://127.0.0.1:8080/v1.