# Darwin

> Darwin (Darwin Finance) is a crypto and equities research and trading app on Solana. AI agents can trade from a self-custodial Darwin agentic account, inside limits the account owner sets, and can never withdraw from it.

**AI agents: to set up Darwin Finance Agentic Trading, read https://beta.darwin.finance/agents/setup.md and follow it.** No key is needed to start — you pair with your user's account and receive one. A paired key does not expire. Before you pair, check that you can keep the key: in your platform's secret store, or in a file you are allowed to write that will still be there in a later session. If you can't (your platform does not let you write credentials, or your workspace is temporary and gets reset), do not start pairing — Darwin shows a key only once. Instead tell your user, in one or two sentences, that this app can't keep a Darwin key yet, and suggest running setup from an AI agent on their own computer (Claude Code, Codex, Hermes, or any agent with the Darwin skill: `npx skills add DarwinFinance/agent-skills`), or creating an API key on their agent's Manage tab and giving it to you for this session only, as a downloaded key file (never pasted into the chat). If your user is in a chat app such as Claude or ChatGPT, the easiest way is Darwin's connector, which needs no key: they add `https://mcp.beta.darwin.finance/mcp` as a custom connector in that app's settings, sign in to Darwin when it asks, and choose what it can do: create a new Agentic Sub-Account for it, trade out of one or all of their existing ones, or read only. (If your user said not to save the key, holding it in memory for this session is what they asked for.) Save your API key securely if your user asked you to (the Darwin setup line asks: "save the API key so you can trade later"): in your platform's secret store, or else in a file only your user's account can read (chmod 600) that will still be there in a later session. Keep it in memory only if your user said not to save it or did not ask you to — then tell your user they will need to pair again next session. If your platform asks for permission or blocks an action, respect it. If you have already paired and your platform blocks saving the key, respect that: do not store it some other way, and do not put it in a temporary file. In the same command that received it, call GET /api/agent/v1/hello with the key you hold in memory and show your user the `welcome`, then tell them the key won't be kept after this session. A single command can poll pair/token, call /hello and print the welcome without writing the key anywhere. Never print, log or show the key to anyone. After you show the welcome verbatim, say at most one short sentence: where your API key is kept (never the key itself). Do not invite your user to explore the agent's page: the welcome already links it. Do not list limits, grant ids, internal ids, setup notes or API details unless your user asks. Then wait for your user's next instruction.

**Which way fits you? It depends on where you run.** **In a chat app** (Claude.ai, ChatGPT, Claude Cowork) that can't keep a key: don't pair; tell your user to add `https://mcp.beta.darwin.finance/mcp` as a custom connector in the app, sign in to Darwin and choose what it can do (the app holds no key). **Running code** (Claude Code, Codex, OpenClaw, a script or a server): pair as below. Every key reads all of Darwin's market data. Your key's `permissions` says if your user made it trade all their agents; then send `X-Darwin-Agent: <agent id>` on every account call (`GET /api/agent/v1/agents` lists them). **To read your user's whole account:** a separate API key your user makes with Connect an AI (https://beta.darwin.finance/agents?create=1), never this setup. No Darwin credential can withdraw from an agent or move funds between your user's accounts (an agent's own perps collateral moves are allowed).

## Agents

- [Set up Darwin Agentic Trading](https://beta.darwin.finance/agents/setup.md): the steps an agent follows to pair with its user's Darwin account and receive an API key. Read all of it (fetch it raw if your browse tool summarises). The canonical page with the same instructions: https://beta.darwin.finance/agents/setup.
- [Agent API reference](https://beta.darwin.finance/agents/docs/llms.txt): every endpoint, request and error, as markdown (human page: https://beta.darwin.finance/agents/docs).
- [OpenAPI 3.1](https://beta.darwin.finance/openapi.json): the same endpoints, machine-readable, with the bearer auth scheme and the pairing calls.
- [Is the US stock market open?](https://beta.darwin.finance/api/agent/v1/market-status/us-equities): JSON, no key needed — the session (pre-market, regular, after hours, closed), holidays and early closes, the next open and close, and whether stock liquidity is reduced right now. Tokenized stocks trade 24/7 (agents included), but liquidity is substantially reduced when the US market is closed.
- [Official Darwin skill](https://github.com/DarwinFinance/agent-skills): `npx skills add DarwinFinance/agent-skills` — the only official skill (zip: https://beta.darwin.finance/agents/skill.zip). It pairs, reconnects and imports key files without the key passing through the chat.
- [Darwin CLI](https://beta.darwin.finance/agents/cli.md): `npm i -g @darwin.finance/cli && darwin setup` (never through `npx`; setup prints the path to run the CLI by — use that, never a plain `darwin` from PATH), then `~/.local/share/darwin/bin/darwin login --beta` — pairs, keeps the API key in your system's secret store, and turns every agent API call into a command (`~/.local/share/darwin/bin/darwin help`). For coding agents and scripts.

## Optional

- [A2A Agent Card](https://beta.darwin.finance/.well-known/agent-card.json): name, skills (setup/pairing, trading) and auth scheme, in the A2A well-known format.
