Documentation Get help

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/api for tools that speak Anthropic’s API.
  • https://router.flowstate.host/api/v1 for tools that speak the OpenAI-compatible API.

Before you start

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

  1. Open Developer → Configure Third-Party Inference.
  2. Set the gateway to https://router.flowstate.host/api.
  3. 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

  1. Open Cursor’s model settings.
  2. Turn on Override OpenAI Base URL.
  3. 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 403 or “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 = false is 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.