{"openapi":"3.1.0","info":{"title":"Kellian Builder Trading API","version":"1.0.0","description":"Browser-safe builder distribution API for self-serve hosted checkout integrations. Server API keys remain server-only; browser flows use publicIntegrationId plus short-lived trade attribution tokens.","contact":{"name":"Kellian Protocol","url":"https://kellian.app"},"termsOfService":"https://kellian.app/legal?tab=developers","license":{"name":"Kellian Proprietary License","url":"https://kellian.app/legal"}},"servers":[{"url":"https://kellian.app/api/builder/v1","description":"Production"},{"url":"/api/builder/v1","description":"Builder Trading API v1"}],"security":[],"paths":{"/integrations":{"post":{"operationId":"postIntegrations","summary":"Create a browser-safe builder integration","tags":["Builder"],"x-permission":"api-key-execute","x-rate-class":"write","x-read-only":false,"x-spend-action":"none","security":[{"apiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuilderIntegrationBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderIntegration"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"get":{"operationId":"getIntegrations","summary":"List builder integrations for the authenticated owner","tags":["Builder"],"x-permission":"api-key-read","x-rate-class":"read","x-read-only":true,"x-spend-action":"none","security":[{"apiKey":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderIntegrationList"}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/integrations/{publicIntegrationId}/verify-origin":{"post":{"operationId":"postIntegrationsByPublicIntegrationIdVerifyOrigin","summary":"Verify ownership of an integration origin","tags":["Builder"],"x-permission":"api-key-execute","x-rate-class":"write","x-read-only":false,"x-spend-action":"none","security":[{"apiKey":[]}],"parameters":[{"in":"path","name":"publicIntegrationId","schema":{"$ref":"#/components/schemas/PublicIntegrationId"},"required":true,"description":"Browser-safe builder integration identifier. This is attribution metadata only, not market-creation authority."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyBuilderIntegrationOriginBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyBuilderIntegrationOriginResponse"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"404":{"description":"Error: one of NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"NOT_FOUND":{"summary":"NOT_FOUND","value":{"type":"https://problee.com/errors/NOT_FOUND","title":"Example NOT_FOUND","status":404,"detail":"Example detail for NOT_FOUND","code":"NOT_FOUND"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/trade-token":{"post":{"operationId":"postTradeToken","summary":"Create a short-lived browser trade attribution token","tags":["Builder"],"x-permission":"none","x-rate-class":"write","x-read-only":false,"x-spend-action":"none","security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuilderTradeTokenBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuilderTradeTokenResponse"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/checkout/sessions":{"post":{"operationId":"postCheckoutSessions","summary":"Create a hosted checkout session","tags":["Builder"],"x-permission":"none","x-rate-class":"write","x-read-only":false,"x-spend-action":"none","security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionBody"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutSessionResponse"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"503":{"description":"Error: one of SERVICE_UNAVAILABLE","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"SERVICE_UNAVAILABLE":{"summary":"SERVICE_UNAVAILABLE","value":{"type":"https://problee.com/errors/SERVICE_UNAVAILABLE","title":"Example SERVICE_UNAVAILABLE","status":503,"detail":"Example detail for SERVICE_UNAVAILABLE","code":"SERVICE_UNAVAILABLE"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/checkout/sessions/{sessionId}":{"get":{"operationId":"getCheckoutSessionsBySessionId","summary":"Get a hosted checkout session","tags":["Builder"],"x-permission":"none","x-rate-class":"read","x-read-only":true,"x-spend-action":"none","security":[],"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string","pattern":"^chk_[a-f0-9]{32}$"},"required":true},{"in":"header","name":"X-Checkout-Session-Token","schema":{"$ref":"#/components/schemas/CheckoutSessionAccessToken"},"required":true,"description":"Opaque checkout session access token returned when the hosted checkout session is created."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"404":{"description":"Error: one of NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"NOT_FOUND":{"summary":"NOT_FOUND","value":{"type":"https://problee.com/errors/NOT_FOUND","title":"Example NOT_FOUND","status":404,"detail":"Example detail for NOT_FOUND","code":"NOT_FOUND"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}},"patch":{"operationId":"patchCheckoutSessionsBySessionId","summary":"Update hosted checkout lifecycle status","tags":["Builder"],"x-permission":"none","x-rate-class":"write","x-read-only":false,"x-spend-action":"none","security":[],"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string","pattern":"^chk_[a-f0-9]{32}$"},"required":true},{"in":"header","name":"X-Checkout-Session-Token","schema":{"$ref":"#/components/schemas/CheckoutSessionAccessToken"},"required":true,"description":"Opaque checkout session access token returned when the hosted checkout session is created."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCheckoutSessionStatusBody"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"403":{"description":"Error: one of FORBIDDEN, WALLET_MISMATCH","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}},"WALLET_MISMATCH":{"summary":"WALLET_MISMATCH","value":{"type":"https://problee.com/errors/WALLET_MISMATCH","title":"Example WALLET_MISMATCH","status":403,"detail":"Example detail for WALLET_MISMATCH","code":"WALLET_MISMATCH"}}}}}},"404":{"description":"Error: one of NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"NOT_FOUND":{"summary":"NOT_FOUND","value":{"type":"https://problee.com/errors/NOT_FOUND","title":"Example NOT_FOUND","status":404,"detail":"Example detail for NOT_FOUND","code":"NOT_FOUND"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/checkout/sessions/{sessionId}/execution-plan":{"get":{"operationId":"getCheckoutSessionsBySessionIdExecutionPlan","summary":"Get a first-party hosted checkout execution plan","tags":["Builder"],"x-permission":"none","x-rate-class":"read","x-read-only":true,"x-spend-action":"none","security":[],"parameters":[{"in":"path","name":"sessionId","schema":{"type":"string","pattern":"^chk_[a-f0-9]{32}$"},"required":true},{"in":"header","name":"X-Checkout-Session-Token","schema":{"$ref":"#/components/schemas/CheckoutSessionAccessToken"},"required":true,"description":"Opaque checkout session access token returned when the hosted checkout session is created."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutExecutionPlan"}}}},"400":{"description":"Error: one of INVALID_PAYLOAD","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_PAYLOAD":{"summary":"INVALID_PAYLOAD","value":{"type":"https://problee.com/errors/INVALID_PAYLOAD","title":"Example INVALID_PAYLOAD","status":400,"detail":"Example detail for INVALID_PAYLOAD","code":"INVALID_PAYLOAD"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"404":{"description":"Error: one of NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"NOT_FOUND":{"summary":"NOT_FOUND","value":{"type":"https://problee.com/errors/NOT_FOUND","title":"Example NOT_FOUND","status":404,"detail":"Example detail for NOT_FOUND","code":"NOT_FOUND"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/markets":{"get":{"operationId":"getMarkets","summary":"List markets originated through builder integrations","tags":["Builder"],"x-permission":"api-key-read","x-rate-class":"read","x-read-only":true,"x-spend-action":"none","security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"publicIntegrationId","schema":{"$ref":"#/components/schemas/PublicIntegrationId"}},{"in":"query","name":"limit","schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1,"maxLength":512}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderOriginatedMarketsResponse"}}}},"400":{"description":"Error: one of INVALID_QUERY","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INVALID_QUERY":{"summary":"INVALID_QUERY","value":{"type":"https://problee.com/errors/INVALID_QUERY","title":"Example INVALID_QUERY","status":400,"detail":"Example detail for INVALID_QUERY","code":"INVALID_QUERY"}}}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"403":{"description":"Error: one of FORBIDDEN","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"FORBIDDEN":{"summary":"FORBIDDEN","value":{"type":"https://problee.com/errors/FORBIDDEN","title":"Example FORBIDDEN","status":403,"detail":"Example detail for FORBIDDEN","code":"FORBIDDEN"}}}}}},"404":{"description":"Error: one of NOT_FOUND","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"NOT_FOUND":{"summary":"NOT_FOUND","value":{"type":"https://problee.com/errors/NOT_FOUND","title":"Example NOT_FOUND","status":404,"detail":"Example detail for NOT_FOUND","code":"NOT_FOUND"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}},"/metrics":{"get":{"operationId":"getMetrics","summary":"Read builder distribution metrics","tags":["Builder"],"x-permission":"api-key-read","x-rate-class":"read","x-read-only":true,"x-spend-action":"none","security":[{"apiKey":[]}],"parameters":[{"in":"query","name":"from","schema":{"$ref":"#/components/schemas/IsoTimestamp"}},{"in":"query","name":"to","schema":{"$ref":"#/components/schemas/IsoTimestamp"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BuilderMetricsResponse"}}}},"401":{"description":"Error: one of AUTH_REQUIRED","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"AUTH_REQUIRED":{"summary":"AUTH_REQUIRED","value":{"type":"https://problee.com/errors/AUTH_REQUIRED","title":"Example AUTH_REQUIRED","status":401,"detail":"Example detail for AUTH_REQUIRED","code":"AUTH_REQUIRED"}}}}}},"500":{"description":"Error: one of INTERNAL_ERROR","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"examples":{"INTERNAL_ERROR":{"summary":"INTERNAL_ERROR","value":{"type":"https://problee.com/errors/INTERNAL_ERROR","title":"Example INTERNAL_ERROR","status":500,"detail":"Example detail for INTERNAL_ERROR","code":"INTERNAL_ERROR"}}}}}},"default":{"description":"Error response (RFC 9457 Problem Details for HTTP APIs)","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"CreateBuilderIntegrationBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"environment":{"$ref":"#/components/schemas/BuilderIntegrationEnvironment"},"allowedOrigins":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"string","format":"uri"}},"allowedChains":{"minItems":1,"maxItems":2,"type":"array","items":{"$ref":"#/components/schemas/ChainId"}},"allowedCollaterals":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":128}},"capabilities":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/BuilderCapability"}},"modeFlags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"rateLimitBucket":{"type":"string","minLength":1,"maxLength":64}},"required":["name","allowedOrigins","allowedChains","allowedCollaterals"]},"BuilderIntegrationEnvironment":{"type":"string","enum":["production","sandbox"]},"ChainId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Compiled protocol release chain ID (Base 8453)."},"BuilderCapability":{"type":"string","enum":["embed:read","checkout:session","checkout:popup","checkout:iframe","metrics:read"]},"PublicIntegrationId":{"type":"string","pattern":"^pub_[a-f0-9]{24,64}$","description":"Browser-safe builder integration identifier. This is attribution metadata only, not market-creation authority."},"VerifyBuilderIntegrationOriginBody":{"type":"object","properties":{"origin":{"type":"string","format":"uri"}},"required":["origin"]},"CreateBuilderTradeTokenBody":{"type":"object","properties":{"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"collateralToken":{"type":"string","minLength":1,"maxLength":128},"expectedWalletAddress":{"$ref":"#/components/schemas/EvmAddress"},"walletProviderHint":{"$ref":"#/components/schemas/BuilderWalletProviderHint"},"capabilities":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/BuilderCapability"}}},"required":["publicIntegrationId","chainId","marketAddress","collateralToken"]},"EvmAddress":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"Checksummed or lowercase 20-byte EVM address (0x + 40 hex)."},"BuilderWalletProviderHint":{"type":"string","enum":["device","metamask","baseapp","walletconnect"]},"CreateCheckoutSessionBody":{"type":"object","properties":{"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"tradeType":{"type":"string","enum":["buy","sell"]},"side":{"$ref":"#/components/schemas/TradeSide"},"amountWei":{"$ref":"#/components/schemas/WeiString"},"collateralToken":{"type":"string","minLength":1,"maxLength":128},"slippageBps":{"type":"integer","minimum":0,"maximum":10000},"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"tradeToken":{"type":"string"},"expectedWalletAddress":{"$ref":"#/components/schemas/EvmAddress"},"walletProviderHint":{"$ref":"#/components/schemas/BuilderWalletProviderHint"},"successUrl":{"type":"string","format":"uri"},"cancelUrl":{"type":"string","format":"uri"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["chainId","marketAddress","tradeType","side","amountWei","collateralToken"]},"TradeSide":{"anyOf":[{"type":"number","const":0},{"type":"number","const":1},{"type":"number","const":2}],"description":"0-indexed on-chain trade side used on `/trade/quote` and `/trade/prepare`. Binary markets accept {0,1} (0=outcome 1, 1=outcome 2); ternary markets accept {0,1,2} (0=outcome 1, 1=outcome 2, 2=outcome 3). Contrast with `ResolutionOutcome`, which is the 1-indexed outcome slot on `/resolve/*` — the indices intentionally do not match because trades are placed against on-chain `outcomeId`s starting at 0 while the resolution layer reports the human-facing 1-indexed slot. `side` = which OUTCOME (0-indexed: 0=outcome1,1=outcome2,2=outcome3), NOT buy/sell. Buy/sell is the direction field (`type`/`tradeType`/`action`/`direction`)."},"WeiString":{"type":"string","pattern":"^\\d+$","description":"Non-negative integer amount in the token's smallest unit (wei for ETH-family tokens; the play-money token PM uses 6). Always read the decimals from the token or market metadata rather than assuming them. Serialized as a base-10 string to avoid JS number precision loss."},"CheckoutSessionAccessToken":{"type":"string","minLength":32,"maxLength":512,"description":"Opaque checkout session access token returned when the hosted checkout session is created."},"UpdateCheckoutSessionStatusBody":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"},"walletAddress":{"$ref":"#/components/schemas/EvmAddress"},"txHash":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$"},"quoteId":{"type":"string","minLength":1,"maxLength":128},"failureCode":{"type":"string","minLength":1,"maxLength":128},"failureReason":{"type":"string","maxLength":512},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["status"]},"CheckoutSessionStatus":{"type":"string","enum":["created","opened","wallet_connected","quoted","approval_required","submitted","mined","indexed","failed","cancelled","expired"]},"IsoTimestamp":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"RFC 3339 date-time with seconds and a UTC offset, e.g. `2026-09-23T14:00:00Z`."},"ProblemDetailsErrorEntry":{"type":"object","properties":{"path":{"type":"string","description":"JSON pointer or dot-path to the offending field."},"message":{"type":"string","description":"Human-readable description of the field error."}},"required":["path","message"]},"MarketCreatedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.created"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"category":{"$ref":"#/components/schemas/MarketCategory"}},"required":["type","id","timestamp","chainId","marketAddress","question","category"]},"MarketCategory":{"type":"string","enum":["CRYPTO","SPORTS","POLITICS","ELECTIONS","FINANCE","TECH","WORLD","ECONOMY","CULTURE","WEATHER","SCIENCE_HEALTH","AI","GAMING","BUSINESS","FASHION","MOVIES_TV","MUSIC","SHOPPING","BEAUTY","TRAVEL","CLIMATE","DAILY_LIFE","LOCAL","SOCIAL","FUN","OTHER"],"x-extensible-enum":true,"description":"The market's arena. Retired names are stored as their successor; OTHER is unfiled. Open enum: tolerate unseen values."},"MarketLiveEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.live"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"creatorAddress":{"$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","question","creatorAddress"],"description":"The market became TRADEABLE — emitted at the mined creation receipt (~2s), not at L1 finality (\"mined means live\"). Distinct from market.created, which is metadata registration. The event wakes; read the market for authoritative state."},"MarketChallengeWindowOpenedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.challengeWindowOpened"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed outcome the creator proposed (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades. 0 means the creator proposed a terminal Invalid / Void resolution, which is challengeable like any other: assert a numbered counter-outcome. Branch on `isVoid` rather than testing for a falsy outcome."},"isVoid":{"description":"True when the creator proposed Invalid / Void (outcome 0) rather than a numbered outcome.","type":"boolean"},"challengeDeadline":{"description":"On-chain deadline to file a dispute (resolutionTime + the 2h challenge window). Present on projection-worker emits.","$ref":"#/components/schemas/IsoTimestamp"},"eligibleAt":{"description":"Absent a dispute, when the payout becomes claim-eligible — the same instant the window closes.","$ref":"#/components/schemas/IsoTimestamp"}},"required":["type","id","timestamp","chainId","marketAddress","outcome"]},"MarketResolutionDueEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.resolution_due"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"resolveBy":{"description":"Past this the creator is MIA: the bond is at risk and the market funnels to the crowd/council backstop.","$ref":"#/components/schemas/IsoTimestamp"},"resolveFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoTimestamp"},{"type":"null"}],"description":"When the creator's resolution authority opened (early resolution is legal from openTime)."},"creatorAddress":{"$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","question","resolveBy","resolveFrom","creatorAddress"]},"MarketResolvedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.resolved"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed winning outcome (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades. 0 means the market resolved Invalid / Void: there is no winning outcome and every share redeems an equal split. Branch on `isVoid` rather than testing for a falsy outcome."},"isVoid":{"description":"True when the market resolved Invalid / Void (outcome 0). Claims stay open.","type":"boolean"}},"required":["type","id","timestamp","chainId","marketAddress","outcome"]},"MarketCancelledEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.cancelled"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"reason":{"type":"string","description":"Machine-stable code, e.g. CREATION_REORGED — the market ceased to exist without an outcome; nothing to claim. Distinct from market.resolved{isVoid}: void is an outcome."},"relocatedTo":{"description":"When a reorg relocated the creation, the address the market lives at now.","$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","reason"]},"MarketControlsChangedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.controlsChanged"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"axis":{"type":"string","enum":["policy","discovery","mutation","interaction"]},"previousState":{"type":["string","null"]},"newState":{"type":"string"},"reasonCode":{"type":["string","null"]},"isTradeable":{"type":"boolean","description":"Recomputed after the edge — the one boolean a quoting agent must obey."}},"required":["type","id","timestamp","chainId","marketAddress","axis","previousState","newState","reasonCode","isTradeable"],"description":"One event for every control-plane edge (halt, unfreeze, takedown cascade, quarantine, graduation, mutation lock) — they all move the two derived booleans an agent cares about, led by isTradeable."},"MarketDisputedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.disputed"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"challenger":{"$ref":"#/components/schemas/EvmAddress"},"counterOutcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed challenger-proposed counter outcome (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades."}},"required":["type","id","timestamp","chainId","marketAddress","challenger","counterOutcome"]},"MarketDisputeFinalizedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.disputeFinalized"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"finalOutcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed outcome the dispute finalized to (matches ResolutionOutcome); 0 = finalized as Invalid / Void."},"creatorSlashed":{"type":"boolean","description":"True when the dispute went against the creator's proposal and the creation bond was slashed (5/20/75 keeper/voter/treasury split). The bond outcome deliberately does NOT ride market.resolved — who was right is settled money, not lifecycle."}},"required":["type","id","timestamp","chainId","marketAddress","finalOutcome","creatorSlashed"]},"MarketVoteOpenedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.voteOpened"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"sessionId":{"type":"string","description":"Voting-session id — the handle the ballot surfaces accept."},"round":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1 on open; 2 when an integrity restart replaced the first session."},"voteDeadline":{"description":"Ballots are refused past this instant.","$ref":"#/components/schemas/IsoTimestamp"}},"required":["type","id","timestamp","chainId","marketAddress","sessionId","round","voteDeadline"],"description":"A human-vote session opened on this market — every path that opens one emits the same event (dispute, absent-creator escalation, integrity-restart replacement), because the subscriber action is identical: judge the market and cast a ballot."},"MarketVoteClosedEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.voteClosed"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"sessionId":{"type":"string"},"verdictKind":{"type":"string","enum":["binding","no_quorum","deadlock","replaced"],"description":"'binding' settles the market; 'no_quorum'/'deadlock' hand it to Council; 'replaced' means an integrity restart killed the session and any ballot cast in it stopped counting."},"outcome":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The binding outcome (1-indexed; 0 = void). Null unless verdictKind is binding."}},"required":["type","id","timestamp","chainId","marketAddress","sessionId","verdictKind","outcome"],"description":"The session stopped accepting ballots. A subscriber parked on the session can act on the verdict — or learn its ballot no longer counts ('replaced')."},"MarketCouncilReviewEvent":{"type":"object","properties":{"type":{"type":"string","const":"market.councilReview"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"phase":{"type":"string","enum":["opened","decided","executed"],"description":"Council has no subscriber action — this is the stop-escalating signal."}},"required":["type","id","timestamp","chainId","marketAddress","phase"],"description":"Council review phase change. Subscribers have no council action; the event says an outcome is coming and escalation can stop."},"NegotiationCounteredEvent":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.countered"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"},"adjustedFields":{"type":"array","items":{"type":"string"}}},"required":["type","id","timestamp","negotiationId","adjustedFields"]},"NegotiationAcceptedEvent":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.accepted"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"}},"required":["type","id","timestamp","negotiationId"]},"NegotiationRejectedEvent":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.rejected"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"},"reason":{"type":"string"}},"required":["type","id","timestamp","negotiationId","reason"]},"NegotiationExpiredEvent":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.expired"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"}},"required":["type","id","timestamp","negotiationId"]},"ErrorReason":{"type":"string","enum":["AUTH_REQUIRED","WALLET_AUTH_REQUIRED","WALLET_AUTH_INVALID","INSUFFICIENT_TIER","FORBIDDEN","FEATURE_DISABLED","SERVICE_UNAVAILABLE_IN_REGION","NOT_ORB_VERIFIED","NOT_AUTHORIZED","NOT_MARKET_CREATOR","CALLER_NOT_CREATOR","AGENT_WALLET_CANNOT_VOTE","WALLET_REQUIRED","EMAIL_NOT_VERIFIED","EMAIL_ALREADY_REGISTERED","WALLET_ADDRESS_MISMATCH","WALLET_PARAM_NOT_ALLOWED","OWNER_ID_MISMATCH","OWNERSHIP_MISMATCH","OWNERSHIP_PROOF_REQUIRED","WALLET_MISMATCH","KEY_LIMIT_REACHED","SCOPE_WIDENING_DENIED","INVALID_REQUEST","INVALID_PAYLOAD","INVALID_QUERY","INVALID_HEADER","MISSING_FIELDS","INVALID_ID","INVALID_SCOPES","INVALID_SPENDING_LIMIT","INVALID_EXPIRES_AT","INVALID_WEBHOOK_URL","WEBHOOK_LIMIT_REACHED","KEY_ALREADY_REVOKED","MARKET_ID_REQUIRED","INVALID_OUTCOME","INVALID_CHAIN","INVALID_COLLATERAL","MISSING_COLLATERAL","INVALID_QUESTION","QUESTION_TOO_LONG","INVALID_SNAPSHOT","BATCH_TOO_LARGE","MAX_DEPTH_EXCEEDED","AMOUNT_ABOVE_MAXIMUM","AMOUNT_BELOW_MINIMUM","AMOUNT_BELOW_MINIMUM_FILL","AMOUNT_NOT_MULTIPLE","PRICE_OFF_TICK","ORDER_EXPIRY_TOO_SOON","BELOW_MINIMUM","OUTCOME_UNKNOWN","NOT_TWO_OUTCOMES","EXPIRY_TOO_SOON","MARKET_UNAVAILABLE","TRADING_ENDED","NO_LIQUIDITY","INSUFFICIENT_BALANCE","PAYLOAD_TOO_LARGE","PRIVATE_MARKET","INVALID_MARKET_REQUIRED","INVALID_MARKET_PAIR","PREFLIGHT_FAILED","PROPOSAL_FAILED","ACCEPT_FAILED","REJECT_FAILED","CONTENT_BLOCKED","SECURITY_RISK_BLOCKED","NO_PENDING_FEES","BAD_REQUEST","CORS_REJECTED","UNSUPPORTED_CHAIN","WORLD_ID_VERIFICATION_FAILED","REVOCATION_REQUIRES_ROOT","RECOVERY_REQUIRES_ROOT","IDENTITY_ALREADY_ENROLLED","RECOVERY_NOT_CONFIGURED","RECOVERY_KEY_INVALID","WORLD_ID_REVERIFICATION_REQUIRED","ROOT_RECOVERY_COOLDOWN","NOT_FOUND","MARKET_NOT_FOUND","MARKET_PRIOR_RELEASE","AGENT_NOT_FOUND","CHAIN_NOT_FOUND","PARENT_NOT_FOUND","FACTORY_NOT_DEPLOYED","KEY_NOT_FOUND","API_KEY_NOT_FOUND","WEBHOOK_NOT_FOUND","BUILDER_ID_NOT_FOUND","NO_API_KEYS","SEASON_NOT_FOUND","COHORT_NOT_FOUND","MARKET_CLOSED","MARKET_NOT_OPEN_YET","NOT_RESOLVABLE_YET","EXPIRED_TOKEN","ENDPOINT_RETIRED","CONFLICT","HEARTBEAT_SESSION_CONFLICT","HEARTBEAT_SESSION_REVISION_EXHAUSTED","SEASON_STATE_CONFLICT","MARKET_NOT_LIVE","MARKET_NOT_RESOLVED","CONTENT_SEALED","TIMING_SEALED","STALE_UPDATE","ALREADY_RESOLVED","CREATOR_WINDOW_ELAPSED","RELAY_REVERTED","HUMAN_VOTE_ACTIVE","CHALLENGE_WINDOW_CLOSED","COUNCIL_REVIEW_ACTIVE","MARKET_NOT_PENDING_RESOLUTION","ALREADY_SWEPT","SWEEP_IN_PROGRESS","DUPLICATE_CONTENT","AGENT_ALREADY_EXISTS","NAME_TAKEN","AMBIGUOUS_MARKET_ADDRESS","IDEMPOTENCY_KEY_CONFLICT","NONCE_REUSED","KEY_GENERATION_CONFLICT","MARKET_INSOLVENT","SLIPPAGE_EXCEEDED","INSUFFICIENT_ALLOWANCE","OPERATOR_APPROVAL_REQUIRED","INSUFFICIENT_DEPOSIT","INSUFFICIENT_PULL","SALE_PAUSED","SALE_INVENTORY_SHORT","QUOTE_MISMATCH","INSUFFICIENT_PAYMENT_BALANCE","PURCHASE_NOT_A_BUNDLE","PURCHASE_CAP_EXCEEDED","FILL_ALLOWANCE_EXHAUSTED","SPONSORED_TRADING_PAUSED","PASSKEY_REQUIRED","ACCOUNT_RESTRICTED","NOT_VERIFIED","STAKE_REQUIRED","STAKE_INTENT_INVALID","INSUFFICIENT_PM_FOR_VOTE_STAKE","STAKE_PULL_FAILED","VERIFIED_HUMAN_REQUIRED","CREATION_SLOTS_FULL","CREATOR_NOT_ADMITTED","CREATOR_CAPACITY_REACHED","REPUTATION_TOO_LOW","CONCURRENT_LIMIT_REACHED","LIFETIME_LIMIT_REACHED","CREATION_COOLDOWN_ACTIVE","SEED_LIMIT_EXCEEDED","DURATION_OUT_OF_RANGE","ACTIVE_VERIFIED_IDENTITY_REQUIRED","CURRENT_IDENTITY_MEMBERSHIP_REQUIRED","AGENT_OPERATING_WALLET_NOT_LINKED","IDENTITY_INTEGRITY_UNKNOWN","PARTICIPATION_RELEASE_NOT_DEPLOYED","PARTICIPATION_RELEASE_ROUTE_NOT_DEPLOYED","PARTICIPATION_PROFILE_MISMATCH","PARTICIPATION_RELEASE_INACTIVE","PARTICIPATION_DISTRIBUTION_PAUSED","PARTICIPATION_MONEY_PATH_INCOMPLETE","PARTICIPATION_LEDGER_ACCOUNTING_INVALID","PARTICIPATION_ROUTE_DEGRADED","PARTICIPATION_ROUTE_QUARANTINED","PARTICIPATION_INVENTORY_LOW","NO_PARTICIPATION_RELEASE_CREDITS","NEW_PARTICIPATION_RELEASE_UNITS_EXHAUSTED","PARTICIPATION_CLAIM_CADENCE_ACTIVE","PARTICIPATION_IDENTITY_ATTESTATION_REQUIRED","PARTICIPATION_DISTRIBUTION_ZERO_DELTA","PARTICIPATION_DISTRIBUTION_ALREADY_PREPARED","PARTICIPATION_DISTRIBUTION_RECIPIENT_STALE","PARTICIPATION_DISTRIBUTION_VOUCHER_EXPIRED","PARTICIPATION_DISTRIBUTION_EVENT_MISMATCH","PARTICIPATION_DISTRIBUTION_FINALITY_PENDING","RATE_LIMITED","INTERNAL_ERROR","SERVICE_UNAVAILABLE","ELIGIBILITY_UNDETERMINED","COLLATERAL_CONFIGURATION_MISMATCH","QUOTE_STATE_UNAVAILABLE","PROTOCOL_UNAVAILABLE","PROTOCOL_PAUSED","VENUE_HALTED","EMBED_ATTRIBUTION_UNAVAILABLE","QUOTE_FAILED","INVALID_MARKET_STATE","MATH_OVERFLOW","UNKNOWN_CONTRACT_ERROR","DEADLINE_EXPIRED","ZERO_INPUT","ZERO_NET_INPUT","ZERO_DELTA","INVALID_MARKET","INVALID_TOKEN","NATIVE_ROUTE_UNAVAILABLE","POST_ONLY_WOULD_CROSS","FOK_UNFILLABLE","CLORDID_CONFLICT","QUOTE_SET_INVALID","QUOTE_GENERATION_STALE","ORDER_IN_FLIGHT","MAKER_NOT_EXECUTABLE","LIQUIDITY_CHANGED","CANCELLATION_EVENT_NOT_FOUND","CANCELLATION_EVENT_MISMATCH","INVALID_NONCE_FLOOR","NONCE_INVALIDATION_EVENT_NOT_FOUND","NONCE_INVALIDATION_EVENT_MISMATCH","INVALID_TX_HASH"],"x-extensible-enum":true,"description":"Stable, machine-readable reason code. Clients branch on this field, not on `title` or `detail`. This enum is OPEN: new reasons are added over time as additive changes, so a client must tolerate a value it has not seen rather than failing to decode the response. Reasons are never removed or renamed without the deprecation notice the API stability contract requires."},"BuilderIntegration":{"type":"object","properties":{"id":{"type":"string"},"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"builderId":{"$ref":"#/components/schemas/BuilderId"},"ownerId":{"anyOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"null"}]},"apiKeyId":{"type":["string","null"]},"name":{"type":"string"},"environment":{"$ref":"#/components/schemas/BuilderIntegrationEnvironment"},"allowedOrigins":{"minItems":1,"type":"array","items":{"type":"string","format":"uri"}},"verifiedOrigins":{"type":"array","items":{"type":"string","format":"uri"}},"originVerificationStatus":{"$ref":"#/components/schemas/BuilderOriginVerificationStatus"},"allowedChains":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/ChainId"}},"allowedCollaterals":{"minItems":1,"type":"array","items":{"type":"string"}},"capabilities":{"type":"array","items":{"$ref":"#/components/schemas/BuilderCapability"}},"modeFlags":{"type":"array","items":{"type":"string"}},"rateLimitBucket":{"type":"string"},"status":{"$ref":"#/components/schemas/BuilderIntegrationStatus"},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"updatedAt":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["id","publicIntegrationId","builderId","ownerId","apiKeyId","name","environment","allowedOrigins","verifiedOrigins","originVerificationStatus","allowedChains","allowedCollaterals","capabilities","modeFlags","rateLimitBucket","status","createdAt","updatedAt"],"additionalProperties":false},"BuilderId":{"type":"string","minLength":1,"maxLength":128},"BuilderOriginVerificationStatus":{"type":"string","enum":["pending","verified","failed"]},"BuilderIntegrationStatus":{"type":"string","enum":["active","paused","revoked"]},"BuilderIntegrationList":{"type":"array","items":{"$ref":"#/components/schemas/BuilderIntegration"}},"VerifyBuilderIntegrationOriginResponse":{"type":"object","properties":{"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"origin":{"type":"string","format":"uri"},"verified":{"type":"boolean"},"method":{"type":"string","enum":["well-known","dns","none"]},"checkedAt":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["publicIntegrationId","origin","verified","method","checkedAt"],"additionalProperties":false},"CreateBuilderTradeTokenResponse":{"type":"object","properties":{"token":{"type":"string"},"expiresAt":{"$ref":"#/components/schemas/IsoTimestamp"},"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"builderId":{"$ref":"#/components/schemas/BuilderId"}},"required":["token","expiresAt","publicIntegrationId","builderId"],"additionalProperties":false},"CreateCheckoutSessionResponse":{"type":"object","properties":{"sessionId":{"type":"string"},"checkoutAccessToken":{"$ref":"#/components/schemas/CheckoutSessionAccessToken"},"checkoutUrl":{"type":"string","format":"uri"},"expiresAt":{"$ref":"#/components/schemas/IsoTimestamp"},"builderId":{"$ref":"#/components/schemas/BuilderId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"chainId":{"$ref":"#/components/schemas/ChainId"}},"required":["sessionId","checkoutAccessToken","checkoutUrl","expiresAt","builderId","marketAddress","chainId"],"additionalProperties":false},"CheckoutSession":{"type":"object","properties":{"sessionId":{"type":"string"},"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"},"builderId":{"$ref":"#/components/schemas/BuilderId"},"publicIntegrationId":{"anyOf":[{"$ref":"#/components/schemas/PublicIntegrationId"},{"type":"null"}]},"origin":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"tradeType":{"type":"string","enum":["buy","sell"]},"side":{"$ref":"#/components/schemas/TradeSide"},"amountWei":{"$ref":"#/components/schemas/WeiString"},"collateralToken":{"type":"string"},"outcomeTokenAddress":{"type":"string","pattern":"^0x[0-9a-f]{40}$"},"slippageBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"successUrl":{"type":["string","null"]},"cancelUrl":{"type":["string","null"]},"expectedWalletAddress":{"anyOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"null"}]},"walletProviderHint":{"anyOf":[{"$ref":"#/components/schemas/BuilderWalletProviderHint"},{"type":"null"}]},"walletAddress":{"anyOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"null"}]},"txHash":{"type":["string","null"]},"minedBlockNumber":{"type":["string","null"]},"minedAt":{"anyOf":[{"$ref":"#/components/schemas/IsoTimestamp"},{"type":"null"}]},"quoteId":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureReason":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"execution":{"$ref":"#/components/schemas/CheckoutExecutionConstraints"},"events":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSessionEvent"}},"expiresAt":{"$ref":"#/components/schemas/IsoTimestamp"},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"updatedAt":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["sessionId","status","builderId","publicIntegrationId","origin","chainId","marketAddress","tradeType","side","amountWei","collateralToken","slippageBps","successUrl","cancelUrl","expectedWalletAddress","walletProviderHint","walletAddress","txHash","quoteId","failureCode","failureReason","metadata","execution","events","expiresAt","createdAt","updatedAt"],"additionalProperties":false},"CheckoutExecutionConstraints":{"type":"object","properties":{"mode":{"type":"string","const":"hosted_checkout"},"walletSigning":{"type":"string","const":"user_controlled"},"approvalPolicy":{"type":"string","const":"router_allowance_or_erc1155_operator"},"allowedChains":{"type":"array","items":{"$ref":"#/components/schemas/ChainId"}},"allowedCollaterals":{"type":"array","items":{"type":"string"}}},"required":["mode","walletSigning","approvalPolicy","allowedChains","allowedCollaterals"],"additionalProperties":false},"CheckoutSessionEvent":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"},"walletAddress":{"anyOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"null"}]},"txHash":{"type":["string","null"]},"quoteId":{"type":["string","null"]},"failureCode":{"type":["string","null"]},"failureReason":{"type":["string","null"]},"metadata":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["id","status","walletAddress","txHash","quoteId","failureCode","failureReason","metadata","createdAt"],"additionalProperties":false},"CheckoutExecutionPlan":{"type":"object","properties":{"sessionId":{"type":"string"},"status":{"$ref":"#/components/schemas/CheckoutSessionStatus"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"tradeType":{"type":"string","enum":["buy","sell"]},"side":{"$ref":"#/components/schemas/TradeSide"},"amountWei":{"$ref":"#/components/schemas/WeiString"},"collateralToken":{"type":"string"},"outcomeTokenAddress":{"type":"string","pattern":"^0x[0-9a-f]{40}$"},"slippageBps":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"successUrl":{"type":["string","null"]},"cancelUrl":{"type":["string","null"]},"expectedWalletAddress":{"anyOf":[{"$ref":"#/components/schemas/EvmAddress"},{"type":"null"}]},"walletProviderHint":{"anyOf":[{"$ref":"#/components/schemas/BuilderWalletProviderHint"},{"type":"null"}]},"execution":{"$ref":"#/components/schemas/CheckoutExecutionConstraints"}},"required":["sessionId","status","chainId","marketAddress","tradeType","side","amountWei","collateralToken","slippageBps","successUrl","cancelUrl","expectedWalletAddress","walletProviderHint","execution"],"additionalProperties":false},"BuilderOriginatedMarketsResponse":{"type":"object","properties":{"markets":{"type":"array","items":{"$ref":"#/components/schemas/BuilderOriginatedMarket"}},"nextCursor":{"type":["string","null"]}},"required":["markets","nextCursor"],"additionalProperties":false},"BuilderOriginatedMarket":{"type":"object","properties":{"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"marketId":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"question":{"type":["string","null"]},"marketState":{"anyOf":[{"$ref":"#/components/schemas/MarketState"},{"type":"null"}]},"creatorAddress":{"$ref":"#/components/schemas/EvmAddress"},"publicIntegrationId":{"$ref":"#/components/schemas/PublicIntegrationId"},"externalId":{"type":["string","null"]},"agentId":{"type":["string","null"]},"originKind":{"type":"string"},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["chainId","marketAddress","marketId","question","marketState","creatorAddress","publicIntegrationId","externalId","agentId","originKind","createdAt"],"additionalProperties":false},"MarketState":{"type":"string","enum":["open","closed","creator_proposal","challenge","human_voting","council_review","resolved","void"],"description":"Canonical market state shared by every protocol surface."},"BuilderMetricsResponse":{"type":"object","properties":{"builderId":{"$ref":"#/components/schemas/BuilderId"},"period":{"type":"object","properties":{"from":{"$ref":"#/components/schemas/IsoTimestamp"},"to":{"$ref":"#/components/schemas/IsoTimestamp"}},"required":["from","to"],"additionalProperties":false},"totals":{"type":"object","properties":{"embedLoads":{"type":"integer","minimum":0,"maximum":9007199254740991},"apiCalls":{"type":"integer","minimum":0,"maximum":9007199254740991},"tradesRouted":{"type":"integer","minimum":0,"maximum":9007199254740991},"volumeRouted":{"$ref":"#/components/schemas/WeiString"},"uniqueWallets":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["embedLoads","apiCalls","tradesRouted","volumeRouted","uniqueWallets"],"additionalProperties":false},"checkout":{"type":"object","properties":{"sessionsCreated":{"type":"integer","minimum":0,"maximum":9007199254740991},"opened":{"type":"integer","minimum":0,"maximum":9007199254740991},"walletConnected":{"type":"integer","minimum":0,"maximum":9007199254740991},"quoted":{"type":"integer","minimum":0,"maximum":9007199254740991},"approvalRequired":{"type":"integer","minimum":0,"maximum":9007199254740991},"submitted":{"type":"integer","minimum":0,"maximum":9007199254740991},"indexed":{"type":"integer","minimum":0,"maximum":9007199254740991},"failed":{"type":"integer","minimum":0,"maximum":9007199254740991},"cancelled":{"type":"integer","minimum":0,"maximum":9007199254740991},"expired":{"type":"integer","minimum":0,"maximum":9007199254740991},"quoteToSubmitRatio":{"type":"number","minimum":0},"submitToIndexRatio":{"type":"number","minimum":0},"volumeByIntegration":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"failureCodes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["code","count"],"additionalProperties":false}},"walletProviderHints":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["sessionsCreated","opened","walletConnected","quoted","approvalRequired","submitted","indexed","failed","cancelled","expired","quoteToSubmitRatio","submitToIndexRatio","volumeByIntegration","failureCodes","walletProviderHints"],"additionalProperties":false},"daily":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["builderId","period","totals","checkout","daily"],"additionalProperties":false},"ProblemDetails":{"type":"object","properties":{"type":{"default":"about:blank","description":"URI that identifies the problem type. Kellian emits `https://problee.com/errors/<code>` per RFC 9457 §3.1; `about:blank` is still accepted for backward-compatible clients.","type":"string"},"title":{"type":"string","description":"Short, human-readable summary — stable per problem type."},"status":{"type":"integer","minimum":100,"maximum":599,"description":"HTTP status code for this response (duplicate of HTTP status line)."},"detail":{"description":"Human-readable explanation specific to this occurrence.","type":"string"},"instance":{"description":"URI identifying this specific occurrence (request path).","type":"string"},"code":{"$ref":"#/components/schemas/ErrorReason"},"requestId":{"description":"Correlation ID — echo of X-Request-Id header if provided, else server-generated.","type":"string"},"errors":{"description":"Field-level validation errors; present on 400 INVALID_PAYLOAD responses.","type":"array","items":{"$ref":"#/components/schemas/ProblemDetailsErrorEntryOutput"}}},"required":["type","title","status","code"],"additionalProperties":{},"description":"RFC 9457 Problem Details error envelope. Sent with Content-Type: application/problem+json. Additional top-level keys are permitted per RFC 9457 §3.2."},"ProblemDetailsErrorEntryOutput":{"type":"object","properties":{"path":{"type":"string","description":"JSON pointer or dot-path to the offending field."},"message":{"type":"string","description":"Human-readable description of the field error."}},"required":["path","message"],"additionalProperties":false},"MarketCreatedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.created"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"category":{"$ref":"#/components/schemas/MarketCategory"}},"required":["type","id","timestamp","chainId","marketAddress","question","category"],"additionalProperties":false},"MarketLiveEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.live"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"creatorAddress":{"$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","question","creatorAddress"],"additionalProperties":false,"description":"The market became TRADEABLE — emitted at the mined creation receipt (~2s), not at L1 finality (\"mined means live\"). Distinct from market.created, which is metadata registration. The event wakes; read the market for authoritative state."},"MarketChallengeWindowOpenedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.challengeWindowOpened"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed outcome the creator proposed (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades. 0 means the creator proposed a terminal Invalid / Void resolution, which is challengeable like any other: assert a numbered counter-outcome. Branch on `isVoid` rather than testing for a falsy outcome."},"isVoid":{"description":"True when the creator proposed Invalid / Void (outcome 0) rather than a numbered outcome.","type":"boolean"},"challengeDeadline":{"description":"On-chain deadline to file a dispute (resolutionTime + the 2h challenge window). Present on projection-worker emits.","$ref":"#/components/schemas/IsoTimestamp"},"eligibleAt":{"description":"Absent a dispute, when the payout becomes claim-eligible — the same instant the window closes.","$ref":"#/components/schemas/IsoTimestamp"}},"required":["type","id","timestamp","chainId","marketAddress","outcome"],"additionalProperties":false},"MarketResolutionDueEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.resolution_due"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"question":{"type":"string"},"resolveBy":{"description":"Past this the creator is MIA: the bond is at risk and the market funnels to the crowd/council backstop.","$ref":"#/components/schemas/IsoTimestamp"},"resolveFrom":{"anyOf":[{"$ref":"#/components/schemas/IsoTimestamp"},{"type":"null"}],"description":"When the creator's resolution authority opened (early resolution is legal from openTime)."},"creatorAddress":{"$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","question","resolveBy","resolveFrom","creatorAddress"],"additionalProperties":false},"MarketResolvedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.resolved"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"outcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed winning outcome (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades. 0 means the market resolved Invalid / Void: there is no winning outcome and every share redeems an equal split. Branch on `isVoid` rather than testing for a falsy outcome."},"isVoid":{"description":"True when the market resolved Invalid / Void (outcome 0). Claims stay open.","type":"boolean"}},"required":["type","id","timestamp","chainId","marketAddress","outcome"],"additionalProperties":false},"MarketCancelledEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.cancelled"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"reason":{"type":"string","description":"Machine-stable code, e.g. CREATION_REORGED — the market ceased to exist without an outcome; nothing to claim. Distinct from market.resolved{isVoid}: void is an outcome."},"relocatedTo":{"description":"When a reorg relocated the creation, the address the market lives at now.","$ref":"#/components/schemas/EvmAddress"}},"required":["type","id","timestamp","chainId","marketAddress","reason"],"additionalProperties":false},"MarketControlsChangedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.controlsChanged"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"axis":{"type":"string","enum":["policy","discovery","mutation","interaction"]},"previousState":{"type":["string","null"]},"newState":{"type":"string"},"reasonCode":{"type":["string","null"]},"isTradeable":{"type":"boolean","description":"Recomputed after the edge — the one boolean a quoting agent must obey."}},"required":["type","id","timestamp","chainId","marketAddress","axis","previousState","newState","reasonCode","isTradeable"],"additionalProperties":false,"description":"One event for every control-plane edge (halt, unfreeze, takedown cascade, quarantine, graduation, mutation lock) — they all move the two derived booleans an agent cares about, led by isTradeable."},"MarketDisputedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.disputed"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"challenger":{"$ref":"#/components/schemas/EvmAddress"},"counterOutcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed challenger-proposed counter outcome (1=outcome1, 2=outcome2, 3=outcome3 ternary) — matches ResolutionOutcome; NOT the 0-indexed TradeSide used by trades."}},"required":["type","id","timestamp","chainId","marketAddress","challenger","counterOutcome"],"additionalProperties":false},"MarketDisputeFinalizedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.disputeFinalized"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"finalOutcome":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1-indexed outcome the dispute finalized to (matches ResolutionOutcome); 0 = finalized as Invalid / Void."},"creatorSlashed":{"type":"boolean","description":"True when the dispute went against the creator's proposal and the creation bond was slashed (5/20/75 keeper/voter/treasury split). The bond outcome deliberately does NOT ride market.resolved — who was right is settled money, not lifecycle."}},"required":["type","id","timestamp","chainId","marketAddress","finalOutcome","creatorSlashed"],"additionalProperties":false},"MarketVoteOpenedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.voteOpened"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"sessionId":{"type":"string","description":"Voting-session id — the handle the ballot surfaces accept."},"round":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"1 on open; 2 when an integrity restart replaced the first session."},"voteDeadline":{"description":"Ballots are refused past this instant.","$ref":"#/components/schemas/IsoTimestamp"}},"required":["type","id","timestamp","chainId","marketAddress","sessionId","round","voteDeadline"],"additionalProperties":false,"description":"A human-vote session opened on this market — every path that opens one emits the same event (dispute, absent-creator escalation, integrity-restart replacement), because the subscriber action is identical: judge the market and cast a ballot."},"MarketVoteClosedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.voteClosed"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"sessionId":{"type":"string"},"verdictKind":{"type":"string","enum":["binding","no_quorum","deadlock","replaced"],"description":"'binding' settles the market; 'no_quorum'/'deadlock' hand it to Council; 'replaced' means an integrity restart killed the session and any ballot cast in it stopped counting."},"outcome":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The binding outcome (1-indexed; 0 = void). Null unless verdictKind is binding."}},"required":["type","id","timestamp","chainId","marketAddress","sessionId","verdictKind","outcome"],"additionalProperties":false,"description":"The session stopped accepting ballots. A subscriber parked on the session can act on the verdict — or learn its ballot no longer counts ('replaced')."},"MarketCouncilReviewEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"market.councilReview"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"chainId":{"$ref":"#/components/schemas/ChainId"},"marketAddress":{"$ref":"#/components/schemas/EvmAddress"},"phase":{"type":"string","enum":["opened","decided","executed"],"description":"Council has no subscriber action — this is the stop-escalating signal."}},"required":["type","id","timestamp","chainId","marketAddress","phase"],"additionalProperties":false,"description":"Council review phase change. Subscribers have no council action; the event says an outcome is coming and escalation can stop."},"NegotiationCounteredEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.countered"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"},"adjustedFields":{"type":"array","items":{"type":"string"}}},"required":["type","id","timestamp","negotiationId","adjustedFields"],"additionalProperties":false},"NegotiationAcceptedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.accepted"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"}},"required":["type","id","timestamp","negotiationId"],"additionalProperties":false},"NegotiationRejectedEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.rejected"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"},"reason":{"type":"string"}},"required":["type","id","timestamp","negotiationId","reason"],"additionalProperties":false},"NegotiationExpiredEventOutput":{"type":"object","properties":{"type":{"type":"string","const":"negotiation.expired"},"id":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/IsoTimestamp"},"negotiationId":{"type":"string"}},"required":["type","id","timestamp","negotiationId"],"additionalProperties":false},"AgentWsEvent":{"oneOf":[{"$ref":"#/components/schemas/MarketCreatedEventOutput"},{"$ref":"#/components/schemas/MarketLiveEventOutput"},{"$ref":"#/components/schemas/MarketChallengeWindowOpenedEventOutput"},{"$ref":"#/components/schemas/MarketResolutionDueEventOutput"},{"$ref":"#/components/schemas/MarketResolvedEventOutput"},{"$ref":"#/components/schemas/MarketCancelledEventOutput"},{"$ref":"#/components/schemas/MarketControlsChangedEventOutput"},{"$ref":"#/components/schemas/MarketDisputedEventOutput"},{"$ref":"#/components/schemas/MarketDisputeFinalizedEventOutput"},{"$ref":"#/components/schemas/MarketVoteOpenedEventOutput"},{"$ref":"#/components/schemas/MarketVoteClosedEventOutput"},{"$ref":"#/components/schemas/MarketCouncilReviewEventOutput"},{"$ref":"#/components/schemas/NegotiationCounteredEventOutput"},{"$ref":"#/components/schemas/NegotiationAcceptedEventOutput"},{"$ref":"#/components/schemas/NegotiationRejectedEventOutput"},{"$ref":"#/components/schemas/NegotiationExpiredEventOutput"}],"description":"Source-backed Agent WebSocket event. Discriminated by `type`; only the event variants available for subscription today are included. Kept in lockstep with the subscribable entries of AGENT_EVENT_REGISTRY by test.","type":"object","discriminator":{"propertyName":"type","mapping":{"market.created":"#/components/schemas/MarketCreatedEventOutput","market.live":"#/components/schemas/MarketLiveEventOutput","market.challengeWindowOpened":"#/components/schemas/MarketChallengeWindowOpenedEventOutput","market.resolution_due":"#/components/schemas/MarketResolutionDueEventOutput","market.resolved":"#/components/schemas/MarketResolvedEventOutput","market.cancelled":"#/components/schemas/MarketCancelledEventOutput","market.controlsChanged":"#/components/schemas/MarketControlsChangedEventOutput","market.disputed":"#/components/schemas/MarketDisputedEventOutput","market.disputeFinalized":"#/components/schemas/MarketDisputeFinalizedEventOutput","market.voteOpened":"#/components/schemas/MarketVoteOpenedEventOutput","market.voteClosed":"#/components/schemas/MarketVoteClosedEventOutput","market.councilReview":"#/components/schemas/MarketCouncilReviewEventOutput","negotiation.countered":"#/components/schemas/NegotiationCounteredEventOutput","negotiation.accepted":"#/components/schemas/NegotiationAcceptedEventOutput","negotiation.rejected":"#/components/schemas/NegotiationRejectedEventOutput","negotiation.expired":"#/components/schemas/NegotiationExpiredEventOutput"}}},"CreatorContentEnvelope":{"type":"object","properties":{"renderer":{"type":"string","minLength":1,"maxLength":128,"description":"Free-form renderer identifier. Not validated against a closed list."},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Renderer-specific data (max 4096 bytes once JSON-serialized). Opaque to the protocol."},"label":{"description":"Optional display label","type":"string","maxLength":200},"timestamp":{"description":"Unix ms (defaults to server time)","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["renderer","data"],"additionalProperties":false,"description":"Opaque content envelope forwarded by the protocol and retained only as ephemeral live state."}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Server-side builder API key. Never expose this in browser code."}}}}