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) andcodex(Codex). Thetoolslist from/bridge/statusis 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"
}- Read the discovery file. If it is missing, EchoBird is not running; if the process in
pidhas exited, the file is stale. - Check
bridgeVersionand connect only to versions you support. - Send requests to
http://127.0.0.1:{port}with the headerAuthorization: Bearer {token}on every request. - 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 path | Purpose | On success |
|---|---|---|
GET /bridge/status | Check availability and supported tools | {"bridgeVersion":1,"echobirdVersion":"…","tools":["claudecode","codex"]} |
GET /bridge/tools/{tool}/entries | List the tool's accounts and models in EchoBird's order | {"entries":[entry…]} |
POST /bridge/tools/{tool}/entries/{id}/activate | Switch to an account or model | {"ok":true,"entry":entry} |
POST /bridge/tools/{tool}/open | Show 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
| Field | Meaning |
|---|---|
id | Entry identifier such as account:… or model:…; pass it unchanged (URL-encoded) in the activate path |
kind | account (an official account) or model (a model configuration) |
label | Display name, such as the account email or model name |
plan | Plan name, or null |
active | Whether the tool is currently using this entry |
available | Whether it can be switched to |
quota | Quota 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}/activateErrors
Errors return {"ok":false,"error":"code"}:
| Code | HTTP status | Meaning and what to do |
|---|---|---|
unauthorized | 401 | The token is missing or outdated. Read the discovery file again. |
unsupportedTool | 404 | The tool is not supported yet. Use the tools list from /bridge/status. |
toolNotInstalled | 409 for lists / 200 for switches | The tool is not installed on this computer. |
entryNotFound | 200 | The entry was deleted or renamed in EchoBird. Fetch the list again. |
| Other text | 200 or 409 | A 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.