Built to be read and called by AI agents

A map, a full copy, a Markdown version of every docs page, per-platform files, an OpenAPI description and a small MCP tool list. Errors carry stable codes and a link that says what to do.

What an agent can read#

An agent should never have to guess. There is a map, a full copy, a Markdown version of every docs page and a machine-readable API description.

ResourceWhereUse it for
Indexhttps://onekey.dev/llms.txtA short map with links. Start here.
Everythinghttps://onekey.dev/llms-full.txtThe whole docs, every endpoint, in one file, for an agent that cannot browse.
One platform/llms-<platform>.txt, for example /llms-github.txtEvery endpoint of one platform with its parameters, price and returned fields. 294 platforms.
One page/docs/<page>.md, for example /docs/quickstart.mdAny docs page as clean Markdown. Endpoint pages too: /docs/api/<platform>/<endpoint>.md.
OpenAPI/openapi.jsonGenerate clients, or let a tool import every endpoint.
Live catalogGET https://api.onekey.dev/v1/platformsCurrent endpoints, prices and parameters. No key, no cost.

On every docs page, Copy page for AI copies its Markdown and View as Markdown opens the raw text.

Tools instead of prompts#

Connect the hosted MCP server and the agent gets eleven tools, a tool list of about 6 KB, that find endpoints, read their contracts and call them, including universal search and reports. The repository also ships an Agent Skill for the same workflow (search, describe, call, read credits, page, handle each error type).

The Agent Skill is not published yet and the MCP server is not listed in a registry, so there is no install link for either today.

Errors a model can act on#

Every error has a stable machine code, a type, a message, a request id and a link that explains what to do. Recorded from the dev API for a call with a missing parameter (a 422 that costs nothing):

json
{
  "success": false,
  "data": null,
  "metadata": { "request_id": "ba31e664b5374487a385b038e4523409" },
  "error": {
    "code": "invalid_params",
    "type": "INVALID_PARAMS",
    "message": "Missing required parameter 'username'",
    "request_id": "ba31e664b5374487a385b038e4523409",
    "doc_url": "https://onekey.dev/errors/INVALID_PARAMS"
  }
}

The doc_url leads to what the error means, whether to retry and whether you were charged. Over MCP the same error arrives as a tool error with the same type and doc_url, plus a hint (and retry_after_s on a rate limit) to help a model correct itself. The whole table is on Errors.

A copyable prompt#

Paste this as a system prompt or a project rule. Give the agent your key through an environment variable or your tool's secret store, never by pasting it into a chat.

text
You can call the Onekey API for public data from many platforms.

Base URL: https://api.onekey.dev
Auth: send header "x-api-key" with the key from the environment variable ONEKEY_KEY. Never print or log the key.
Call shape: GET /v1/{platform}/{endpoint}?{params}
Discover endpoints (free, no key): GET /v1/platforms. Read parameter names from it; do not guess them.
Docs index: https://onekey.dev/llms.txt. Full docs: https://onekey.dev/llms-full.txt.

Rules:
1. Every response is {success, data, metadata, error}. Check "success" before using "data".
2. Branch on error.code, not error.message. Never retry 400, 401, 402, 404, 405 or 422.
3. Retry 429 after the Retry-After seconds, and retry 500/502 with exponential backoff (max 4 tries).
4. Each endpoint costs a flat number of credits (metadata.credits_charged). Cache hits are free. Do not repeat identical calls in a loop.
5. If metadata.stale is true the data is a little old; say so if freshness matters.
6. A 402 means the account is out of credits: stop and tell the user.

Why this suits agents#

AI enrichment (labels, relevance, themes) is not enabled yet, so nothing on this page depends on it. More in AI agents and AI pricing.