{"openapi":"3.1.0","info":{"title":"AlgoTerminal","version":"1.0.0","description":"Standardized, agent-native financial KPIs for Algorand DeFi.\nPaid per query in USDC over x402 (Algorand MainNet, GoPlausible facilitator).\nMethodology published at https://api-production-36692.up.railway.app/methodology.\nPayment settles only after a 2xx. Errors are never charged.","license":{"name":"MIT","identifier":"MIT"},"x-x402":{"version":2,"scheme":"exact","network":"algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=","asset":"31566704","asset_decimals":6,"facilitator":"https://facilitator.goplausible.xyz","payTo":"36AZ3YZGHLUFFVU4STAQGSQMRB2W3TK5VVTKZVN6L2LH7NRCK7X27TMEJM","fee_sponsored":true,"settlement_policy":"Payment is settled only after a 2xx response. Every 4xx and 5xx is free."},"x-methodology-version":"1.2.0"},"servers":[{"url":"https://api-production-36692.up.railway.app","description":"MainNet — paid in real USDC (ASA 31566704). This deployment."},{"url":"https://testnet.algoterminal.xyz","description":"TestNet — identical API, TestNet USDC."}],"paths":{"/health":{"get":{"operationId":"getHealth","summary":"Liveness and dependency status","description":"Free, never gated, and never dependent on the payment facilitator being reachable.","responses":{"200":{"description":"Service status, connector probes, cache and facilitator health."},"503":{"description":"Unhealthy: a dependency required to serve paid traffic is down."}},"x-paid":false}},"/catalog":{"get":{"operationId":"getCatalog","summary":"What we sell, and what it costs","description":"Capability discovery. `protocols[]` is generated by iterating the connector registry, so it is structurally impossible to advertise a KPI no connector implements.","responses":{"200":{"description":"Service, payment block, protocols and priced routes."}},"x-paid":false}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"This document","description":"Generated from the same zod schemas that validate requests and the same price table the payment middleware charges from.","responses":{"200":{"description":"This OpenAPI 3.1 document."}},"x-paid":false}},"/llms.txt":{"get":{"operationId":"getLlmsTxt","summary":"Agent-facing description (llmstxt.org)","responses":{"200":{"description":"Markdown.","content":{"text/plain":{"schema":{"type":"string"}}}}},"x-paid":false}},"/methodology":{"get":{"operationId":"getMethodology","summary":"The published accounting policy","description":"DATA_SCHEMA.md, in two renderings. JSON by default — the KPI registry, the confidence ladder and the per-connector policy as data an agent can branch on. `?format=markdown` (or `Accept: text/markdown`) returns the document itself. `/ask` cites this route.","parameters":[{"name":"format","in":"query","required":false,"description":"json (default) is the structured rendering; markdown is the source document.","schema":{"type":"string","enum":["json","markdown"],"default":"json"}}],"responses":{"200":{"description":"The accounting policy.","content":{"application/json":{"schema":{"type":"object"}},"text/markdown":{"schema":{"type":"string"}}}}},"x-paid":false}},"/schema/kpi-fact.json":{"get":{"operationId":"getKpiFactSchema","summary":"The KpiFact envelope as JSON Schema","description":"The envelope every number arrives in, as a self-contained JSON Schema draft 2020-12 document, stamped `x-methodology-version`. Free. Generate types from it in any language, or validate a response before acting on it — including the cross-field rules the components block below cannot carry: a null value is legal only beside an error, and an estimate always names its estimation_method. It is a contract artefact, not a client library. DATA_SCHEMA.md §7 governs what a version bump may change it.","responses":{"200":{"description":"The KpiFact JSON Schema.","content":{"application/schema+json":{"schema":{"type":"object"}}}}},"x-paid":false}},"/metric/{protocol}/{kpi}":{"get":{"operationId":"getMetric","summary":"One standardized KPI for one protocol","parameters":[{"name":"protocol","in":"path","required":true,"description":"Protocol id, as listed at /catalog.","schema":{"type":"string","enum":["folks","pact","tinyman"]},"example":"tinyman"},{"name":"kpi","in":"path","required":true,"description":"KPI id, as listed at /catalog and defined in DATA_SCHEMA.md §4.","schema":{"type":"string","enum":["tvl","volume_24h","gross_fees_24h","supply_side_revenue_24h","protocol_revenue_24h","take_rate","capital_efficiency","fee_apr","volume_to_tvl","supply_apr","borrow_apr","utilization","total_borrows","active_users_24h","pool_count"]},"example":"capital_efficiency"},{"name":"fresh","in":"query","required":false,"description":"Bypass L0/L1 and force an upstream fetch. Priced higher. NOT CHARGED if we cannot produce a non-stale number — recency is what the tier buys.","schema":{"type":"string","enum":["true","false"],"default":"false"}},{"name":"basis","in":"query","required":false,"description":"Inclusion basis (DATA_SCHEMA.md §3.6). A protocol that does not implement the requested basis returns 400 INVALID_PARAM listing the ones it does — it never silently substitutes the default, which would return a different number than the one asked for.","schema":{"type":"string","enum":["all_pools_usd_priced","verified_only"],"default":"all_pools_usd_priced"}}],"responses":{"200":{"description":"One KpiFact.","headers":{"X-AlgoTerminal-Cache":{"schema":{"type":"string","enum":["hit","miss","stale"]},"description":"Cache state of this response. On a composite, the WORST state across its parts."},"X-AlgoTerminal-Methodology":{"schema":{"type":"string"},"description":"The methodology_version this number was computed under."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KpiFact"}}}},"400":{"description":"INVALID_PARAM — unknown basis, or one this protocol does not support. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment required. `PAYMENT-REQUIRED` carries the base64 v2 payment requirements; the body restates price, resource and description in plain JSON.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 v2 payment requirements."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"404":{"description":"PROTOCOL_NOT_FOUND, KPI_NOT_FOUND, or KPI_NOT_APPLICABLE (including a KPI this protocol deliberately declines, with the reason). NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"PAYMENT_REPLAYED — this payment txid has already been recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"UPSTREAM_UNAVAILABLE — every tier exhausted, or the best answer sits at the 0.40 confidence floor and its error can no longer be bounded. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"FACILITATOR_UNAVAILABLE — the payment facilitator could not be reached. We do not fail open: no data is served without a verified payment. `Retry-After: 5`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-price-usdc":"0.005","x-price-usdc-fresh":"0.02","x-price-usdc-active_users":"0.03","x-price-usdc-variants":[{"id":"base","amount_atomic":"5000","amount_usdc":"0.005","when":"Cache-backed lookup"},{"id":"fresh","amount_atomic":"20000","amount_usdc":"0.02","when":"?fresh=true — forces an upstream round-trip; we sell recency honestly"},{"id":"active_users","amount_atomic":"30000","amount_usdc":"0.03","when":"kpi=active_users_24h — indexer aggregation is materially more expensive"}],"x-price-selection":"The highest-priced variant this request qualifies for. A request that triggers two variants pays for both costs it imposes; the 402 quotes the exact amount that will be charged, before the handler runs.","x-paid":true,"x-agent-description":"One standardized financial KPI for one Algorand DeFi protocol, in USD or as a decimal ratio, with per-response provenance, cache state and a 0-1 confidence score."}},"/compare":{"get":{"operationId":"compareMetric","summary":"One KPI across 2-5 protocols, ranked","description":"Composed from the same cached facts /metric serves and never cached as a unit, so the composite reports the worst cache state across its legs and can never be fresher than them. Every leg appears in `facts[]`, including failures, as an error fact with a reason.","parameters":[{"name":"protocols","in":"query","required":true,"description":"Comma-separated protocol ids. 2-5 distinct; duplicates are collapsed first.","schema":{"type":"string","minLength":1},"example":"tinyman,pact,folks"},{"name":"metric","in":"query","required":true,"description":"KPI id, as listed at /catalog.","schema":{"type":"string","enum":["tvl","volume_24h","gross_fees_24h","supply_side_revenue_24h","protocol_revenue_24h","take_rate","capital_efficiency","fee_apr","volume_to_tvl","supply_apr","borrow_apr","utilization","total_borrows","active_users_24h","pool_count"]},"example":"capital_efficiency"},{"name":"fresh","in":"query","required":false,"description":"Force an upstream fetch on EVERY leg. Priced higher.","schema":{"type":"string","enum":["true","false"],"default":"false"}},{"name":"basis","in":"query","required":false,"description":"Inclusion basis (DATA_SCHEMA.md §3.6). A protocol that does not implement the requested basis returns 400 INVALID_PARAM listing the ones it does — it never silently substitutes the default, which would return a different number than the one asked for.","schema":{"type":"string","enum":["all_pools_usd_priced","verified_only"],"default":"all_pools_usd_priced"}}],"responses":{"200":{"description":"The comparison. `partial: true` with `excluded_protocols` when some legs failed; this is still charged, because a usable comparison was delivered.","headers":{"X-AlgoTerminal-Cache":{"schema":{"type":"string","enum":["hit","miss","stale"]},"description":"Cache state of this response. On a composite, the WORST state across its parts."},"X-AlgoTerminal-Methodology":{"schema":{"type":"string"},"description":"The methodology_version this number was computed under."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompareResponse"}}}},"400":{"description":"TOO_FEW_PROTOCOLS / TOO_MANY_PROTOCOLS / INVALID_PARAM. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment required. `PAYMENT-REQUIRED` carries the base64 v2 payment requirements; the body restates price, resource and description in plain JSON.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 v2 payment requirements."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"404":{"description":"KPI_NOT_FOUND or PROTOCOL_NOT_FOUND. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"PAYMENT_REPLAYED — this payment txid has already been recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"KPI_NOT_APPLICABLE_TO_ANY — the metric fits none of the requested protocols, so nothing was computed and nothing could have been. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"INSUFFICIENT_DATA — fewer than 2 legs resolved. A one-way comparison is not the product. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"FACILITATOR_UNAVAILABLE — the payment facilitator could not be reached. We do not fail open: no data is served without a verified payment. `Retry-After: 5`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-price-usdc":"0.05","x-price-usdc-fresh":"0.08","x-price-usdc-variants":[{"id":"base","amount_atomic":"50000","amount_usdc":"0.05","when":"Flat, 2-5 protocols"},{"id":"fresh","amount_atomic":"80000","amount_usdc":"0.08","when":"?fresh=true — forces an upstream round-trip on EVERY leg"}],"x-price-selection":"The highest-priced variant this request qualifies for. A request that triggers two variants pays for both costs it imposes; the 402 quotes the exact amount that will be charged, before the handler runs.","x-paid":true,"x-agent-description":"One standardized KPI across 2-5 Algorand DeFi protocols at once, ranked, with the spread between them and a generated statement of what makes them comparable - including across protocol types, so a DEX and a lending market can be ranked on the same axis."}},"/ask":{"post":{"operationId":"ask","summary":"Natural-language question, answered strictly from our own facts","description":"Two model calls: a cheap router turns the question into a plan validated against the live capability matrix, then a synthesizer answers from the fetched KpiFacts and nothing else. `facts[]` is always returned, including under `format: \"prose\"`, so a downstream agent can ignore the narrative and read the numbers. Descriptive only: no forecasts, no price targets, no advice.","parameters":[{"name":"depth","in":"query","required":false,"description":"Priced. It is read from the query string and not the body because the 402 is quoted before the body is read; a body `depth` that disagrees with it is a 400.","schema":{"type":"string","enum":["standard","deep"],"default":"standard"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}}},"responses":{"200":{"description":"The grounded answer, its facts, and the plan that produced them.","headers":{"X-AlgoTerminal-Cache":{"schema":{"type":"string","enum":["hit","miss","stale"]},"description":"Cache state of this response. On a composite, the WORST state across its parts."},"X-AlgoTerminal-Methodology":{"schema":{"type":"string"},"description":"The methodology_version this number was computed under."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"400":{"description":"QUESTION_TOO_LONG (> 500 chars), INVALID_BODY, or DEPTH_MISMATCH. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"x402 payment required. `PAYMENT-REQUIRED` carries the base64 v2 payment requirements; the body restates price, resource and description in plain JSON.","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 v2 payment requirements."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequiredBody"}}}},"409":{"description":"PAYMENT_REPLAYED — this payment txid has already been recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"UNROUTABLE_QUESTION — could not be mapped onto covered protocols and KPIs; the body lists what we do cover. Or OUT_OF_SCOPE — a forecast, a price target, trading advice, or a non-Algorand-DeFi topic. NEITHER IS CHARGED: the routing call is cheap and we eat it rather than charging for a non-answer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"INSUFFICIENT_DATA — routed successfully but fewer than one fact resolved, or the synthesis could not be grounded in the facts we fetched. NOT charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"FACILITATOR_UNAVAILABLE — the payment facilitator could not be reached. We do not fail open: no data is served without a verified payment. `Retry-After: 5`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"x-price-usdc":"0.15","x-price-usdc-deep":"0.2","x-price-usdc-variants":[{"id":"base","amount_atomic":"150000","amount_usdc":"0.15","when":"Standard synthesis"},{"id":"deep","amount_atomic":"200000","amount_usdc":"0.2","when":"?depth=deep — wider KPI sweep + longer synthesis budget"}],"x-price-selection":"The highest-priced variant this request qualifies for. A request that triggers two variants pays for both costs it imposes; the 402 quotes the exact amount that will be charged, before the handler runs.","x-paid":true,"x-available":false,"deprecated":true,"x-agent-description":"A natural-language question about Algorand DeFi, answered strictly from AlgoTerminal's own standardized KPIs, with every fact the answer rests on returned alongside the prose so the narrative can be verified or ignored. Descriptive only: no forecasts, no price targets, no advice. The question travels in the JSON request body; ?depth=deep is the only query parameter, and is priced higher."}}},"components":{"schemas":{"KpiFact":{"type":"object","properties":{"metric":{"type":"string","enum":["tvl","volume_24h","gross_fees_24h","supply_side_revenue_24h","protocol_revenue_24h","take_rate","capital_efficiency","fee_apr","volume_to_tvl","supply_apr","borrow_apr","utilization","total_borrows","active_users_24h","pool_count"]},"protocol":{"type":"string","minLength":1},"value":{"type":["number","null"]},"unit":{"anyOf":[{"type":"string","enum":["USD","RATIO","COUNT","ASSET_UNITS"]},{"type":"null"}]},"timestamp":{"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))$"},"confidence":{"type":"number","minimum":0,"maximum":1},"methodology_version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"error":{"$ref":"#/components/schemas/FactError"},"as_of":{"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))$"},"source":{"type":"array","items":{"$ref":"#/components/schemas/SourceRef"}},"is_estimated":{"type":"boolean"},"estimation_method":{"type":["string","null"]},"cache":{"type":"string","enum":["hit","miss","stale"]},"stale":{"type":"boolean"},"coverage":{"$ref":"#/components/schemas/Coverage"},"notes":{"type":"array","items":{"type":"string"}}},"required":["metric","protocol","value","unit","timestamp","confidence","methodology_version"],"additionalProperties":false},"SourceRef":{"type":"object","properties":{"name":{"type":"string","minLength":1},"url":{"type":"string","format":"uri"},"kind":{"type":"string","enum":["rest","onchain","derived"]},"retrieved_at":{"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))$"},"app_id":{"type":"integer","minimum":0,"maximum":9007199254740991},"round":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["name","url","kind","retrieved_at"],"additionalProperties":false},"Coverage":{"type":"object","properties":{"entities":{"type":"integer","minimum":0,"maximum":9007199254740991},"excluded":{"type":"integer","minimum":0,"maximum":9007199254740991},"basis":{"type":"string","enum":["all_pools_usd_priced","verified_only","total_deposits"]}},"required":["entities","excluded","basis"],"additionalProperties":false},"FactError":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"message":{"type":"string","minLength":1}},"required":["code","message"],"additionalProperties":false},"CompareResponse":{"type":"object","properties":{"metric":{"type":"string","enum":["tvl","volume_24h","gross_fees_24h","supply_side_revenue_24h","protocol_revenue_24h","take_rate","capital_efficiency","fee_apr","volume_to_tvl","supply_apr","borrow_apr","utilization","total_borrows","active_users_24h","pool_count"]},"unit":{"type":"string","enum":["USD","RATIO","COUNT","ASSET_UNITS"]},"timestamp":{"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))$"},"methodology_version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"facts":{"type":"array","items":{"$ref":"#/components/schemas/KpiFact"}},"ranking":{"type":"array","items":{"$ref":"#/components/schemas/RankingEntry"}},"ranking_basis":{"type":"string"},"spread":{"anyOf":[{"$ref":"#/components/schemas/Spread"},{"type":"null"}]},"comparability":{"$ref":"#/components/schemas/Comparability"},"cache":{"type":"string","enum":["hit","miss","stale"]},"stale":{"type":"boolean"},"partial":{"type":"boolean"},"excluded_protocols":{"type":"array","items":{"type":"string"}}},"required":["metric","unit","timestamp","methodology_version","facts","ranking","ranking_basis","spread","comparability","cache","stale","partial","excluded_protocols"],"additionalProperties":false},"RankingEntry":{"type":"object","properties":{"rank":{"type":"integer","minimum":1,"maximum":9007199254740991},"protocol":{"type":"string","minLength":1},"value":{"type":"number"}},"required":["rank","protocol","value"],"additionalProperties":false},"Spread":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"ratio":{"type":["number","null"]}},"required":["max","min","ratio"],"additionalProperties":false},"Comparability":{"type":"object","properties":{"confidence":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string"},"caveats":{"type":"array","items":{"type":"string"}}},"required":["confidence","note","caveats"],"additionalProperties":false},"AskRequest":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":500},"depth":{"type":"string","enum":["standard","deep"]},"max_facts":{"type":"integer","minimum":1,"maximum":24},"format":{"type":"string","enum":["prose","facts","both"]}},"required":["question"],"additionalProperties":false},"AskResponse":{"type":"object","properties":{"question":{"type":"string","minLength":1},"answer":{"type":"string"},"facts":{"type":"array","items":{"$ref":"#/components/schemas/KpiFact"}},"plan":{"$ref":"#/components/schemas/AskPlan"},"citations":{"type":"array","items":{"$ref":"#/components/schemas/Citation"}},"confidence":{"type":"number","minimum":0,"maximum":1},"caveats":{"type":"array","items":{"type":"string"}},"methodology_version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+$"},"model":{"type":"object","properties":{"router":{"type":"string","minLength":1},"synthesizer":{"type":"string","minLength":1}},"required":["router","synthesizer"],"additionalProperties":false},"timestamp":{"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))$"},"depth":{"type":"string","enum":["standard","deep"]},"format":{"type":"string","enum":["prose","facts","both"]},"cache":{"type":"string","enum":["hit","miss","stale"]}},"required":["question","answer","facts","plan","citations","confidence","caveats","methodology_version","model","timestamp","depth","format","cache"],"additionalProperties":false},"AskPlan":{"type":"object","properties":{"protocols":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"kpis":{"minItems":1,"type":"array","items":{"type":"string","enum":["tvl","volume_24h","gross_fees_24h","supply_side_revenue_24h","protocol_revenue_24h","take_rate","capital_efficiency","fee_apr","volume_to_tvl","supply_apr","borrow_apr","utilization","total_borrows","active_users_24h","pool_count"]}},"comparison_type":{"type":"string","enum":["single_metric_lookup","multi_metric_profile","cross_protocol_ranking","cross_class_comparison"]}},"required":["protocols","kpis","comparison_type"],"additionalProperties":false},"Citation":{"type":"object","properties":{"claim":{"type":"string","minLength":1},"fact_index":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["claim","fact_index"],"additionalProperties":false},"ErrorEnvelope":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z][A-Z0-9_]*$"},"message":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","message","detail"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"PaymentRequiredBody":{"type":"object","properties":{"error":{"type":"string","const":"payment_required"},"resource":{"type":"string"},"description":{"type":"string"},"mimeType":{"type":"string"},"price":{"type":"object","properties":{"amount_atomic":{"type":"string"},"amount_usdc":{"type":"string"},"asset":{"type":"string"},"asset_symbol":{"type":"string"},"decimals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"network":{"type":"string"},"scheme":{"type":"string"},"x402Version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payTo":{"type":"string"},"facilitator":{"type":"string"},"fee_sponsored":{"type":"boolean"},"variant":{"type":"string"}},"required":["amount_atomic","amount_usdc","asset","asset_symbol","decimals","network","scheme","x402Version","payTo","facilitator","fee_sponsored","variant"],"additionalProperties":false},"discovery":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"category":{"type":"string"},"input_example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"output_example":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["tags","category","input_example","output_example"],"additionalProperties":false},"docs":{"type":"string"},"settlement_policy":{"type":"string"}},"required":["error","resource","description","mimeType","price","discovery","docs","settlement_policy"],"additionalProperties":false}}}}