{"openapi":"3.1.0","info":{"title":"Polymarket Markets API","version":"1.0.0","description":"Public Polymarket markets, events, and recent trades from official Gamma and Data API v2 endpoints. Paid with x402 exact USDC on Base. No account is required.","contact":{"email":"support@brainiac.software"},"x-guidance":"BRAINIAC.software is a pay-per-call API for software agents. No account or API key is required.\nThis root OpenAPI is a token-light discovery index. Full request/response schemas and examples are at /api/{group}/openapi.json; x-api-groups lists every group URL.\nPayment uses x402 with exact USDC on Base (8453). Unpaid GET/HEAD/POST return 402 payment terms for discovery.\nHow to call: POST JSON → verify payTo/asset/network against /api/v1/catalog and /.well-known/x402 → pay and retry with payment-signature. Settlement only on HTTP 2xx.\nIdempotency-Key: 64 hex chars. Coverage HTTP 2xx with status complete|partial and real data is charged; failed or empty results are not charged. Free lookup: GET /api/v1/results/{result_id}.\nOutputs are drafts for human review — not official determinations or legal advice."},"servers":[{"url":"https://www.brainiac.software"}],"paths":{"/api/v1/polymarket/markets":{"post":{"operationId":"polymarket_markets","summary":"Polymarket markets and odds","description":"List Polymarket markets from the public Gamma API. Docs: https://www.brainiac.software/api/polymarket/markets","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/markets"},"tags":["polymarket","prediction market","odds","prediction markets","markets","market prices","outcome prices","bid ask","condition id","volume","liquidity","Gamma API"],"x-keywords":["polymarket","prediction market","odds","prediction markets","market prices","outcome prices","bid ask","condition id","volume","liquidity","Gamma API"],"x-empty-json-probe":true,"x-probe-body":{"limit":5,"closed":false},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":200},"conditionId":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"closed":{"type":"boolean"},"limit":{"type":"integer","minimum":1,"maximum":50},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"order":{"type":"string","minLength":1,"maxLength":64},"ascending":{"type":"boolean"},"cursor":{"type":"string","minLength":1,"maxLength":4000}},"additionalProperties":false},"example":{"limit":5,"closed":false}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"retrievedAt":{"type":"string"},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"additionalProperties":true},"limit":{"type":"number"},"offset":{"type":"number"},"markets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"slug":{"type":"string"},"conditionId":{"type":"string"},"outcomes":{"type":"array","items":{"type":"string"}},"outcomePrices":{"type":"array","items":{"type":"string"}},"bestBid":{"type":"number"},"bestAsk":{"type":"number"},"lastTradePrice":{"type":"number"},"spread":{"type":"number"},"volume":{"type":"string"},"liquidity":{"type":"string"},"endDate":{"type":"string"},"active":{"type":"boolean"},"closed":{"type":"boolean"}},"additionalProperties":true}},"unavailable":{"type":"array","items":{}},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","data":{"retrievedAt":"2026-11-20T21:36:00.000Z","limit":20,"offset":0,"markets":[{"id":"559651","question":"Xi Jinping out before 2027?","slug":"xi-jinping-out-before-2027","conditionId":"0xa467b14d51f01b957109d9cbb1d6c124fab2a089d52ed8f471d23c2812e743b7","outcomes":["Yes","No"],"outcomePrices":["0.0175","0.9825"],"bestBid":0.017,"bestAsk":0.018,"lastTradePrice":0.015,"spread":0.001,"volume":"17392796.370488998","liquidity":"299906.07864","endDate":"2027-01-01T04:59:00Z","active":true,"closed":false}],"unavailable":[]},"nextCursor":null,"progress":{"processed":0,"total":null,"unit":"items","scannedRange":null},"sources":[{"source":"upstream","url":"https://gamma-api.polymarket.com/markets","retrievedAt":"2026-11-20T21:36:00.000Z"}],"missing_items":[],"limitations":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.008"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/polymarket/events":{"post":{"operationId":"polymarket_events","summary":"Polymarket events","description":"List Polymarket events and nested markets from the public Gamma Events API. Docs: https://www.brainiac.software/api/polymarket/events","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/events"},"tags":["polymarket","prediction market","events","odds","event markets","outcome prices","volume","slug","Gamma API"],"x-keywords":["polymarket","prediction market","events","odds","event markets","outcome prices","volume","slug","Gamma API"],"x-empty-json-probe":true,"x-probe-body":{"limit":5,"closed":false},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"query":{"type":"string","minLength":1,"maxLength":200},"slug":{"type":"string","minLength":1,"maxLength":200},"eventId":{"type":"string","minLength":1,"maxLength":64},"closed":{"type":"boolean"},"active":{"type":"boolean"},"limit":{"type":"integer","minimum":1,"maximum":50},"offset":{"type":"integer","minimum":0,"maximum":9007199254740991},"cursor":{"type":"string","minLength":1,"maxLength":4000}},"additionalProperties":false},"example":{"limit":5,"closed":false}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"retrievedAt":{"type":"string"},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"additionalProperties":true},"limit":{"type":"number"},"offset":{"type":"number"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"slug":{"type":"string"},"endDate":{"type":"string"},"volume":{"type":"string"},"liquidity":{"type":"string"},"active":{"type":"boolean"},"closed":{"type":"boolean"},"markets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"slug":{"type":"string"},"conditionId":{"type":"string"},"outcomes":{"type":"array","items":{"type":"string"}},"outcomePrices":{"type":"array","items":{"type":"string"}},"volume":{"type":"string"},"endDate":{"type":"string"}},"additionalProperties":true}}},"additionalProperties":true}},"unavailable":{"type":"array","items":{}},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","data":{"retrievedAt":"2026-11-20T21:36:00.000Z","limit":20,"offset":0,"events":[{"id":"12345","title":"Example event","slug":"example-event","endDate":"2026-12-31T00:00:00Z","volume":"1000000","liquidity":"50000","active":true,"closed":false,"markets":[{"id":"559651","question":"Example market?","slug":"example-market","conditionId":"0xa467b14d51f01b957109d9cbb1d6c124fab2a089d52ed8f471d23c2812e743b7","outcomes":["Yes","No"],"outcomePrices":["0.42","0.58"],"volume":"100000","endDate":"2026-12-31T00:00:00Z"}]}],"unavailable":[]},"nextCursor":null,"progress":{"processed":0,"total":null,"unit":"items","scannedRange":null},"sources":[{"source":"upstream","url":"https://gamma-api.polymarket.com/events","retrievedAt":"2026-11-20T21:36:00.000Z"}],"missing_items":[],"limitations":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.008"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/polymarket/trades":{"post":{"operationId":"polymarket_trades","summary":"Polymarket recent trades","description":"Recent Polymarket trades from the public Data API v2 trade feed (not v1, not authenticated CLOB). Docs: https://www.brainiac.software/api/polymarket/trades","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/trades"},"tags":["polymarket","prediction market","trades","market trades","recent trades","trade feed","last price","condition id","event id","Data API","market activity"],"x-keywords":["polymarket","prediction market","trades","recent trades","trade feed","last price","condition id","event id","Data API","market activity"],"x-empty-json-probe":true,"x-probe-body":{"limit":20},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"conditionId":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"eventId":{"type":"string","minLength":1,"maxLength":64},"user":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$"},"limit":{"type":"integer","minimum":1,"maximum":50},"cursor":{"allOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"string","minLength":1,"maxLength":4000}]}},"additionalProperties":false},"example":{"limit":20}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"retrievedAt":{"type":"string"},"source":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"additionalProperties":true},"trades":{"type":"array","items":{"type":"object","properties":{"proxyWallet":{"type":"string"},"side":{"type":"string"},"tokenId":{"type":"string"},"conditionId":{"type":"string"},"size":{"type":"number"},"price":{"type":"number"},"timestamp":{"type":"number"},"title":{"type":"string"},"slug":{"type":"string"},"outcome":{"type":"string"},"outcomeIndex":{"type":"number"},"transactionHash":{"type":"string"}},"additionalProperties":true}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"hasMore":{"type":"boolean"},"nextCursor":{"type":"string"}},"additionalProperties":true},"unavailable":{"type":"array","items":{}},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","data":{"retrievedAt":"2026-11-20T21:36:00.000Z","trades":[{"proxyWallet":"0x81d529f0a6b2cfb3e64dedd1cb171350dd38c38e","side":"SELL","tokenId":"72131623180530088702232590799201462172787760651892934121714422597098986683477","conditionId":"0xe1f1fb6e070d5196ef36e38bba8f8ab4c50b2ce989f332065bdb8654af9ea837","size":0.01,"price":0.88,"timestamp":1795210636,"title":"Bitcoin Up or Down - November 20, 4:35PM-4:40PM ET","slug":"btc-updown-5m-1795210500","outcome":"Up","outcomeIndex":0,"transactionHash":"0x1387942877a3c7ca9281c120eb79397b8146e82a255845979a9e4d1cf6792a7a"}],"pagination":{"limit":20,"hasMore":true,"nextCursor":"cursor-example"},"unavailable":[]},"nextCursor":null,"progress":{"processed":0,"total":null,"unit":"items","scannedRange":null},"sources":[{"source":"upstream","url":"https://data-api.polymarket.com/v2/trades","retrievedAt":"2026-11-20T21:36:00.000Z"}],"missing_items":[],"limitations":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.008"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/polymarket/leaderboard":{"post":{"operationId":"polymarket_leaderboard","summary":"Polymarket leaderboard","description":"Official Polymarket Data API v2 leaderboard of wallets by PnL and volume, with optional timeframe. Docs: https://www.brainiac.software/api/polymarket/leaderboard","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/leaderboard"},"tags":["polymarket","leaderboard","prediction market","pnl","volume","Data API v2"],"x-keywords":["polymarket","leaderboard","pnl","volume","prediction market","Data API v2"],"x-empty-json-probe":true,"x-probe-body":{"timeframe":"day","limit":10},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"timeframe":{"type":"string","enum":["day","week","month","all"]},"category":{"type":"string","minLength":1,"maxLength":64},"limit":{"default":10,"type":"integer","minimum":1,"maximum":25},"cursor":{"allOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"string","minLength":1,"maxLength":4000}]}},"additionalProperties":false},"example":{"timeframe":"day","limit":10}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"timeframe":{"type":"string"},"leaders":{"type":"array","items":{"type":"object","properties":{"rank":{"type":"number"},"userId":{"type":"string"},"userName":{"type":"string"},"pnl":{"type":"string"},"volume":{"type":"string"},"verified":{"type":"boolean"}},"additionalProperties":true}},"pagination":{"type":"object","properties":{"limit":{"type":"number"},"hasMore":{"type":"boolean"}},"additionalProperties":true},"source":{"type":"string"},"sourceUrl":{"type":"string"},"asOf":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","data":{"timeframe":"day","leaders":[{"rank":1,"userId":"0x2c335066fe58fe9237c3d3dc7b275c2a034a0563","userName":"demo","pnl":"595456.2685383962","volume":"3870941.3891580007","verified":false}],"pagination":{"limit":10,"hasMore":true},"sourceUrl":"https://data-api.polymarket.com/v2/leaderboard","asOf":"2026-11-20T23:20:00.000Z"},"nextCursor":null,"progress":{"processed":0,"total":null,"unit":"items","scannedRange":null},"sources":[],"missing_items":[],"limitations":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0085"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/polymarket/price-history":{"post":{"operationId":"polymarket_price_history","summary":"Polymarket price history","description":"Official Polymarket CLOB historical prices for a market token from the public prices-history API. Docs: https://www.brainiac.software/api/polymarket/price-history","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/price-history"},"tags":["polymarket","price history","odds","prediction market","CLOB","token id"],"x-keywords":["polymarket","price history","odds","CLOB","token id","prediction market"],"x-empty-json-probe":false,"x-probe-body":{"tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","interval":"1d"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tokenId":{"type":"string","minLength":8,"maxLength":120},"conditionId":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"outcome":{"type":"string","minLength":1,"maxLength":64},"interval":{"type":"string","enum":["1m","1h","6h","1d","1w","max"]},"fidelity":{"type":"integer","minimum":1,"maximum":1440},"cursor":{"type":"string","minLength":1,"maxLength":4000}},"additionalProperties":false,"minProperties":1},"example":{"tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","interval":"1d"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"tokenId":{"type":"string"},"interval":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string"},"price":{"type":"string"}},"additionalProperties":true}},"source":{"type":"string"},"sourceUrl":{"type":"string"},"asOf":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","data":{"tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","interval":"1d","history":[{"time":"2026-11-19T12:00:00.000Z","price":"0.0145"},{"time":"2026-11-20T12:00:00.000Z","price":"0.0175"}],"sourceUrl":"https://clob.polymarket.com/prices-history","asOf":"2026-11-20T23:20:00.000Z"},"nextCursor":null,"progress":{"processed":0,"total":null,"unit":"items","scannedRange":null},"sources":[],"missing_items":[],"limitations":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0085"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}},"/api/v1/polymarket/order-book":{"post":{"operationId":"polymarket_order_book","summary":"Polymarket order book","description":"Official Polymarket CLOB order book for a market token: bids and asks with price and size. Docs: https://www.brainiac.software/api/polymarket/order-book","externalDocs":{"url":"https://www.brainiac.software/api/polymarket/order-book"},"tags":["polymarket","order book","CLOB","bids asks","prediction market","bids","asks","depth"],"x-keywords":["polymarket","order book","bids","asks","CLOB","depth"],"x-empty-json-probe":false,"x-probe-body":{"tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","depth":10},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"tokenId":{"type":"string","minLength":8,"maxLength":120},"conditionId":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"outcome":{"type":"string","minLength":1,"maxLength":64},"depth":{"default":10,"type":"integer","minimum":1,"maximum":25}},"additionalProperties":false,"minProperties":1},"example":{"tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","depth":10}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}],"responses":{"200":{"description":"JSON result. A settled 2xx includes payment-response. Settlement is only for HTTP 2xx with status complete or partial and real data; status failed or empty payloads return non-2xx and are not charged.","headers":{"payment-response":{"$ref":"#/components/headers/PaymentResponse"}},"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"tokenId":{"type":"string"},"bids":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string"},"size":{"type":"string"}},"additionalProperties":true}},"asks":{"type":"array","items":{"type":"object","properties":{"price":{"type":"string"},"size":{"type":"string"}},"additionalProperties":true}},"truncated":{"type":"boolean"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"asOf":{"type":"string"},"missing_items":{"type":"array","items":{}}},"additionalProperties":true},"example":{"status":"complete","tokenId":"32338220190071351435772801779725302244575775216413325951443816017994629993401","bids":[{"price":"0.017","size":"10507.64"}],"asks":[{"price":"0.018","size":"7893.67"}],"truncated":true,"source":"Polymarket CLOB","sourceUrl":"https://clob.polymarket.com/book","asOf":"2026-11-20T23:20:00.000Z","missing_items":[]}}}},"400":{"$ref":"#/components/responses/InvalidRequest"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/IdempotencyConflict"},"413":{"$ref":"#/components/responses/RequestTooLarge"},"500":{"$ref":"#/components/responses/OperationFailed"},"502":{"$ref":"#/components/responses/SettlementUnknown"},"503":{"$ref":"#/components/responses/PaymentsUnavailable"}},"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.0085"},"protocols":[{"x402":{"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}],"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402"}}}},"components":{"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":true,"description":"Fresh random 32-byte value encoded as 64 hexadecimal characters. Reuse unchanged only for retries of the same operation and request.","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}},"headers":{"PaymentResponse":{"description":"Present on settled 2xx only. Facilitator settlement receipt for the x402 payment (not present on 4xx/5xx, which are not charged).","schema":{"type":"string"}}},"responses":{"InvalidRequest":{"description":"Invalid JSON or request schema. Not charged (no payment-response). If this 400 is returned before the Idempotency-Key is reserved, the key is not stored — fix the body and you may reuse the key. If an operation-path 400 was stored after a payment-signature was attached, the same key + same body replays it; the same key + a different body returns 409."},"PaymentRequired":{"description":"Payment required. The JSON body is the x402 PaymentRequired object. An unpaid 402 does not store the Idempotency-Key. A 402 after payment-signature releases the key and includes prior-payment-attempt (nonce, settled false|unknown). Not charged; no payment-response. Before re-signing after a post-signature 402, check USDC authorizationState(payer, nonce) on Base."},"IdempotencyConflict":{"description":"Idempotency conflict, in-progress payment, or expired result cache. Same key with a different body after a stored result returns conflict. Reusing the key cannot trigger a second charge. Not charged when settlement did not occur."},"RequestTooLarge":{"description":"Request body exceeds the 24 MB limit. Not charged."},"SettlementUnknown":{"description":"Facilitator verify/settle transport failure (often timeout). After payment-signature this is returned as SETTLEMENT_UNKNOWN with prior-payment-attempt; the outcome is stored under the Idempotency-Key. With the shared store configured, other instances replay it instead of settling again; without it, each instance keeps its own memory. The authorization may already be settled on-chain — do not re-sign until USDC authorizationState(payer, nonce) on Base is false."},"PaymentsUnavailable":{"description":"Payment or retry-safe result storage is unavailable; the operation is not run. Not charged; no payment-response. A 503 after payment-signature releases the Idempotency-Key and includes prior-payment-attempt."},"OperationFailed":{"description":"Operation failed before settlement, so no payment is taken (no payment-response). The error is stored: reuse the same Idempotency-Key and body to retrieve it without paying again. Use a new key for a fresh attempt with a new payment-signature."}},"schemas":{"ApiError":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{}}}}}}}}