Skip to content

Connect a coding CLI

Most coding tools let you override the API base URL and API key. Point them at merido and they "just work" — merido accepts the major wire formats and routes each request to a real provider.

The two things every tool needs:

Wire formats

merido speaks several formats on the same data plane, so a tool can talk in whatever dialect it already uses:

  • OpenAIPOST /v1/chat/completions (and /v1/responses, /v1/embeddings, /v1/images/generations, /v1/audio/*).
  • AnthropicPOST /v1/messages (and /v1/messages/count_tokens).
  • Gemini — Google's generate-content format is accepted and translated.

Every format is translated through one canonical representation, so you can, e.g., send Anthropic requests and have them served by an OpenAI-family model (or a virtual model).

Examples

Claude Code

Claude Code speaks the Anthropic format. Point its base URL at merido and use your merido key:

bash
export ANTHROPIC_BASE_URL="http://127.0.0.1:8788"
export ANTHROPIC_API_KEY="<your-merido-key>"

Requests land on /v1/messages and are routed by merido.

Codex / OpenAI-style tools

Set the OpenAI base URL and key:

bash
export OPENAI_BASE_URL="http://127.0.0.1:8788/v1"
export OPENAI_API_KEY="<your-merido-key>"

OpenClaw

OpenClaw is an autonomous agent rather than a coding CLI, so merido writes it a fuller config than the base-URL swap above. Connect it from the dashboard's CLI Tools page (or POST /api/cli-tools/openclaw) and merido patches ~/.openclaw/openclaw.json, preserving every unrelated key:

  • models.providers.meridoevery virtual model your key can call, each with its contextWindow, maxTokens, reasoning, accepted input modalities, and per-1M cost (input, output, cacheRead, cacheWrite). OpenClaw budgets and decides when to compact from these numbers; without them it falls back to its own generic defaults and treats every model as free.
  • agents.defaults.model.primary — the model you selected.
  • agents.defaults.utilityModel — the cheapest advertised model. OpenClaw uses the utility route for generated titles and progress narration. Left unset these run on the primary model, which is where most of a chatty agent's spend leaks: very short answers over a very large prompt.
  • agents.defaults.imageModel / pdfModel — a model that accepts image input, when one is available.

Anything merido does not know is left out rather than guessed, so OpenClaw falls back to its own default instead of to an invented number.

Cursor and other clients

Anywhere a tool exposes an "OpenAI-compatible base URL" / "custom endpoint" setting, use http://127.0.0.1:8788/v1 and your merido key. The model you select can be a provider/model string or a virtual-model name you've defined.

Tools that hardcode their host (MITM)

Some clients ignore base-URL settings and dial a provider host directly. For those, merido has an optional MITM interception mode: it runs a local TLS proxy that intercepts known coding-CLI hosts and rewrites their traffic to this gateway's /v1 API.

Enable it with MERIDO_MITM_ENABLED=true (it binds MERIDO_MITM_PORT, default 8443). Because it terminates TLS for intercepted hosts, the client must trust merido's generated root CA; MERIDO_MITM_INSTALL_CA=true installs it into the OS trust store, and MERIDO_MITM_MANAGE_HOSTS=true maps the intercepted hosts to merido in your hosts file. Reach for this only when overriding the base URL isn't possible.

Migrating from Helicone

If you already configured a tool for Helicone, merido accepts Helicone-* request headers on /v1/* and rewrites them to its native equivalents, so a Helicone-configured client works pointed at merido. You can also bulk-import provider connections from a Helicone export:

bash
merido import helicone --file ./helicone-export.json

© merido. All rights reserved.