Other harnesses
Any client that lets you set a custom baseURL works with cmx. The contract
is three things:
- baseURL →
http://127.0.0.1:17322 cmx-providerheader → the upstream provider name from cmx configcmx-harnessheader → a label for the UI (any string)
Auth stays where it belongs: your harness sends its own Authorization /
API key, cmx forwards it to the upstream untouched.
Endpoints
Section titled “Endpoints”| Client type | Path | Format |
|---|---|---|
| OpenAI-style | POST /v1/chat/completions |
chat.completion objects |
| Anthropic-style | POST /v1/messages |
message objects |
Streaming (SSE) and non-streaming are both supported for both dialects. Unknown paths are passed through to the upstream unchanged.
Session attribution
Section titled “Session attribution”cmx groups requests into sessions by looking for, in order:
cmx-session-idx-opencode-sessionx-session-idx-claude-session-id
If none is present, it falls back to a fingerprint of model + system prompt + first message — good enough for most CLI agents, but an explicit header is
more reliable.
What cmx does to traffic
Section titled “What cmx does to traffic”- Adds
<cmx-id-*>markers to older messages (harmless text to the model) - Adds the
compresstool if not already present - Strips
compresstool calls from responses before the harness sees them - Occasionally appends a small
<cmx-system-reminder>nudge to the last user message when context is large - Never modifies stored session history — rewrites happen only in the proxied request
