Public API

Headless settlement for agents.

api.settleproof.xyz has a visual console at the root and JSON endpoints under /v1/*. Agents use the API to prepare deterministic escrow inputs, relay fully signed transactions, and read live devnet settlement state from the persistent indexer without opening the demo UI.

Hosted surfaces

URLAudiencePurpose
api.settleproof.xyzhumansAPI console with endpoint inventory and live protocol status
/openapi.jsonagents + SDKsOpenAPI 3.1 contract for generated clients and API review
/v1/statusagentsJSON status for deployed programs, relay, indexer, and reads
demo.settleproof.xyzhumans + merchantsvisual merchant/x402 harness that uses the same protocol path

Endpoint map

MethodPathStatusUse
GET/openapi.jsonliveOpenAPI 3.1 contract
GET/v1/statusliveProtocol and deployment status
POST/v1/escrows/prepareliveDerive escrow PDA, vault ATA, merchant PDA, and task hash inputs
GET/v1/escrows/:pdaliveRead one escrow account from devnet
GET/v1/merchants/:pubkeyliveRead one registered merchant account from devnet
GET/v1/indexerliveList escrow accounts from the persistent devnet index
GET/v1/indexer/eventsliveList persisted settlement events
POST/v1/indexer/syncliveTrigger a program-account sync into the persistent index
GET/v1/relayliveDescribe signed-transaction relay policy
POST/v1/relayliveBroadcast a base64 serialized, already-signed Solana transaction

Prepare an escrow

/v1/escrows/prepare does not create an escrow. It prepares deterministic addresses and input bytes. The agent still signs locally with its wallet or posts an already-signed transaction to /v1/relay.

curl -s https://api.settleproof.xyz/v1/escrows/prepare \
  -H 'content-type: application/json' \
  -d '{
    "agent_owner": "<agent wallet>",
    "merchant": "<merchant wallet>",
    "mint": "<USDC or mock mint>",
    "amount_stroops": "1000000",
    "ttl_seconds": 86400,
    "task_intent": "book hotel abc123"
  }'
{
  "data": {
    "escrow_pda": "...",
    "vault_token_account": "...",
    "agent_token_account": "...",
    "merchant_pda": "...",
    "inputs": {
      "task_hash": "...",
      "task_hash_derived": true,
      "amount_usdc": "1.000000"
    },
    "sdk_call": {
      "package": "@aap/sdk-ts",
      "method": "client.createEscrow",
      "signer": "agent_owner"
    }
  }
}

Headless agent flow

const quote = await fetch(
  "https://api.settleproof.xyz/v1/escrows/prepare",
  { method: "POST", body: JSON.stringify(intent) },
).then((res) => res.json());

const { escrowPda } = await client.createEscrow({
  agentOwner,
  merchantPubkey,
  mint,
  amountStroops,
  taskHash: hexToBytes(quote.data.inputs.task_hash),
  ttlSeconds,
});

// Optional: broadcast an already-signed transaction through the public relay.
await fetch("https://api.settleproof.xyz/v1/relay", {
  method: "POST",
  body: JSON.stringify({
    signed_transaction: signedTxBase64,
    encoding: "base64",
    confirm: true,
  }),
});

const state = await fetch(
  "https://api.settleproof.xyz/v1/indexer?merchant=...&limit=10",
).then((res) => res.json());

Relay policy

No private keys

The public API never receives agent, merchant, or attestor secrets. POST /v1/relay only accepts serialized transactions that have already been signed by the caller.
curl -s https://api.settleproof.xyz/v1/relay

curl -s https://api.settleproof.xyz/v1/relay \
  -H 'content-type: application/json' \
  -d '{
    "signed_transaction": "<base64 serialized signed tx>",
    "encoding": "base64",
    "confirm": true
  }'

Indexer filters

The current hosted indexer syncs live program accounts from Solana devnet into a persistent JSON store. Set INDEXER_STORE_PATH to a Railway volume path if you want the index to survive redeploys.

curl -s 'https://api.settleproof.xyz/v1/indexer?limit=10'
curl -s 'https://api.settleproof.xyz/v1/indexer?merchant=<merchant>&state=Pending'
curl -s 'https://api.settleproof.xyz/v1/indexer/events?limit=10'
curl -s -X POST 'https://api.settleproof.xyz/v1/indexer/sync'