API: Unlock

POST /api/gateway — verify Arc settlement and return the service reply.

Request

http
POST $ORIGIN/api/gateway
Content-Type: application/json
X-Arc-Tx-Hash: 0x…          # payment transaction
X-Arc-Address: 0x…          # payer wallet
X-Arc-Signature: 0x…        # EIP-191 over gateway challenge

{
  "service": "quick-brief",
  "input": { "prompt": "Your request" },
  "clientRequestId": "optional-id",
  "auth": {
    "issuedAt": 1710000000,
    "expiresAt": 1710000120
  }
}

Build the challenge with the gateway client helpers (buildGatewayAuthMessage / getAuthChallengeText). The signature proves the payer controls the wallet that settled on Arc.

Success

HTTP 200 with settlement + result. Settlement is USDC on Arc. See Responses & errors.

Payment required

  • HTTP 402
  • Body error.payment (+ x402)
  • Header PAYMENT-REQUIRED

Full negotiation notes: x402.