API pipeline: Give your oracle tools

Index: API pipelines — index

Goal: give your oracle tools: describe your own HTTP endpoints as cards and store the keys they need as secrets, then attach both to the oracle's agenda.

An API endpoint card is one HTTP call the oracle may make; its operation_id is the tool's name, its request_schema the tool's arguments. A secret holds a key; endpoints reference it by name and the value is filled in only when the call is made.

Steps

1. Store the key.

POST /v0/my/secrets
Idempotency-Key: sec-0a9d…
{"key_name": "secret_shop_api_token", "value": "sk-example-123", "host": "api.example.com",
 "title": "Shop API token", "workspaces": ["470000000000000400"]}
→ {"nonce": "470000000000000410", "key_name": "secret_shop_api_token", "host": "api.example.com",
   "title": "Shop API token", "created_at": "…", …}

2. Describe the endpoint.

POST /v0/my/api_endpoints
Idempotency-Key: ep-77b3…
{"title": "Check order status", "content": "Returns the status of one order. Use when a customer asks where their order is.",
 "operation_id": "orders_status", "method": "GET",
 "path": "https://api.example.com/v1/orders/{id}",
 "request_schema": {"type": "object", "properties": {"id": {"type": "string"}}, "required": ["id"]}}
→ {"nonce": "470000000000000420", "card_type": "api_endpoint", …}

3. Attach to the agenda. PATCH /v0/my/agendas/{agenda} {"api_endpoints": ["470000000000000420"], "secrets": ["470000000000000410"]} — each list replaces the previous one. API pipeline: Write an agenda for your oracles

4. Manage.

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
POST /v0/my/secrets, PATCH/DELETE /v0/my/secrets/{nonce} Store, edit, remove a key yes yes
GET /v0/my/secrets Your keys (no values) yes yes
POST /v0/my/api_endpoints, PATCH/DELETE /v0/my/api_endpoints/{nonce} Describe a tool yes yes
GET /v0/my/api_endpoints, GET /v0/graph/api_endpoints (+ /{nonce}) Yours, public yes yes
PATCH /v0/my/agendas/{ident} (api_endpoints, secrets) Attach to an agenda yes yes

Mentioned