endpoint.farm_ ALPHA v0.0.1

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.

Two different keys, don't mix them up. An empk_… automation key authenticates you managing your account here. Your buyers never use a key at all — they pay per call with x402. See buyer docs for that side.

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

DashboardAutomation 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:

curl -X POST https://api.endpoint.farm/dashboard/automation-keys \ -H "Authorization: Bearer empk_existingkey…" \ -H "Content-Type: application/json" \ -d '{"name": "ci-deploy"}' → { "id": "…", "key": "empk_live_9f3c…", "note": "store this now; not shown again" }

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 & pathWhat it does
GET /dashboard/endpointsList your endpoints (relays + MCP wrappers), status, relay URLs.
POST /dashboard/endpoints/apiCreate a paid API relay over an HTTP origin.
POST /dashboard/endpoints/mcpWrap an upstream MCP server, pricing each tool.
POST /dashboard/endpoints/<id>/publishPublish (status→active); with public listing, adds it to the marketplace.
GET /dashboard/walletsList payout wallets.
POST /dashboard/wallets/externalAdd a BYO payout wallet.
GET / POST / DELETE /dashboard/automation-keysList, mint, revoke automation keys.

Create a paid API relay

curl -X POST https://api.endpoint.farm/dashboard/endpoints/api \ -H "Authorization: Bearer empk_live_9f3c…" \ -H "Content-Type: application/json" \ -d '{ "name": "Weather API", "slug": "weather", "origin_url": "https://api.example.com/v1/weather", "method": "GET", "price_usd": "0.01", "networks": ["eip155:84532"], "pay_to": "0xYourPayoutWallet", "public_listing": true }' → 201 { "id": "…", "relay_url": "https://api.endpoint.farm/r/acme/weather", "status": "draft", "environment": "test", … }

It's created as a draft. Publish it to mint the live URL:

curl -X POST https://api.endpoint.farm/dashboard/endpoints/<id>/publish \ -H "Authorization: Bearer empk_live_9f3c…"

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.

curl -X POST https://api.endpoint.farm/dashboard/endpoints/mcp \ -H "Authorization: Bearer empk_live_9f3c…" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Tools", "slug": "acme-tools", "origin_url": "https://mcp.example.com", "networks": ["eip155:84532"], "pay_to": "0xYourPayoutWallet", "public_listing": true, "tools": [ { "name": "search", "description": "Full-text search over the corpus.", "input_schema": { "type": "object", "properties": { "q": { "type": "string" } } }, "price_usd": "0.02" }, { "name": "summarize", "price_usd": "0.05" } ] }' → 201 { "id": "…", "mcp_url": "https://api.endpoint.farm/m/acme/acme-tools", "status": "draft", "environment": "test", … }

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)

curl -X POST https://api.endpoint.farm/mcp \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Call a tool (authenticated)

curl -X POST https://api.endpoint.farm/mcp \ -H "Authorization: Bearer empk_live_9f3c…" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "create_api_relay", "arguments": { "name": "Weather API", "slug": "weather", "origin_url": "https://api.example.com/v1/weather", "method": "GET", "price_usd": "0.01", "networks": ["eip155:84532"], "pay_to": "0xYourPayoutWallet", "public_listing": true } } }'

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>.