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.
| Resource | Where | Use it for |
|---|---|---|
| Index | https://onekey.dev/llms.txt | A short map with links. Start here. |
| Everything | https://onekey.dev/llms-full.txt | The whole docs, every endpoint, in one file, for an agent that cannot browse. |
| One platform | /llms-<platform>.txt, for example /llms-github.txt | Every endpoint of one platform with its parameters, price and returned fields. 294 platforms. |
| One page | /docs/<page>.md, for example /docs/quickstart.md | Any docs page as clean Markdown. Endpoint pages too: /docs/api/<platform>/<endpoint>.md. |
| OpenAPI | /openapi.json | Generate clients, or let a tool import every endpoint. |
| Live catalog | GET https://api.onekey.dev/v1/platforms | Current 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):
{
"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.
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#
- One shape for every platform, so parsing code does not change between sources.
- Errors have stable codes and retry guidance; costs are flat and printed in every response.
- Free discovery:
/v1/platformsand/v1/accountcost nothing. - One query in words, or a report on a brand, a creator or a topic, reports what it did and what each part cost. Both can be priced first with
dry_run=trueover REST. - An agent that should react to change does not have to poll: a monitor calls your webhook when the data moves.
- Cap what an agent can spend with a key that has a credit limit.
AI enrichment (labels, relevance, themes) is not enabled yet, so nothing on this page depends on it. More in AI agents and AI pricing.