# Tribulnation Terminal API > Read-only API for a Terminal user's crypto portfolio (connected exchange and wallet accounts, positions, P&L, funding, fills) and, on the Ultra plan, live and historical market data across CEX and DEX venues (order books, prices, funding rates, opportunities). One API key, sent as `Authorization: Bearer tn_key_…`; nothing can trade, move funds or change settings. - API host: `https://api.tribulnation.com` (HTTPS; WebSocket `wss://api.tribulnation.com/live/`). - Keys: made and revoked on https://app.tribulnation.com/integrations, or minted by `tn terminal auth login` (device login) or by an MCP client's OAuth sign-in. Scopes: `me:read` (your data, every plan), `me:profiles` (create and change portfolio profiles, every plan, opt-in), `market:read` (market data, Ultra). - `GET https://api.tribulnation.com/me` says what a key is: scopes, expiry, the owner's plan. - Errors: `{"error": {"code", "message"}}`; retry only 429 and 503, after `Retry-After`. - Send a `User-Agent` naming your program: a plain-text `403` (`error code: 1010`, e.g. for Python `urllib`'s default `Python-urllib/3.x`) is refused before it reaches the API. - Asset ids are catalogue ids (`bitcoin`); amounts in USD unless a field says otherwise; times UTC. ## Docs - [Hand it to your agent](https://api.tribulnation.com/docs#hand-it-to-your-agent): the prompt, MCP server, Claude Code plugin and clients, each one line to copy. - [Full agent guide](https://api.tribulnation.com/llms-full.txt): everything below in one Markdown file, with every endpoint and parameter. - [API docs (HTML)](https://api.tribulnation.com/docs): the same guide and reference for people, with every response type and a search. - [OpenAPI 3.1](https://api.tribulnation.com/openapi.json): `/me`, `/v1`, `/v2`, `/live`, `/oauth` with parameters and schemas. ## REST - [Your data: /me](https://api.tribulnation.com/docs#your-data-me): `/me/accounts`, `/me/portfolio` (`hours=` or `start`/`end` ms), `/me/portfolio/asset`, `/me/portfolio/fills|funding|transfers` (paged by `cursor`), `/me/position`, `/me/profiles`, `/me/charts`. Scope `me:read`. `POST /me/profiles` and `PATCH /me/profiles/{id}` (JSON body: name, description, include, exclude, base_currency, value_collateral) with `me:profiles`. - [Market data: /v1](https://api.tribulnation.com/docs#market-data-v1): prices, candles, tickers, perp stats, funding (latest and history), earn, assets, search, venues, networks. Scope `market:read`, Ultra. Filters are plural comma lists (`assets=bitcoin,ethereum`). - [Typed series: /v2](https://api.tribulnation.com/docs#series-snapshots-v2): `/v2/series`, `/v2/snapshots` list what the key can read. ## Live - [Snapshots](https://api.tribulnation.com/docs#snapshots-over-http): `GET /live/book/{asset}?depth=1..50` (order books across venues, never older than 30 s; `503 warming` means retry after `Retry-After`), `GET /live/asset/{asset}`. - [WebSocket](https://api.tribulnation.com/docs#websocket): `wss://api.tribulnation.com/live/` with the key in `Authorization`; topics `book:` (`?depth=`), `asset:`, `rates`, `page:`. Reconnect at once on close 4001 (every 60 s), stop on 4401 (revoked), 4003 (not in the plan) and 4004 (unknown topic); send `ping` every ~20 s (the answer is a bare `pong`, not JSON). - [Live JSON](https://api.tribulnation.com/docs#live-json): `/live/opportunities`, `/live/funding`, `/live/funding/history`, `/live/profile`, `/live/exchanges`. ## MCP - [Remote MCP server](https://api.tribulnation.com/docs#mcp-server): `https://api.tribulnation.com/mcp` (Streamable HTTP, OAuth sign-in). Claude Code: `claude mcp add --transport http tribulnation-terminal https://api.tribulnation.com/mcp`, then `/mcp` › Authenticate. Claude and ChatGPT: add it as a custom connector. Tools: portfolio, positions, funding P&L, prices, candles, funding, order books and more. ## Clients and command line - [tribulnation-terminal on PyPI](https://pypi.org/project/tribulnation-terminal/): `pip install tribulnation-terminal` (typed async client: `from tribulnation.terminal import Terminal`); `uv tool install 'tribulnation-terminal[cli]'` gives `tn terminal` (`auth login`, `portfolio`, `positions`, `funding`, `prices`, `candles`, `watch book:bitcoin`, `--json` everywhere). ## Skills - [Claude Code plugin](https://api.tribulnation.com/skills/): `claude plugin marketplace add https://api.tribulnation.com/skills/marketplace.json` then `claude plugin install terminal@tribulnation`. Skills: terminal-portfolio, terminal-positions, terminal-opportunities, terminal-markets. The same skills as a tarball: `https://api.tribulnation.com/skills/tribulnation-terminal-skills-0.5.5.tgz`. ## Optional - [Keys page](https://app.tribulnation.com/integrations): create, scope, expire and revoke keys.