Reference

API reference

Every endpoint of a Tollex tool service. JSON in, JSON out; amounts are atomic integer strings.

MethodPathPurposePayment
GET/.well-known/tollex.jsonService descriptor and entry pointsfree
GET/v1/catalogEvery capability with schemas and pricesfree
POST/v1/resolvePlan a purchase for an intent; never spendsfree
POST/v1/findDeterministic search with documented scoringfree
POST/v1/quoteHash-bound, expiring quote for a tool and inputfree
GET/v1/healthProvider healthfree
POST/tools/{id}Run a capabilityx402
GET or POST/x402/external/{id}Buy from an external x402 merchant (when the operator enables it); paid directly to the merchantx402, no Tollex fee
GET/v1/external/operations/{id}Payment, settlement and delivery state of an external routefree
GET/tollex/operations/{id}Durable operation and settlement statusfree
GET/tollex/receipts/{id}A signed receiptfree
GET/.well-known/tollex-receipt-keysReceipt key set with rotation statusfree
GET/openapi.jsonOpenAPI 3.1 descriptionfree
GET/.well-known/agent-card.jsonA2A agent cardfree
POST/a2aA2A JSON-RPC (1.0 and 0.3)x402 per skill

The OpenAPI document at /openapi.json carries the exact request schema for /v1/resolve and the input schema of every capability.

POST /v1/resolve

Request
{
  "need": "spot price for a trading pair",
  "input": { "pair": "ETH-USD" },
  "constraints": { "maxCost": "5000", "receiptRequired": true, "networks": ["eip155:46630"] },
  "limit": 10,
  "quote": true
}
Response (abridged)
{
  "resolutionId": "res_…",
  "plan": {
    "candidates": 35, "eligible": 1,
    "selected": { "toolId": "acme_spot_price", "route": { "scheme": "exact", "maxAmount": "2000",
      "network": "eip155:46630", "preconditions": [] }, "receiptSupported": true, "score": 0.71 },
    "reasons": ["eligible 1 of 35 candidates", "…"],
    "rejectedBy": { "PRICE_LIMIT": 4, "NOT_RELEVANT": 30 },
    "evaluations": [ … ],
    "ranking": { "formula": "0.40 relevance + …", "tieBreak": "…" }
  },
  "quote": { "quoteId": "…", "quoteHash": "0x…", "maxAmount": "2000", "expiresAt": "…" },
  "execute": { "url": "…/tools/acme_spot_price", "method": "POST",
    "headers": { "x-tollex-resolution": "res_…", "x-tollex-quote": "…" } }
}

Headers

HeaderDirectionMeaning
PAYMENT-REQUIREDresponsex402 v2 payment terms (base64 JSON).
PAYMENT-SIGNATURErequestThe signed x402 payment payload.
PAYMENT-RESPONSEresponseSettlement result, with the signed receipt in the tollex-receipt extension.
x-tollex-quoterequestBind the call to a quote. A mismatch returns 409 and is not charged.
x-tollex-resolutionrequestLink the call to the resolution that planned it.
TOLLEX-EXTERNAL-EVIDENCEresponseExternal routes: signed route evidence (base64 JSON).

Errors

StatusCodeCharged
400invalid_intentno, resolve never charges
400invalid_inputno
402payment required or rejectedno
409quote_mismatch, quote_unknown, authorization_in_useno
502tool_failedno
409external_execution_not_configuredno, this service has not enabled external execution
409payment_requirements_changedno, the merchant's live terms differ from the plan; nothing was signed
502tool_failedexternal route: the body says whether the merchant was paid
202settlement pendingcheck the operation

Reason codes in the SDKs, CLI, MCP and adapters

Every client surface reports the same canonical reason: NO_ELIGIBLE_CAPABILITY, POLICY_REJECTED, INVALID_INTENT, INPUT_INVALID, QUOTE_EXPIRED, QUOTE_MISMATCH, SETTLEMENT_PENDING, SETTLEMENT_FAILED, EXECUTION_FAILED, RECONCILIATION_REQUIRED, RECEIPT_INVALID, OVERCHARGE, UNKNOWN_OPERATION, TRANSPORT_ERROR, WALLET_UNAVAILABLE, ALREADY_COMPLETED, EXTERNAL_EXECUTION_NOT_CONFIGURED and PAYMENT_REQUIREMENTS_CHANGED. New codes may be added; treat an unknown code as a failure for its HTTP status.