Connect Clients

Stravia's Connect clients page (/connect) generates configuration patches for 12 built-in client integrations, code snippets for 4 open protocols (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and Google Gemini), and an MCP tab for the built-in /mcp endpoint.

Conceptual flow from AI clients through Stravia Gateway and Model Routes to upstream providers

Connect clients page showing the Code tab and cURL snippet

Prerequisites

  • At least one enabled route: Only enabled inference and image_generation routes appear for client selection (web_search-only routes are excluded).
  • An active API key: The key must be enabled, unexpired, and authorized for at least one eligible model.

Supported clients (12 built-in)

The Clients tab lists tools in this exact order:

ClientProtocolTarget global config file(s)Thinking export
Codex (codex-cli)Open Responses$CODEX_HOME/config.toml (~/.codex/config.toml)off → none; default off → null
ChatGPT (chatgpt)Open Responses$CODEX_HOME/config.toml + stravia-models.jsonSame catalog serialization as Codex
Claude Code (claude-code)Anthropic Messages$CLAUDE_CONFIG_DIR/settings.json (~/.claude/settings.json)Not exported
OpenCode (opencode)Open Responses~/.config/opencode/opencode.json (XDG)reasoning: true, variants, options.reasoningEffort
OpenClaw (openclaw)OpenAI Compatible$OPENCLAW_STATE_DIR/openclaw.jsonNot exported
Hermes Agent (hermes-agent)OpenAI Compatible$HERMES_HOME/config.yaml + .envNot exported
TRAE (trae)OpenAI Compatible~/.config/trae/trae_config.yaml (XDG)Provider block only (no model list)
WorkBuddy (workbuddy)OpenAI Compatible~/.workbuddy/models.jsonreasoning.supportedEfforts (non-off only)
ZCode (zcode)OpenAI Compatible~/.zcode/v2/config.jsonNot exported
DeepSeek Harness (deepseek-harness)Open Responses (openai-responses)$DSH_HOME/cordis.patch.yml + .credentials.yamlreasoningEfforts (off → "none"; omitted if non-reasoning or off-only)
Pi (pi)Open Responses~/.pi/agent/models.json (PI_CODING_AGENT_DIR)reasoning boolean only
OMP (omp)Open Responses~/.omp/agent/models.ymlthinking.mode: effort, efforts, defaultLevel
Desktop writes vs. Server previews
  • Stravia Desktop reads your existing global config, updates only the Stravia provider block (staging and backing up on failure), and exposes Write configuration (or Write both files for ChatGPT). It does not overwrite unrelated user settings or write project-local configs.
  • Stravia Server cannot access your local filesystem; it generates portable preview snippets for you to copy manually.

Codex vs. ChatGPT (shared CODEX_HOME)

Both Codex and ChatGPT update [model_providers.stravia] inside $CODEX_HOME/config.toml with wire_api = "responses", supports_websockets = true, and—when every eligible inference/image route supports it—[model_providers.stravia.capabilities] remote_compaction = "v2".

ModeCatalog sourceFiles writtenWhen to re-apply
CodexLive HTTP endpoint model_catalog_url = "<host>/codex/models"config.toml only (removes top-level model_catalog_json; preserves existing stravia-models.json)Only when switching back from static mode or changing key/host
ChatGPTStatic JSON file model_catalog_json → stravia-models.jsonconfig.toml + stravia-models.jsonWhenever authorized models or capabilities change

Neither mode overwrites your top-level model or web_search settings. If your API key is not authorized for Stravia web search and you want to disable Codex search, set web_search = "disabled" at the top level of config.toml before the first table header.

Steps

  1. Open Setup → Connect clients and stay on the Clients tab.
  2. Select your tool and API key. Stravia automatically scopes exported models to the key's allowlist (or all eligible models if the key has an empty allowlist).
    • For Claude Code, map all four role slots (ANTHROPIC_MODEL, Haiku, Sonnet, Opus) from your key's allowed models.
    • If your API key enables transparent_injection_enabled with media_understanding, clients that read capability flags (such as OpenCode, OMP, Pi, WorkBuddy, ZCode, Codex) also advertise image input support.
  3. Apply the configuration:
    • On Desktop, click Write configuration (or Write both files for ChatGPT) and restart the target client.
    • On Server, copy each generated snippet into the shown global config path (for ChatGPT, copy the TOML and JSON sections separately without the # path headers).
  4. Use the Code or MCP tab for SDKs and MCP clients:
    • Switch to Code, choose a protocol (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, or Google Gemini), pick a Model ID, and copy the Python, TypeScript, or cURL snippet.
    • Switch to MCP to view the built-in /mcp endpoint URL, verify whether the selected API key has MCP access enabled (with a direct Edit MCP access link when disabled), and copy ready-to-use mcpServers JSON or cURL snippets.
    • Active tab selection is preserved in the URL (?tab=code or ?tab=mcp; omitted for the default cli tab).
# Example OpenAI Responses call (streaming SSE)
curl http://127.0.0.1:23471/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-stravia-demo-not-a-real-key" \
  -d '{"model":"my-model","stream":true,"input":"Summarize today'\''s changes."}'
sh

Verify

Send one prompt from the connected client (or run the cURL snippet), then open Monitor → Request history and confirm a Completed interaction card appears under the selected API key and Model ID.

Troubleshooting

  • Client reports model not found (404) or empty model list: Confirm the route is enabled, its purpose is inference (or image_generation for image routes), and your API key allows that model. For ChatGPT, re-export stravia-models.json and restart the app.
  • Codex returns 403 during chat: Codex requested hosted web search while Stravia web search was disabled or unauthorized for that key. Either enable web search injection on the key or set web_search = "disabled" in config.toml.
  • Desktop write fails with parse error: Fix syntax errors in the existing target config file (config.toml, settings.json, opencode.json, etc.)—Stravia refuses to overwrite malformed files.

Next