> Every Taji docs page as Markdown: https://docs.taji.is/llms.txt

# The Taji API

Taji's backend is one local API, the wire: HTTP and WebSockets on your own machine, served by the kernel. Every piece of data and every action in Taji is a route on it, and every client calls the same routes:

- **The window** draws what it reads and sends every click as a call.
- **Your agent** calls them through Taji's MCP bridge ([Connect your agent](https://docs.taji.is/guide/agent.md)).
- **Your phone** opens the window through Remote Control.
- **Your scripts** call them directly, as below.

So anything one client can read or do, the others can too. What differs is the token's scope: your agent's cannot open the vault, install a plugin or approve its own live order ([Wire](https://docs.taji.is/reference/wire.md#token-scopes)).

There is no account, no API key to buy and no server between you and it: the wire listens on `127.0.0.1` and answers only a token Taji writes for you on each launch.

## Explore it

- **[API reference](https://docs.taji.is/wire.json)**: every route, grouped by area, with its query words, body, answers, refusals and a `curl` to copy.
- **The OpenAPI document**: the same routes as OpenAPI 3.1, served on this site as `/wire.json` and downloadable from the reference. A running Taji serves its own at `GET /read/openapi`, with the routes its enabled plugins add.
- **TypeScript types**: `@taji/wire` (`packages/wire/wire.ts`) is generated from that document and never edited by hand.

The document is generated from the kernel: `the_wire_fixture_is_the_kernels` (`engine/crates/taji/src/wire/fixture.rs`) fails when the file and the kernel differ, so the reference cannot drift from what Taji serves.

## Areas

The reference groups every route by area; each link opens its routes.

| Area | What it covers |
|---|---|
| [Market data](https://docs.taji.is/wire.json#tag/market-data) | Bars, quotes, chains and every other data product, what the store holds, and the market socket. |
| [Trading](https://docs.taji.is/wire.json#tag/trading) | Each account's book, orders, drafts, plans and approvals. |
| [Desks and charts](https://docs.taji.is/wire.json#tag/desks-and-charts) | Desks, panes, charts, indicators, drawings, watchlists and alerts. |
| [Connections](https://docs.taji.is/wire.json#tag/connections) | Linking providers and accounts: the forms, guided flows and keys. |
| [Agent](https://docs.taji.is/wire.json#tag/agent) | Your agent's sessions, tools and socket. |
| [Plugins](https://docs.taji.is/wire.json#tag/plugins) | Installed plugins, their pages and nodes, and the indicators they register. |
| [Phone and channels](https://docs.taji.is/wire.json#tag/phone-and-channels) | Messaging channels and Remote Control. |
| [Voice](https://docs.taji.is/wire.json#tag/voice) | The realtime voice in front of your agent. |
| [Window](https://docs.taji.is/wire.json#tag/window) | The window's page, its state and quitting. |
| [Wire](https://docs.taji.is/wire.json#tag/wire) | The root, the route catalog, the OpenAPI document, the change feed, the event log and reports. |

## What you can call

| You want to | Call | Answer |
|---|---|---|
| Read state: desks, charts, accounts, settings | `GET /read/<node>` | JSON |
| Read market data: bars, quotes, chains, trades and every other product | `GET /get/<product>?...` | Apache Arrow |
| Change something: draw, bind an indicator, stage an order | `POST /verb/<node>/<verb>` | JSON; 202 where the outcome arrives later or waits for your approval |
| Hear what changed | `/ws/live` | WebSocket frames naming the paths to read again |
| Stream rows: live bars, quotes, trades, the book | `/ws/market` | WebSocket frames carrying Arrow |

How each kind behaves, the token scopes, refusals and frames: [Wire](https://docs.taji.is/reference/wire.md).

## Your first call

With Taji running, its port and token are files in its state directory. One read, as [Wire](https://docs.taji.is/reference/wire.md#requests-and-answers) shows with its captured answer:

```sh
curl -s -H "x-taji-token: $(cat "$TAJI_STATE_DIR/wire-token")" "http://127.0.0.1:$(cat "$TAJI_STATE_DIR/wire-port")/read/ui"
```

A Taji you can call without touching your own: [Build from source](https://docs.taji.is/guide/install.md) runs one headless, with its state in a directory you choose.

## Built to be called by code

- **Typed end to end.** Every body and every JSON answer has a schema in the document; every refusal is `{"error", "reason"}` with `error` from one closed set of codes, each answered with one status.
- **Market data as Arrow.** A data read is one Arrow IPC stream: decimals stay exact, and the schema's metadata says which source and provider served each item.
- **Orders wait for you.** While an account's approvals are on, an order sent with a script's or your agent's token waits in the window until you approve it ([Security](https://docs.taji.is/architecture/security.md)).
- **Versioned.** Every answer carries `x-taji-version`. What may change, and how a client learns of it: [Compatibility](https://docs.taji.is/reference/compatibility.md).

## Next

- [Read bars over the wire with curl](https://docs.taji.is/cookbook/wire-read-bars.md): a full read, its Arrow answer decoded.
- [Stream live quotes over the wire](https://docs.taji.is/cookbook/wire-stream-quotes.md): the market socket, frame by frame.
- [Connect your agent](https://docs.taji.is/guide/agent.md): the same API through MCP, with what your agent may and may not do.
