> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compressi.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Any OpenAI or Anthropic Agent to CMX Gateway

> Use CMX with any AI coding tool that accepts a custom API base URL and speaks the OpenAI or Anthropic API protocol. Includes base URL reference.

CMX works with any coding agent or tool that accepts a custom API base URL and speaks OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages. Codex and OpenCode are verified integrations with dedicated setup guides. Other tools are not individually verified, but many work with CMX without any changes beyond pointing them at the local gateway.

## Requirements

Your tool must support setting a custom base URL for API requests. This is often exposed as an environment variable, a config file field, or a settings entry labeled something like "API base URL" or "custom endpoint."

CMX listens at:

```
http://127.0.0.1:17322
```

Make sure CMX is running (`cmx start` or `cmx serve`) before sending requests through it.

## Connecting via Custom Base URL

Point your tool's API base URL at the appropriate CMX endpoint for the protocol it speaks:

* **OpenAI-compatible tools** — use the `/openai` path
* **Anthropic-compatible tools** — use the `/anthropic` path

```bash theme={null}
# OpenAI-compatible tools
OPENAI_BASE_URL=http://127.0.0.1:17322/openai

# Anthropic-compatible tools
ANTHROPIC_BASE_URL=http://127.0.0.1:17322/anthropic
```

Set these environment variables before launching your tool, or enter the URLs directly in your tool's settings. Your API keys are passed through to your provider unchanged — CMX never stores them.

Once your tool is pointed at CMX, all requests will flow through the local gateway. CMX applies compression when sessions grow large enough and policy checks pass, then forwards the request to your configured provider.

## Verify It's Working

After pointing your tool at CMX and sending a request, check that CMX registered the activity:

```bash theme={null}
cmx stats
```

New requests should appear in the output. If you see activity, CMX is receiving and forwarding your tool's requests correctly.

<Warning>
  Custom agent connections are not individually verified. Behavior depends on how closely your tool follows the OpenAI or Anthropic protocol. If requests seem unexpected or malformed, run `cmx doctor` to check your configuration, or [contact support](https://compressi.us/contact) with your CMX version, OS, tool name, and a description of what you observed.
</Warning>

## Suggest a New Integration

Want CMX to officially support your tool? Reach out at [hello@compressi.us](mailto:hello@compressi.us?subject=CMX%20provider%20suggestion) and include:

* **Tool name and a link** to its website or integration documentation
* **Your operating system** and how you connect to your model provider today
* **The workflow you want CMX to support** and what would make the integration useful

A short description is enough to get started. Leave out API keys and any private conversation or source-code content. We review available connection options and assess whether CMX can safely support the tool's behavior. A suggestion does not guarantee support or a delivery date, but it helps us understand demand.

You can also reach us through the [contact page](https://compressi.us/contact).


## Related topics

- [Connect OpenAI Codex to CMX for Context Compression](/providers/codex.md)
- [Connect OpenCode to CMX for Automatic Context Compression](/providers/opencode.md)
- [Configure the CMX Gateway, Agents, and Preferences](/configuration.md)
