EchoBirdDocs
Documentation/Open API

Apps reading and calling EchoBird

OpenBridge: let other apps on your computer read EchoBird's account and model lists and call EchoBird to switch models or accounts.

OpenBridge is the local API EchoBird offers on your computer. Terminals, editor extensions, or your own scripts can use it to read a tool's accounts and models in EchoBird and ask EchoBird to switch to one of them, for example moving to another account when a quota runs out. EchoBird still does the switching, so the integrating app never reads or writes any tool's configuration files.

What it does and does not do

  • Does: check that EchoBird is running, list a tool's accounts and models (with plan and quota), switch to one of them, and ask EchoBird to open that tool's panel.
  • Does not: no endpoint ever returns passwords, API keys, tokens, or other credentials. It cannot add, delete, or edit accounts and models; those stay managed in EchoBird.
  • Supported tools today: claudecode (Claude Code) and codex (Codex). The tools list from /bridge/status is authoritative.

Find the API and authenticate

While EchoBird runs it writes a discovery file, and removes it on exit:

~/.echobird/config/open-bridge.json
(Windows: %USERPROFILE%\.echobird\config\open-bridge.json)

{
  "bridgeVersion": 1,
  "port": 53690,
  "token": "a random 64-character hex string",
  "pid": 12345,
  "echobirdVersion": "6.4.9"
}
  1. Read the discovery file. If it is missing, EchoBird is not running; if the process in pid has exited, the file is stale.
  2. Check bridgeVersion and connect only to versions you support.
  3. Send requests to http://127.0.0.1:{port} with the header Authorization: Bearer {token} on every request.
  4. Do not cache the token or port: EchoBird creates a new token on every launch and picks another port if its usual one is taken. When a request fails, read the discovery file again.

Endpoints

Method and pathPurposeOn success
GET /bridge/statusCheck availability and supported tools{"bridgeVersion":1,"echobirdVersion":"…","tools":["claudecode","codex"]}
GET /bridge/tools/{tool}/entriesList the tool's accounts and models in EchoBird's order{"entries":[entry…]}
POST /bridge/tools/{tool}/entries/{id}/activateSwitch to an account or model{"ok":true,"entry":entry}
POST /bridge/tools/{tool}/openShow EchoBird and open the tool's panel, for example so the user can sign in{"ok":true}

Right after EchoBird starts, the first list request refreshes every account's quota and can take 20–30 seconds, so allow a read timeout of about 45 seconds. Later requests are usually fast.

Entry fields

FieldMeaning
idEntry identifier such as account:… or model:…; pass it unchanged (URL-encoded) in the activate path
kindaccount (an official account) or model (a model configuration)
labelDisplay name, such as the account email or model name
planPlan name, or null
activeWhether the tool is currently using this entry
availableWhether it can be switched to
quotaQuota details, or null when unknown. Each item in windows has label (such as 5h or 7d), usedPercent (0–100) and resetAt (reset time in epoch milliseconds, possibly null)

Example

PORT=$(jq -r .port ~/.echobird/config/open-bridge.json)
TOKEN=$(jq -r .token ~/.echobird/config/open-bridge.json)

# List Claude Code's accounts and models
curl -s -H "Authorization: Bearer $TOKEN" \
  http://127.0.0.1:$PORT/bridge/tools/claudecode/entries

# Switch to one of them (id from the list, URL-encoded)
curl -s -X POST -H "Authorization: Bearer $TOKEN" \
  http://127.0.0.1:$PORT/bridge/tools/claudecode/entries/account%3A{account-id}/activate

Errors

Errors return {"ok":false,"error":"code"}:

CodeHTTP statusMeaning and what to do
unauthorized401The token is missing or outdated. Read the discovery file again.
unsupportedTool404The tool is not supported yet. Use the tools list from /bridge/status.
toolNotInstalled409 for lists / 200 for switchesThe tool is not installed on this computer.
entryNotFound200The entry was deleted or renamed in EchoBird. Fetch the list again.
Other text200 or 409A message from EchoBird's switching logic, such as an expired sign-in, that you can show to the user.

A failed switch can still return 200, so check the ok field in the response.

Security and good practice

  • The API listens only on 127.0.0.1, so other machines on your network or the internet cannot reach it. Only the current user can read the discovery file.
  • Web pages cannot read the discovery file, so they cannot get the token or use the browser to control EchoBird.
  • Switching changes the tool's sign-in or model globally, affecting every window using it. Switch only when the user has turned on such a feature or asked for it, and do not switch in a tight loop.
  • The API evolves by bridgeVersion: within a version, fields are only added and existing fields keep their meaning.