Programmatic API
Everything you can do in the dashboard, you can also do from code — over a plain REST API or over MCP. Both are the control plane (manage your endpoints), authenticated by an automation key. This is separate from the paid x402 relay your buyers call.
1 · Mint an automation key
A provider-admin key is a secret string prefixed empk_. It's shown once at creation and only its hash is stored — copy it immediately. Mint as many as you like (one per script/CI job is good practice) and revoke any of them independently.
From the dashboard
Dashboard → Automation keys → give it a label → Create key. Copy the empk_… value shown.
Or over REST
You can also mint from an existing session cookie or another key:
List your keys (prefix + lifecycle only, never the secret) with GET /dashboard/automation-keys; revoke one with DELETE /dashboard/automation-keys/<id>. Revoked keys stop authenticating immediately.
2 · Use the REST API
Send the key as a bearer token on any /dashboard/* route. Base URL: https://api.endpoint.farm (your deployment's API origin).
| Method & path | What it does |
|---|---|
| GET /dashboard/endpoints | List your endpoints (relays + MCP wrappers), status, relay URLs. |
| POST /dashboard/endpoints/api | Create a paid API relay over an HTTP origin. |
| POST /dashboard/endpoints/mcp | Wrap an upstream MCP server, pricing each tool. |
| POST /dashboard/endpoints/<id>/publish | Publish (status→active); with public listing, adds it to the marketplace. |
| GET /dashboard/wallets | List payout wallets. |
| POST /dashboard/wallets/external | Add a BYO payout wallet. |
| GET / POST / DELETE /dashboard/automation-keys | List, mint, revoke automation keys. |
Create a paid API relay
It's created as a draft. Publish it to mint the live URL:
Wrap an MCP server
Point at an upstream MCP server and price each tool independently. Buyers call the wrapped server at /m/<provider>/<slug>; each tool invocation settles its own price_usd.
Like relays, it's a draft — publish it with the same /dashboard/endpoints/<id>/publish call.
Test vs live endpoints
environment is inferred from networks — all-testnet networks → test, all-mainnet → live (mixing the two is rejected). Deploy a testnet trial and a mainnet paid version as a linked pair, and rate-limit the trial:
- environment — "test" | "live" (optional; inferred from networks).
- linked_endpoint_id — id of the sibling in the other environment (link is bidirectional; same-environment link is rejected).
- trial_rate_limit — max settled calls per buyer wallet (falls back to client IP) per window. Test endpoints only.
- trial_rate_window_seconds — rolling window for the limit (default 3600).
The trial still requires real testnet USDC payment — there's no free path; the limit just caps how often one wallet can call before settling on a paid mainnet endpoint. Exceeding it returns 429 with a Retry-After header (no gas spent).
3 · Use the management MCP
The same operations are exposed as MCP tools at POST /mcp (JSON-RPC 2.0) so you can drive endpoint.farm straight from an MCP client or agent. initialize, ping, and tools/list are open; tools/call requires the bearer key.
Available tools
- list_endpoints — your endpoints + status + relay URLs.
- create_api_relay — same fields as the REST body above.
- create_mcp_wrapper — wrap an MCP server, price each tool.
- publish_endpoint — { "endpoint_id": "…" }.
- list_automation_keys / revoke_automation_key.
List the tool catalog (no auth)
Call a tool (authenticated)
Add the management MCP to your client with URL https://api.endpoint.farm/mcp and header Authorization: Bearer empk_…. This is the control plane — not the paid relay at /m/<you>/<server>.