Use reAPI from AI Agents
Connect coding agents and AI assistants to reAPI — MCP server, agent skill, cost estimates and the limits an agent should respect.
An agent can drive reAPI three ways. Pick one; they bill the same and share the same API key, limits and models.
| Way | Best for | Setup |
|---|---|---|
| MCP server | Claude Code, Cursor, Codex, VS Code and other MCP clients | Add https://reapi.ai/api/mcp with your API key as a Bearer header |
| Agent skill | Agents that load skills (Claude Code, Codex and others supported by skills) | npx skills add https://reapi.ai |
| HTTP API | Your own code, or an agent writing code for you | Quickstart and /openapi.json |
Want the agent itself to think on reAPI's chat models instead? See Coding agents on reAPI.
Set your key once
Create a key under Dashboard → API Keys and export it, so the agent can read it without the key landing in your project files:
export REAPI_API_KEY=YOUR_API_KEYThe API Keys page also has a Connect via MCP button that prints a ready config for each MCP client.
What an agent does on reAPI
- Find a model —
list_models(MCP), or the model list in/llms.txt. Every model has a plain-text summary athttps://reapi.ai/models/<slug>/llms.txtwith its parameters, prices and examples. - Read its input schema —
get_model_schema(MCP), or the model's docs page. - Use public media URLs — generation endpoints accept only public
http(s)URLs for images, video and audio; base64 anddata:URIs are rejected, so host local files somewhere reachable first. - Check the price —
estimate_cost(MCP) returns the credits a request would cost before anything is submitted. 1 credit = $0.001. - Submit and wait —
submit_task, thenget_taskwithwait_seconds: 50untilcompletedorfailed. Over HTTP,POSTthe model's endpoint and pollGET /api/v1/tasks/{id}every 1–2 seconds.
Failed tasks are refunded automatically, except where a model's docs say a
blocked output is still charged; the settled charge is usage.credits on the
task. A submit is not idempotent: retrying
a request whose response you did not receive creates and bills a second
task, so check the task list or balance first.
Limits to plan around
| Limit | Default | Error when exceeded |
|---|---|---|
Requests per second, per user (all /api/v1 calls, polling included) | 50 | HTTP 429 — code 50001 on task endpoints |
| Image / video / audio / text tasks processing at once, per user | 100 | HTTP 429, code 50002 |
| Chat model requests in flight at once, per user | 20 | HTTP 429 |
On HTTP 429, wait for Retry-After when it is present, otherwise back off
exponentially with jitter and a cap. Key off the status rather than parsing
error bodies, which follow each protocol (chat
endpoints use OpenAI or Anthropic error shapes). When task submits hit
50002, wait for running work to finish before submitting
more — a batch job should keep a queue rather than fire everything at once.
Contact support if you need higher limits.
Machine-readable entry points
| URL | What it is |
|---|---|
/llms.txt | Index of models, docs and guides for LLMs |
/models/<slug>/llms.txt | One model's parameters, prices and examples |
/docs/<page>.md | Any docs page as raw markdown |
/openapi.json | OpenAPI description of the HTTP API |
/.well-known/agent-skills/index.json | Agent skill index (used by npx skills add https://reapi.ai) |
/.well-known/api-catalog | API catalog (RFC 9727) |