Skip to content
Opod

Core CLI

opod connect, disconnect

Print copy-paste settings that point a coding tool or SDK at your opod leader, and the steps to point it back. Neither command changes any file.

In short

opod connect CLIENT prints the settings that point a tool (Cursor, Aider, the OpenAI SDK, curl and 11 more) at your leader, with your URL, model and key filled in. opod disconnect CLIENT prints how to undo them. Both only print text: they change no file.

opod connect aider --model qwen-coder-14b
# Aider → Opod (OpenAI API)
 
aider \
  --openai-api-base http://localhost:8080/v1 \
  --openai-api-key sk-orc-<your-key> \
  --model openai/qwen-coder-14b
…

Usage

opod connect CLIENT [--model ID] [--base-url URL] [--token KEY] [--retries N]
opod connect --list
opod disconnect CLIENT
opod disconnect --list

Both commands only print text to stdout. They change no shell profile, editor setting or config file, and they call no leader. You copy what they print into the tool.

opod connect

FlagDefaultEffect
--listoffList the supported clients and exit.
--model IDautoThe model id written into the snippet. auto resolves, on the leader, to its default model (router.default_model).
--base-url URLsee belowThe opod base URL written into the snippet, without /v1. A trailing / is removed.
--token KEYsee belowThe API key written into the snippet.
--retries N0 (off)Ask the gateway to retry each candidate up to N times (1 to 5). Only the curl snippet carries it, as -H "X-Opod-Num-Retries: N"; the other clients have no per-request header setting, so the value is ignored for them.

Flags may come before or after the client name. connect takes exactly one client name. From core v0.4.6, a value flag with no value (opod connect curl --retries) is a usage error, --retries needs a value, where it used to take the client name as its value; and when the key is this leader's admin key (no --token, no OPOD_TOKEN), stderr says so — give curl its own key instead: opod token create curl, then --token <that key> — because the snippet goes into another tool's config file.

The base URL is the first of:

  1. --base-url;
  2. $OPOD_BASE_URL;
  3. external_url in config.yaml;
  4. http://localhost followed by listen (http://localhost:8080 by default).

The key is the first of:

  1. --token;
  2. $OPOD_TOKEN;
  3. the admin key in ~/.opod/admin.key, written by the first opod up.

Do not hand out the admin key

With no --token and no $OPOD_TOKEN, the snippet carries the admin key, which can call /admin/v1/*. Give each person their own user key instead:

opod token create alice
opod connect cursor --token sk-orc-<alice-key> --model qwen-coder-14b

Pick a client interactively

With no client name, or a name that is not in the list, on an interactive terminal, connect opens a picker (arrow keys, Enter to choose, the typed name as the starting filter). With no terminal (a pipe, CI), it prints the help to stderr and exits 2.

Example

opod connect aider --model qwen-coder-14b
# Aider → Opod (OpenAI API)
 
aider \
  --openai-api-base http://localhost:8080/v1 \
  --openai-api-key sk-orc-<your-key> \
  --model openai/qwen-coder-14b
 
# Or set permanently in ~/.aider.conf.yml:
#   openai-api-base: http://localhost:8080/v1
#   openai-api-key: sk-orc-<your-key>
#   model: openai/qwen-coder-14b
opod connect continue --base-url http://leader.example.com:8080 --model llama-3.2-3b
# Continue.dev → Opod (OpenAI API)
# Add to ~/.continue/config.json under "models":
 
{
  "title": "Opod · llama-3.2-3b",
  "provider": "openai",
  "model": "llama-3.2-3b",
  "apiBase": "http://leader.example.com:8080/v1",
  "apiKey": "sk-orc-<your-key>"
}

The curl snippet prints two smoke tests: the OpenAI shape (POST /v1/chat/completions with Authorization: Bearer) and the Anthropic shape (POST /v1/messages with x-api-key and anthropic-version: 2023-06-01).

opod connect curl --retries 3 > smoke.sh && sh smoke.sh

Errors

ErrorCause
opod: no token available — set $OPOD_TOKEN, pass --token <key>, or run `opod up` to create oneNo --token, no $OPOD_TOKEN and no ~/.opod/admin.key.
opod: --retries must be between 1 and 5 (got 9)--retries out of range.
opod: connect takes exactly one client name (got: a b)Two names.

Clients

opod connect --list prints the same list with a one-line description of each.

IdClientWire
cursorCursorOpenAI
aiderAiderOpenAI
continueContinue (VS Code, JetBrains)both
zedZedOpenAI
clineCline / Roo Codeboth
openclawOpenClawOpenAI
opencodeOpenCodeboth
open-webuiOpen WebUIOpenAI
open-notebookOpen NotebookOpenAI
goosegooseOpenAI
plandexPlandexOpenAI
openhandsOpenHandsboth
codex-cliCodex CLIOpenAI
openai-sdkOpenAI Python / JS SDKOpenAI
curlcurlraw HTTP

"Both" means the client can use the OpenAI shape or the Anthropic Messages shape. Opod serves /v1/messages on every chat model, so a tool that speaks Anthropic Messages points at the same base URL.

Any other OpenAI-compatible tool works without a snippet: give it the base URL with /v1 and a key.

export OPENAI_BASE_URL=http://leader.example.com:8080/v1
export OPENAI_API_KEY=sk-orc-<your-key>

opod disconnect

opod disconnect aider        # the unset commands for the variables connect set
opod disconnect cursor       # the settings steps to clear the override
opod disconnect openai-sdk   # remove base_url from code or env
opod disconnect --list
# Aider takes its base URL from CLI flags or env vars.
# Reverse the Opod override:
unset OPENAI_API_BASE
unset OPENAI_API_KEY
 
# Then run aider with your own vendor key:
export OPENAI_API_KEY=sk-...           # for OpenAI
…

disconnect takes no flags other than --list, and exactly one client name. With no name it prints the help and exits 2. An unknown name prints opod: disconnect: unknown client "x" (try `opod disconnect --list`). It never opens a picker.

Afterwards the client talks to its vendor again with whatever key you give it. Nothing on the opod side changes: your keys and usage history stay on the leader, and opod connect points the client back at any time.

Last updated · Source: content/docs/core-cli/connect.mdx · View as Markdown