Connect your AI tools
Each tool needs one setting that points it at Flowstate Router. You keep signing in to the tool with your own AI account. You don’t need a Flowstate key.
Two addresses are used:
https://router.flowstate.host/apifor tools that speak Anthropic’s API.https://router.flowstate.host/api/v1for tools that speak the OpenAI-compatible API.
Before you start
- Your admin has turned on routing for your workspace. See Turn on routing for your workspace.
- Flowstate has linked your AI account or key to your workspace. Your admin sets this up in Flowstate Helm. If your requests are refused with a
403, ask your admin. See How people are recognised.
Claude Code
Set the base URL in your shell, then start Claude Code as usual.
export ANTHROPIC_BASE_URL=https://router.flowstate.host/api
Keep your Claude login. Don’t set an API key or token for Flowstate. To make the change permanent, add the line to your shell profile.
Claude Desktop
- Open Developer → Configure Third-Party Inference.
- Set the gateway to
https://router.flowstate.host/api. - Set the authentication to
bearer.
If your computer runs Flowstate Desktop, you don’t need this setting. Flowstate Desktop covers Claude Desktop when you sign in to it with your claude.ai account as normal.
Codex CLI and Codex Desktop
Add a provider to ~/.codex/config.toml:
model_provider = "flowstate"
[model_providers.flowstate]
name = "Flowstate"
base_url = "https://router.flowstate.host/api/v1"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false
requires_openai_auth keeps your ChatGPT sign-in or OpenAI API key in use.
supports_websockets = false is required. Codex uses a WebSocket connection by default, and Flowstate Router doesn’t accept WebSocket connections. If you need Codex’s WebSocket mode, use Flowstate Desktop instead.
Cursor
- Open Cursor’s model settings.
- Turn on Override OpenAI Base URL.
- Enter
https://router.flowstate.host/api/v1.
OpenCode, Hermes and Junie
Add an OpenAI-compatible provider and set its base URL to:
https://router.flowstate.host/api/v1
Use the sign-in or key you already use for that provider.
OpenRouter keys
OpenRouter keys start sk-or-. Keep using your key and point any OpenAI-compatible tool at:
https://router.flowstate.host/api/v1
Use OpenRouter’s model names, in the form vendor/model.
For Claude Code, set the base URL and pass your OpenRouter key as the token:
export ANTHROPIC_BASE_URL=https://router.flowstate.host/api
export ANTHROPIC_AUTH_TOKEN=sk-or-...
Replace sk-or-... with your key. Flowstate records the cost that OpenRouter reports for each request.
xAI keys
xAI keys start xai-. Keep using your key and point any OpenAI-compatible tool at:
https://router.flowstate.host/api/v1
Both chat completions and the Responses API work. Flowstate records the cost that xAI reports for each request.
Check it works
Send a short prompt from the tool. If it answers, the connection works. In Flowstate Helm, the session appears with its usage and cost once Flowstate has processed it. See Review AI sessions.
If something’s not right
- The tool says
403or “forbidden”. Flowstate hasn’t linked your AI account or key to a workspace. Ask your admin to check. See How people are recognised. - Codex fails to connect or reports a WebSocket error. Check
supports_websockets = falseis in your provider block. - The tool can’t connect. Check your network allows HTTPS to
router.flowstate.host. - The tool still goes to the AI service directly. Check you set the variable in the same terminal or restarted the app after changing a setting.
- You want to stop using Flowstate Router. Remove the setting and restart the tool.
Settings differ a little between tool versions. Check the tool’s own documentation if a menu has moved.