{"openapi":"3.0.3","info":{"title":"Q Market demo API","version":"1.1.0-demo","description":"Q Market API with demo credits, x402 v2 settlement on Base and MCP tools. Behaviors and fields added by the demo carry x-qmarket-demo."},"servers":[{"url":"https://api.notthelivesite.com"}],"x-x402":{"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","bounds":{"budgetCents":{"max":100000,"min":100,"zeroMeansUnset":true},"deepTierFrom":2000,"fundCents":{"max":1000000,"min":1},"topUpCents":{"max":1000000,"min":100}},"chainId":8453,"discovery":"https://api.notthelivesite.com/x402/discovery/resources","enabled":false,"facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","network":"eip155:8453","networkName":"base","payTo":"0x0000000000000000000000000000000000000000","requestHeader":"PAYMENT-SIGNATURE","responseHeader":"PAYMENT-RESPONSE","scheme":"exact","signing":"EIP-3009 TransferWithAuthorization under USDC's EIP-712 domain. Every 402 body carries the typed data ready to sign as `eip712`, with `chainId` beside it; a top-up intent carries the same document as payment.x402.eip712.","topUpIntent":{"create":"POST https://api.notthelivesite.com/v1/credits/topup/intent","pay":"POST https://api.notthelivesite.com/v1/pay/topup/{intent_id}","ttl":"1h0m0s","verify":"GET https://api.notthelivesite.com/v1/credits/topup/intent/{intent_id}"},"v1":"Still accepted. A payment sent as a v1 PaymentPayload in X-PAYMENT settles, and the settlement comes back on X-Payment-Response as well as PAYMENT-RESPONSE. The challenge itself is v2 only: `network` holds a CAIP-2 identifier, which is the one field that cannot carry both versions at once. `maxAmountRequired` is sent beside `amount` for the same reason it can be.","wireVersion":2},"components":{"schemas":{"AgentAccount":{"properties":{"account_id":{"type":"string"},"api_key":{"description":"Shown once. Send as Authorization: Bearer.","type":"string"},"balance_credits":{"description":"Always 0 on creation: fund the account over x402 or Stripe.","format":"int32","type":"integer"},"note":{"type":"string"}},"required":["account_id","api_key","balance_credits","note"],"type":"object"},"AgentAccountRequest":{"properties":{"label":{"description":"Free text, for the operator's own bookkeeping. Truncated to 60 characters.","type":"string"},"wallet_address":{"description":"Optional EVM address the agent will pay from.","pattern":"^0x[0-9a-fA-F]{40}$","type":"string"}},"type":"object"},"ArtifactSummary":{"properties":{"age_hours":{"description":"Age of the latest revision; null when none is published.","format":"double","nullable":true,"type":"number"},"downloads":{"format":"int64","type":"integer"},"external_url":{"nullable":true,"type":"string"},"freshness_hours":{"format":"int32","type":"integer"},"id":{"type":"string"},"latest_rev":{"format":"int32","type":"integer"},"machine_price_cents":{"description":"The price of a fresh read after the first; the first read of an artifact is the trial price.","format":"int32","type":"integer"},"question_id":{"type":"string"},"teaser":{"additionalProperties":true,"description":"arbitrary JSON object","nullable":true,"type":"object"},"unique_buyers":{"format":"int64","type":"integer"},"revisions":{"type":"array","items":{"type":"object","properties":{"rev":{"type":"integer"},"published_at":{"type":"string","nullable":true,"format":"date-time"},"note":{"type":"string","nullable":true},"freed_at":{"type":"string","nullable":true,"format":"date-time"}}},"x-qmarket-demo":true},"forecast":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":true},"x-qmarket-demo":true},"sources_count":{"type":"integer","x-qmarket-demo":true},"word_count":{"type":"integer","x-qmarket-demo":true},"title":{"type":"string","nullable":true,"x-qmarket-demo":true}},"required":["age_hours","downloads","external_url","freshness_hours","id","latest_rev","machine_price_cents","question_id","teaser","unique_buyers"],"type":"object"},"ArtifactsPage":{"properties":{"artifacts":{"items":{"$ref":"#/components/schemas/ArtifactSummary"},"nullable":false,"type":"array"},"next_cursor":{"description":"Send back as ?after= for the next page. Absent on the last page, and on a free-text search, which returns its best page and no cursor.","type":"string"}},"required":["artifacts"],"type":"object"},"ChainInfo":{"additionalProperties":false,"description":"The on-chain rail's configuration.","properties":{"chain_reads_configured":{"description":"Whether a read-only node is configured. Configuration, not reachability: nothing is probed, so a node that is set and unreachable still reports true. False is definitive and means smart-contract wallet sign-in and settlement reconciliation are both inert -- a wallet that can pay may be unable to sign back in, and a settlement whose outcome was never learned stays unresolved.","type":"boolean"},"escrow":{"additionalProperties":false,"description":"The deployed per-question escrow descriptor, or null. Only these fields are published; all of them are readable on the chain.","nullable":true,"properties":{"chain_id":{"type":"integer"},"deployed_block":{"description":"An indexer's fromBlock.","type":"integer"},"factory":{"description":"The escrow factory address to call.","type":"string"},"implementation":{"type":"string"},"network":{"type":"string"},"platform":{"type":"string"},"usdc":{"type":"string"}},"type":"object"},"network":{"type":"string"},"pay_to":{"description":"Null when this deployment cannot settle x402.","nullable":true,"type":"string"},"usdc":{"description":"USDC contract address on the network.","type":"string"}},"required":["network","usdc","pay_to","escrow","chain_reads_configured"],"type":"object"},"Checkout":{"properties":{"checkout_url":{"type":"string"},"session_id":{"type":"string"}},"required":["checkout_url","session_id"],"type":"object"},"CheckoutRequest":{"description":"Pass pack or amount_cents.","properties":{"amount_cents":{"description":"Alternative to pack.","format":"int64","type":"integer"},"pack":{"description":"A credit pack, in dollars.","enum":["100","20","5",""],"type":"string"},"purpose":{"enum":["","credits","fund"],"type":"string"},"question_id":{"type":"string"},"return_path":{"type":"string"}},"type":"object"},"ClaimedRun":{"properties":{"proposal_id":{"nullable":true,"type":"string"},"question_id":{"type":"string"},"run_id":{"type":"string"},"status":{"enum":["running"],"type":"string"}},"required":["proposal_id","question_id","run_id","status"],"type":"object"},"CreditsLedger":{"properties":{"balance_credits":{"format":"int64","type":"integer"},"entries":{"items":{"$ref":"#/components/schemas/CreditsLedgerEntry"},"nullable":false,"type":"array"}},"required":["balance_credits","entries"],"type":"object"},"CreditsLedgerEntry":{"properties":{"delta_credits":{"description":"Signed movement; a top-up is positive, a read or a fund is negative.","format":"int32","type":"integer"},"reason":{"description":"Why the balance moved.","example":"x402_topup","type":"string"},"ref":{"description":"The idempotency key for the reason: an x402 transaction, a Stripe session, a download id.","nullable":true,"type":"string"},"ts":{"format":"date-time","type":"string"}},"required":["delta_credits","reason","ref","ts"],"type":"object"},"DiscoveryListing":{"description":"The x402 discovery listing shape (specification v2 §8), describing this deployment's paid resources.","properties":{"items":{"items":{"properties":{"accepts":{"items":{"$ref":"#/components/schemas/PaymentRequirements"},"type":"array"},"lastUpdated":{"format":"date-time","type":"string"},"metadata":{"properties":{"amount":{"description":"\"fixed\" when accepts[0].maxAmountRequired is the price; \"per-request\" when the 402 quotes it (a read's price, the amount the caller asked to fund or buy).","type":"string"},"auth":{"description":"What the resource wants besides the payment. \"bearer-to-settle\" is the middle case: the 402 is served to anyone, so a wallet can discover the price, and only the paid retry needs a key.","enum":["none","bearer","bearer-to-settle"],"type":"string"},"description":{"type":"string"},"input":{"description":"The bazaar extension's info.input for this resource.","type":"object"},"method":{"type":"string"},"openapi":{"description":"The operation in /openapi.json.","format":"uri","type":"string"},"output":{"type":"object"}},"type":"object"},"resource":{"description":"Absolute URL, with {param} placeholders for a templated route.","type":"string"},"type":{"enum":["http"],"type":"string"},"x402Version":{"type":"integer"}},"required":["resource","type","x402Version","accepts","lastUpdated","metadata"],"type":"object"},"type":"array"},"pagination":{"properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total":{"type":"integer"}},"required":["limit","offset","total"],"type":"object"},"x402Version":{"enum":[2],"type":"integer"}},"required":["x402Version","items","pagination"],"type":"object"},"EIP712Field":{"properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"],"type":"object"},"EIP712TypedData":{"description":"The EIP-712 document to sign for challenge.accepts[0], ready for eth_signTypedData_v4. The `exact` scheme on an EVM network is an EIP-3009 TransferWithAuthorization; everything but from, validAfter, validBefore and nonce is fixed by the challenge and filled in here.","properties":{"domain":{"additionalProperties":{"description":"any JSON value"},"description":"USDC's EIP-712 domain: name and version from accepts[0].extra, chainId, verifyingContract = accepts[0].asset.","nullable":true,"type":"object"},"fill":{"description":"What to replace and how to send the signature.","type":"string"},"message":{"additionalProperties":{"description":"any JSON value"},"description":"to and value are final; from, validAfter, validBefore and nonce are placeholders in angle brackets.","nullable":true,"type":"object"},"primaryType":{"type":"string"},"types":{"additionalProperties":{"items":{"$ref":"#/components/schemas/EIP712Field"},"nullable":true,"type":"array"},"nullable":true,"type":"object"}},"required":["domain","fill","message","primaryType","types"],"type":"object"},"Error":{"description":"The body of every non-2xx response except a 402. Match on error.code; the message is for humans.","properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"required":["error"],"type":"object"},"ErrorBody":{"properties":{"code":{"description":"Stable machine-readable code. Shared with GraphQL extensions.code and MCP tool errors.","example":"auth_required","type":"string"},"message":{"type":"string"}},"required":["code","message"],"type":"object"},"FailRunRequest":{"properties":{"reason":{"type":"string"}},"type":"object"},"FeedToken":{"description":"A minted reader credential. `token` is the secret and is returned exactly once -- it is stored hashed, so a lost one is revoked and replaced rather than recovered.","properties":{"id":{"type":"string"},"label":{"type":"string"},"token":{"description":"The secret, prefixed qm_feed_. Shown once.","type":"string"},"url":{"description":"The feed to subscribe to, with the token already in the query string. The only place the secret is assembled into a URL.","format":"uri","type":"string"}},"required":["id","token","url"],"type":"object"},"FeedTokenInfo":{"description":"One live token as its owner sees it. No secret: what is stored is a hash.","properties":{"created_ts":{"description":"RFC 3339, UTC.","format":"date-time","type":"string"},"id":{"type":"string"},"label":{"type":"string"},"last_used_ts":{"description":"When a reader last fetched with this token, RFC 3339 UTC. Absent for a token nothing has used yet -- which is how a subscription that was never wired up is spotted.","format":"date-time","type":"string"}},"required":["created_ts","id"],"type":"object"},"FeedTokenRequest":{"description":"What to call the reader this token is for. Every field is optional, and so is the body itself.","properties":{"label":{"description":"A note to tell one reader from another in the listing, e.g. the name of the app it was pasted into. At most 64 characters.","maxLength":64,"type":"string"}},"type":"object"},"FeedTokens":{"description":"Every live token on the account, newest first.","items":{"$ref":"#/components/schemas/FeedTokenInfo"},"type":"array"},"FundRequest":{"properties":{"amount_cents":{"description":"How much to escrow. Clamped to what the round still needs.","format":"int32","maximum":1000000,"minimum":1,"type":"integer"}},"required":["amount_cents"],"type":"object"},"FundResult":{"description":"What the contribution bought, and where to watch it.","properties":{"budget_cents":{"format":"int32","type":"integer"},"escrowed_cents":{"description":"What this call actually escrowed, after clamping to the remainder.","format":"int32","type":"integer"},"funding_position":{"type":"string"},"question_id":{"type":"string"},"question_status":{"enum":["curating","listed","rejected","duplicate","funded","answering","answered","retired","superseded"],"type":"string"},"run_id":{"description":"The research run this contribution scheduled. Present only on the contribution that completed the round -- that is the one that schedules it.","type":"string"},"status_url":{"description":"Poll this while question_status moves funded -> answering -> answered.","format":"uri","type":"string"},"total_cents":{"format":"int64","type":"integer"}},"required":["budget_cents","escrowed_cents","funding_position","question_id","question_status","status_url","total_cents"],"type":"object"},"Health":{"description":"Readiness: ok is true while the database is reachable.","properties":{"ok":{"type":"boolean"}},"required":["ok"],"type":"object"},"ListQuestionRequest":{"type":"object","description":"CX2 trims text and entity tags. Omitted entities default to []; omitted budget defaults to 500 cents. Null and zero budgets are invalid.","properties":{"text":{"type":"string","minLength":12,"maxLength":2000},"entities":{"type":"array","items":{"type":"string","minLength":1,"maxLength":14},"maxItems":4,"default":[]},"budget_cents":{"type":"integer","minimum":100,"maximum":100000,"default":500}},"required":["text"],"x-qmarket-demo":true},"ListQuestionResult":{"properties":{"budget_cents":{"format":"int32","nullable":true,"type":"integer"},"id":{"type":"string"},"status":{"enum":["listed","rejected","duplicate","curating"],"type":"string"},"tier":{"nullable":true,"type":"string"}},"required":["id","status"],"type":"object"},"Ok":{"properties":{"ok":{"type":"boolean"}},"required":["ok"],"type":"object"},"PaymentAuthorization":{"description":"payload.authorization is the EIP-3009 message and payload.signature its EIP-712 signature; a top-up intent hands both out ready to fill in, as payment.x402.eip712.","properties":{"authorization":{"properties":{"from":{"description":"The payer.","type":"string"},"nonce":{"description":"32 random bytes, hex. Never reuse one.","type":"string"},"to":{"description":"accepts[0].payTo.","type":"string"},"validAfter":{"type":"string"},"validBefore":{"description":"Unix seconds; within accepts[0].maxTimeoutSeconds of now. Also what a settlement of unknown outcome is reconciled against, so it must be real.","type":"string"},"value":{"description":"accepts[0].amount.","type":"string"}},"required":["from","to","value","validAfter","validBefore","nonce"],"type":"object"},"signature":{"description":"EIP-712 signature of the authorization under the asset's domain (accepts[0].extra).","type":"string"}},"required":["signature","authorization"],"type":"object"},"PaymentIntentStatus":{"description":"Where a top-up intent is. Poll until it is terminal.","enum":["pending","settled","credited","expired","failed","unresolved","duplicate"],"type":"string"},"PaymentPayload":{"description":"The decoded PAYMENT-SIGNATURE (or X-PAYMENT) header: `exact` on an EVM network, in either wire version. Send it base64-encoded; bare JSON is also accepted.","example":{"accepted":{"amount":"5000000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","description":"Fresh revision of Qmarket artifact a_x","maxAmountRequired":"5000000","maxTimeoutSeconds":60,"mimeType":"text/markdown","network":"eip155:8453","payTo":"0x<accepts[0].payTo>","resource":"https://api.notthelivesite.com/v1/artifacts/a_x/fresh","scheme":"exact"},"payload":{"authorization":{"from":"0x1111111111111111111111111111111111111111","nonce":"0x<32 random bytes, hex>","to":"0x<accepts[0].payTo>","validAfter":"0","validBefore":"1767225600","value":"5000000"},"signature":"0x<65-byte EIP-712 signature, hex>"},"x402Version":2},"oneOf":[{"description":"x402Version 2. `accepted` is the accepts entry you signed, with its CAIP-2 network and `amount`.","properties":{"accepted":{"$ref":"#/components/schemas/PaymentRequirements"},"payload":{"$ref":"#/components/schemas/PaymentAuthorization"},"x402Version":{"enum":[2],"type":"integer"}},"required":["x402Version","payload","accepted"],"title":"v2","type":"object"},{"description":"x402Version 1, still accepted. `network` is the bare name, not CAIP-2.","properties":{"network":{"description":"Bare network name, e.g. base-sepolia.","type":"string"},"payload":{"$ref":"#/components/schemas/PaymentAuthorization"},"scheme":{"enum":["exact"],"type":"string"},"x402Version":{"enum":[1],"type":"integer"}},"required":["x402Version","scheme","network","payload"],"title":"v1","type":"object"}]},"PaymentRequired":{"description":"The body of a 402, also served base64-encoded in the PAYMENT-REQUIRED response header. Sign accepts[0] and retry the same request with the payment in PAYMENT-SIGNATURE (or X-PAYMENT, which is still accepted).","properties":{"accepts":{"items":{"$ref":"#/components/schemas/PaymentRequirements"},"minItems":1,"nullable":false,"type":"array"},"chainId":{"description":"The EIP-155 chain id accepts[0].network stands for, for a client composing its own signature. Not part of the x402 wire shape; x402 clients ignore it.","format":"int64","type":"integer"},"eip712":{"allOf":[{"$ref":"#/components/schemas/EIP712TypedData"}],"description":"The EIP-712 document to sign for accepts[0], ready for eth_signTypedData_v4 with from, validAfter, validBefore and nonce left as placeholders; `fill` says what replaces them and how the signature travels. Body only: the PAYMENT-REQUIRED header carries the challenge without it. Not part of the x402 wire shape; x402 clients ignore it.","nullable":true,"type":"object"},"error":{"description":"\"payment required\" on a first refusal; otherwise why a submitted payment was not accepted (bad_payment_header, verify_failed, settle_failed, facilitator_unreachable). Nothing was charged in either case.","type":"string"},"extensions":{"additionalProperties":{"description":"any JSON value"},"description":"x402 v2 extensions carried on the v1 body. `bazaar` describes the request this resource takes, in the discovery extension's info shape.","nullable":true,"type":"object"},"resource":{"nullable":true,"properties":{"description":{"type":"string"},"mimeType":{"type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"retry":{"nullable":true,"properties":{"header":{"type":"string"},"note":{"type":"string"},"url":{"type":"string"}},"required":["header","note","url"],"type":"object"},"x402Version":{"enum":[2],"format":"int64","type":"integer"}},"required":["accepts","error","x402Version"],"type":"object"},"PaymentRequirements":{"description":"One entry of a 402 challenge's accepts list: what to pay, where, on which network. x402 v2 `exact` scheme.","properties":{"amount":{"description":"USDC atomic units (6 decimals) as a decimal string: cents × 10,000. The v2 name for the price.","example":"5000000","type":"string"},"asset":{"description":"USDC contract address on `network`.","type":"string"},"description":{"type":"string"},"extra":{"additionalProperties":{"type":"string"},"description":"EIP-712 domain of the asset: {name, version}. Sign the TransferWithAuthorization against it.","nullable":true,"type":"object"},"maxAmountRequired":{"description":"The v1 name for amount, carrying the same value, sent for clients written against v1.","example":"5000000","type":"string"},"maxTimeoutSeconds":{"description":"How long the signed authorization must remain valid.","format":"int64","type":"integer"},"mimeType":{"description":"What a successful response is.","type":"string"},"network":{"description":"CAIP-2 chain identifier, e.g. eip155:8453 for Base mainnet or eip155:84532 for Base Sepolia.","example":"eip155:8453","type":"string"},"payTo":{"description":"The address that receives the USDC. The zero address means this deployment cannot settle.","type":"string"},"resource":{"description":"Absolute URL of the resource being paid for.","format":"uri","type":"string"},"scheme":{"enum":["exact"],"type":"string"}},"required":["amount","asset","description","maxAmountRequired","maxTimeoutSeconds","mimeType","network","payTo","resource","scheme"],"type":"object"},"PublishRequest":{"properties":{"citations":{"format":"int32","type":"integer"},"content":{"description":"The report, markdown.","minLength":1,"type":"string"},"cost_actual_cents":{"description":"What the run cost; prices the artifact as a markup on it.","format":"int32","nullable":true,"type":"integer"},"teaser":{"description":"any JSON value"}},"required":["content"],"type":"object"},"PublishResult":{"properties":{"artifact_id":{"type":"string"},"rev":{"format":"int32","type":"integer"}},"required":["artifact_id","rev"],"type":"object"},"Question":{"properties":{"artifact":{"allOf":[{"$ref":"#/components/schemas/ArtifactSummary"}],"nullable":true,"type":"object"},"budget_cents":{"description":"The research budget the live proposal is measured against; null before curation attaches one.","format":"int32","nullable":true,"type":"integer"},"created":{"type":"string"},"entities":{"items":{"type":"string"},"nullable":false,"type":"array"},"forecasters":{"format":"int32","nullable":true,"type":"integer"},"funders":{"format":"int64","type":"integer"},"id":{"type":"string"},"raised_cents":{"description":"Escrowed so far across every rail.","format":"int64","type":"integer"},"ref_url":{"nullable":true,"type":"string"},"reject_reason":{"nullable":true,"type":"string"},"slug":{"description":"The readable half of the question's URL: /q/{slug}-{id}. Decorative -- the id is what resolves -- so a link built from a stale slug still works.","type":"string"},"status":{"enum":["curating","listed","rejected","duplicate","funded","answering","answered","retired","superseded"],"type":"string"},"text":{"type":"string"},"tier":{"nullable":true,"type":"string"},"context":{"type":"string","nullable":true,"x-qmarket-demo":true},"deliverable":{"type":"string","nullable":true,"x-qmarket-demo":true},"resolution":{"type":"object","properties":{"criteria":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"date":{"type":"string","nullable":true}},"required":["criteria","source","date"],"x-qmarket-demo":true},"created_at":{"type":"string","format":"date-time","x-qmarket-demo":true},"funded_at":{"type":"string","nullable":true,"format":"date-time","x-qmarket-demo":true},"answered_at":{"type":"string","nullable":true,"format":"date-time","x-qmarket-demo":true},"demo":{"type":"boolean","x-qmarket-demo":true},"headline":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["probability","estimate","verdict"]},"value":{"oneOf":[{"type":"number"},{"type":"string"}]},"low":{"type":"number","nullable":true},"high":{"type":"number","nullable":true},"unit":{"type":"string","nullable":true},"as_of":{"type":"string","nullable":true,"format":"date-time"}},"x-qmarket-demo":true},"access":{"type":"object","nullable":true,"properties":{"state":{"type":"string","enum":["owned","headstart","paid","free"]},"price_cents":{"type":"integer"},"unlocks_at":{"type":"string","nullable":true,"format":"date-time"},"frees_at":{"type":"string","nullable":true,"format":"date-time"}},"x-qmarket-demo":true}},"required":["budget_cents","created","entities","forecasters","funders","id","raised_cents","ref_url","slug","status","text","tier"],"type":"object"},"QuestionsPage":{"properties":{"next_cursor":{"description":"Send back as ?after= for the next page. Absent on the last page, and on a free-text search, which returns its best page and no cursor.","type":"string"},"questions":{"items":{"$ref":"#/components/schemas/Question"},"nullable":false,"type":"array"}},"required":["questions"],"type":"object"},"ReviewRequest":{"properties":{"canonical_text":{"type":"string"},"notes":{"type":"string"},"verdict":{"enum":["accept","reject","rewrite"],"type":"string"}},"required":["verdict"],"type":"object"},"ReviewResult":{"properties":{"bounty_cents":{"format":"int32","type":"integer"},"ok":{"type":"boolean"}},"required":["bounty_cents","ok"],"type":"object"},"RoyaltiesLedger":{"properties":{"accrued_cents":{"format":"int64","type":"integer"},"entries":{"items":{"$ref":"#/components/schemas/RoyaltyLedgerEntry"},"nullable":false,"type":"array"}},"required":["accrued_cents","entries"],"type":"object"},"RoyaltyLedgerEntry":{"properties":{"artifact_id":{"type":"string"},"cents":{"format":"int64","type":"integer"},"contributor_account":{"type":"string"},"n":{"description":"How many downloads the row aggregates.","format":"int64","type":"integer"},"role":{"type":"string"},"status":{"enum":["accrued","approved","paid"],"type":"string"}},"required":["artifact_id","cents","contributor_account","n","role","status"],"type":"object"},"SetLabelRequest":{"description":"A display name to claim.","properties":{"label":{"type":"string"}},"required":["label"],"type":"object"},"Settlement":{"description":"A settled payment, as the decoded X-Payment-Response header. error and detail are never set on a success.","properties":{"detail":{"type":"string"},"error":{"description":"Set only on a refused or unresolved settlement, never in the response header.","type":"string"},"network":{"type":"string"},"payer":{"description":"The wallet that paid.","type":"string"},"tx":{"description":"On-chain transaction reference. It is the idempotency key: the same reference credits once.","type":"string"}},"type":"object"},"TopUpIntent":{"description":"A credits top-up intent: the amount, the URL a wallet pays without a bearer key, the exact 402 it will answer with, and how to confirm the credits landed. Identical over REST, GraphQL and MCP.","properties":{"account_id":{"type":"string"},"amount_cents":{"description":"Credits the payment buys.","format":"int32","maximum":1000000,"minimum":100,"type":"integer"},"balance_credits":{"format":"int64","type":"integer"},"created_at":{"format":"date-time","type":"string"},"credited_cents":{"format":"int32","type":"integer"},"detail":{"nullable":true,"type":"string"},"expires_at":{"description":"created_at + 60 minutes. A pay attempt after this is refused with 410 intent_expired before the facilitator is called.","format":"date-time","type":"string"},"intent_id":{"type":"string"},"payer":{"nullable":true,"type":"string"},"payment":{"$ref":"#/components/schemas/TopUpPayment"},"status":{"$ref":"#/components/schemas/PaymentIntentStatus"},"tx":{"nullable":true,"type":"string"},"updated_at":{"format":"date-time","type":"string"},"verify":{"$ref":"#/components/schemas/TopUpVerify"}},"required":["account_id","amount_cents","balance_credits","created_at","credited_cents","detail","expires_at","intent_id","payer","payment","status","tx","updated_at","verify"],"type":"object"},"TopUpPayment":{"properties":{"auth":{"description":"No Authorization header: the intent id in the URL is the capability.","enum":["none"],"type":"string"},"body":{"description":"Nothing is required; the amount is fixed by the intent. Always null.","nullable":true,"type":"object"},"content_type":{"type":"string"},"method":{"type":"string"},"url":{"type":"string"},"x402":{"$ref":"#/components/schemas/TopUpX402"}},"required":["auth","body","content_type","method","url","x402"],"type":"object"},"TopUpRequest":{"properties":{"amount_cents":{"description":"Credits to buy: one cent is one credit.","format":"int32","maximum":1000000,"minimum":100,"type":"integer"}},"required":["amount_cents"],"type":"object"},"TopUpResult":{"description":"A credited top-up. For a signup, account_id names the account the settlement opened and api_key is returned once.","properties":{"account_id":{"type":"string"},"api_key":{"type":"string"},"balance_credits":{"format":"int64","type":"integer"},"credited_cents":{"format":"int32","type":"integer"},"intent_id":{"type":"string"},"replay":{"type":"boolean"},"tx":{"type":"string"}},"required":["balance_credits","credited_cents","replay","tx"],"type":"object"},"TopUpVerify":{"properties":{"auth":{"enum":["bearer"],"type":"string"},"credited_status":{"enum":["credited"],"type":"string"},"method":{"type":"string"},"poll_seconds":{"format":"int64","type":"integer"},"terminal_statuses":{"items":{"type":"string"},"nullable":false,"type":"array"},"url":{"type":"string"}},"required":["auth","credited_status","method","poll_seconds","terminal_statuses","url"],"type":"object"},"TopUpX402":{"properties":{"chain_id":{"description":"EIP-155 chain id behind challenge.accepts[0].network (base: 8453, base-sepolia: 84532).","format":"int64","type":"integer"},"challenge":{"$ref":"#/components/schemas/PaymentRequired"},"eip712":{"$ref":"#/components/schemas/EIP712TypedData"},"encoding":{"type":"string"},"request_header":{"description":"Send the signed payment here. X-PAYMENT is also read, for clients written against v1.","enum":["PAYMENT-SIGNATURE"],"type":"string"},"response_header":{"description":"The settlement comes back here and, for v1 clients, on X-Payment-Response as well.","enum":["PAYMENT-RESPONSE"],"type":"string"},"version":{"enum":[2],"format":"int64","type":"integer"}},"required":["chain_id","challenge","eip712","encoding","request_header","response_header","version"],"type":"object"},"WalletKey":{"description":"A key minted for the account a wallet owns.","properties":{"account_id":{"type":"string"},"api_key":{"type":"string"},"label":{"type":"string"}},"required":["account_id","api_key"],"type":"object"},"WalletLabel":{"description":"The public name an account is displayed under.","properties":{"account_id":{"type":"string"},"label":{"type":"string"}},"required":["account_id","label"],"type":"object"},"WatchRequest":{"properties":{"key":{"description":"An entity is free text -- a ticker, a name -- and is stored uppercased. A question is a question id, exactly as given: ids are case-sensitive.","type":"string"},"kind":{"description":"What the key names. Defaults to entity.","enum":["entity","question"],"type":"string"}},"required":["key"],"type":"object"},"WebhookResult":{"properties":{"credited":{"format":"int64","type":"integer"},"funding":{"nullable":true,"properties":{"budget_cents":{"format":"int32","type":"integer"},"escrowed_cents":{"format":"int32","type":"integer"},"funding_position":{"type":"string"},"question_status":{"type":"string"},"run_id":{"type":"string"},"total_cents":{"format":"int64","type":"integer"}},"required":["budget_cents","escrowed_cents","funding_position","question_status","total_cents"],"type":"object"},"funding_error":{"type":"string"},"handled":{"type":"boolean"},"reason":{"type":"string"},"type":{"type":"string"}},"required":["handled"],"type":"object"},"DemoActivityEntry":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["question_listed","curation_accepted","funded","round_complete","run_started","report_published","report_bought","report_read_free","watch_added","credit_topped_up"]},"question_id":{"type":"string","nullable":true},"artifact_id":{"type":"string","nullable":true},"account_display":{"type":"string","nullable":true},"amount_cents":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"payload":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","kind","question_id","artifact_id","account_display","amount_cents","created_at","payload"],"x-qmarket-demo":true}},"parameters":{"after":{"description":"Page cursor: the next_cursor of the previous page. Omit for the first page.","in":"query","name":"after","schema":{"type":"string"}},"ifNoneMatch":{"description":"The ETag of the feed document you already have. A feed that has not changed answers 304 with no body, which is what makes polling this every few minutes cheap. Weak validators are accepted: the tag is a hash of the document.","in":"header","name":"If-None-Match","required":false,"schema":{"type":"string"}},"limit":{"description":"Page size. Defaults to 50; clamped to 1–200; non-numeric values are ignored.","in":"query","name":"limit","schema":{"type":"integer"}},"paymentSignature":{"description":"The signed payment, base64-encoded PaymentPayload. The v2 name for X-PAYMENT; either header is read, and the version is taken from the payload rather than the header it arrived in. Present: settle on the wallet rail. Absent: quote a 402.","example":"eyJhY2NlcHRlZCI6eyJhbW91bnQiOiI1MDAwMDAwIiwiYXNzZXQiOiIweDgzMzU4OWZDRDZlRGI2RTA4ZjRjN0MzMkQ0ZjcxYjU0YmRBMDI5MTMiLCJkZXNjcmlwdGlvbiI6IkZyZXNoIHJldmlzaW9uIG9mIFFtYXJrZXQgYXJ0aWZhY3QgYV94IiwibWF4QW1vdW50UmVxdWlyZWQiOiI1MDAwMDAwIiwibWF4VGltZW91dFNlY29uZHMiOjYwLCJtaW1lVHlwZSI6InRleHQvbWFya2Rvd24iLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMiLCJwYXlUbyI6IjB4XHUwMDNjYWNjZXB0c1swXS5wYXlUb1x1MDAzZSIsInJlc291cmNlIjoiaHR0cHM6Ly9hcGkubm90dGhlbGl2ZXNpdGUuY29tL3YxL2FydGlmYWN0cy9hX3gvZnJlc2giLCJzY2hlbWUiOiJleGFjdCJ9LCJwYXlsb2FkIjp7ImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB4MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsIm5vbmNlIjoiMHhcdTAwM2MzMiByYW5kb20gYnl0ZXMsIGhleFx1MDAzZSIsInRvIjoiMHhcdTAwM2NhY2NlcHRzWzBdLnBheVRvXHUwMDNlIiwidmFsaWRBZnRlciI6IjAiLCJ2YWxpZEJlZm9yZSI6IjE3NjcyMjU2MDAiLCJ2YWx1ZSI6IjUwMDAwMDAifSwic2lnbmF0dXJlIjoiMHhcdTAwM2M2NS1ieXRlIEVJUC03MTIgc2lnbmF0dXJlLCBoZXhcdTAwM2UifSwieDQwMlZlcnNpb24iOjJ9","in":"header","name":"PAYMENT-SIGNATURE","required":false,"schema":{"format":"byte","type":"string"}},"signInWithX":{"description":"A CAIP-122 proof that you control a wallet, base64-encoded. Bound to this service's origin and spent once. No payment and no balance are involved -- it proves control, nothing else.","in":"header","name":"SIGN-IN-WITH-X","required":true,"schema":{"format":"byte","type":"string"}},"xPayment":{"description":"x402 v1 payment, base64-encoded PaymentPayload. Present: settle on the wallet rail. Absent: quote a 402 (or, with a bearer key on an operation that takes credits, spend credits).","example":"eyJhY2NlcHRlZCI6eyJhbW91bnQiOiI1MDAwMDAwIiwiYXNzZXQiOiIweDgzMzU4OWZDRDZlRGI2RTA4ZjRjN0MzMkQ0ZjcxYjU0YmRBMDI5MTMiLCJkZXNjcmlwdGlvbiI6IkZyZXNoIHJldmlzaW9uIG9mIFFtYXJrZXQgYXJ0aWZhY3QgYV94IiwibWF4QW1vdW50UmVxdWlyZWQiOiI1MDAwMDAwIiwibWF4VGltZW91dFNlY29uZHMiOjYwLCJtaW1lVHlwZSI6InRleHQvbWFya2Rvd24iLCJuZXR3b3JrIjoiZWlwMTU1Ojg0NTMiLCJwYXlUbyI6IjB4XHUwMDNjYWNjZXB0c1swXS5wYXlUb1x1MDAzZSIsInJlc291cmNlIjoiaHR0cHM6Ly9hcGkubm90dGhlbGl2ZXNpdGUuY29tL3YxL2FydGlmYWN0cy9hX3gvZnJlc2giLCJzY2hlbWUiOiJleGFjdCJ9LCJwYXlsb2FkIjp7ImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB4MTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIsIm5vbmNlIjoiMHhcdTAwM2MzMiByYW5kb20gYnl0ZXMsIGhleFx1MDAzZSIsInRvIjoiMHhcdTAwM2NhY2NlcHRzWzBdLnBheVRvXHUwMDNlIiwidmFsaWRBZnRlciI6IjAiLCJ2YWxpZEJlZm9yZSI6IjE3NjcyMjU2MDAiLCJ2YWx1ZSI6IjUwMDAwMDAifSwic2lnbmF0dXJlIjoiMHhcdTAwM2M2NS1ieXRlIEVJUC03MTIgc2lnbmF0dXJlLCBoZXhcdTAwM2UifSwieDQwMlZlcnNpb24iOjJ9","in":"header","name":"X-PAYMENT","required":false,"schema":{"format":"byte","type":"string"}}},"responses":{"AuthUnavailable":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The token verifier could not be reached; whether the credential is good is unknown. Retry. Codes: `auth_unavailable`."},"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request was understood and refused. Codes: `bad_body`, `bad_amount`, `bad_budget`, `bad_key`, `bad_kind`, `bad_label`, `bad_question`, `bad_request`, `bad_wallet`, `budget_met`, `not_fundable`."},"Conflict":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The request is well formed but the state moved. Codes: `price_changed`, `intent_closed`, `payment_state`, `payment_reused`."},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The account may not do this. Codes: `headstart`, `forbidden`."},"Gone":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The top-up intent aged out unpaid; create a new one. Nothing was charged. Codes: `intent_expired`."},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No such row. Codes: `not_found`, `no_free_revision`."},"PaymentRequired":{"content":{"application/json":{"example":{"x402Version":2,"error":"payment required","accepts":[{"scheme":"exact","network":"eip155:8453","amount":"5000000","maxAmountRequired":"5000000","resource":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json","payTo":"0x0000000000000000000000000000000000000000","maxTimeoutSeconds":60,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","extra":{"name":"USD Coin","version":"2"}}],"resource":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json"},"extensions":{"bazaar":{"info":{"input":{"body":{},"bodyType":"json","method":"POST","type":"http"},"output":{"type":"json"}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"properties":{"body":{"type":"object"},"bodyType":{"enum":["json"]},"method":{"enum":["GET","POST"]},"type":{"const":"http"}},"required":["type","method"],"type":"object"},"output":{"properties":{"type":{"enum":["json","text"]}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"}}},"chainId":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."},"retry":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","header":"PAYMENT-SIGNATURE","note":"Sign accepts[0] -- the eip712 field is the document, complete but for from, validAfter, validBefore and nonce -- then send this exact request again, same method and same body and same bearer, with the signed payment in the header named here. X-PAYMENT is accepted for a v1 payload."}},"schema":{"$ref":"#/components/schemas/PaymentRequired"}}},"description":"Payment required. On a first request this is the quote; after a submitted payment it names why the payment was refused. Nothing was charged. Sign accepts[0] and retry with X-PAYMENT.","headers":{"PAYMENT-REQUIRED":{"$ref":"#/components/headers/PAYMENT-REQUIRED"}}},"RateLimited":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Too many unauthenticated attempts from this address -- anonymous account creations, or feed-token management by signature; Retry-After says when the window resets. Codes: `rate_limited`.","headers":{"Retry-After":{"$ref":"#/components/headers/Retry-After"}}},"SettlementUnresolved":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"The facilitator was asked to settle and the outcome is unknown or unidentifiable. The money may have moved; the payment is on file for reconciliation. Do not pay again. Codes: `settle_unknown`, `settle_no_reference`."},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"No usable credential. auth_required: none was sent where one is needed; invalid_key / invalid_token: one was sent and did not resolve -- fix it rather than retry. Codes: `auth_required`, `invalid_key`, `invalid_token`.","headers":{"WWW-Authenticate":{"$ref":"#/components/headers/WWW-Authenticate"}}},"X402NotConfigured":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"This deployment cannot settle x402; pay with credits. Codes: `x402_not_configured`."}},"headers":{"ETag":{"description":"A hash of the rendered document. Send it back as If-None-Match and an unchanged feed answers 304.","schema":{"type":"string"}},"PAYMENT-REQUIRED":{"description":"The 402 challenge, base64-encoded PaymentRequired. The same document as the response body; a v2 client reads this.","schema":{"format":"byte","type":"string"}},"PAYMENT-RESPONSE":{"description":"Base64-encoded Settlement for the payment that bought this response. The v2 name; sent on every route that takes a payment.","schema":{"format":"byte","type":"string"}},"Referrer-Policy":{"description":"no-referrer on the feed routes: the URL carries the token, and it must not travel to whatever a link in the document points at.","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait before retrying, when the refusal is temporary.","schema":{"type":"integer"}},"WWW-Authenticate":{"description":"Sent with a 401: the bearer scheme and the error code, RFC 6750 style.","schema":{"type":"string"}},"X-Payment-Response":{"description":"The v1 name for PAYMENT-RESPONSE, carrying the same value, sent for clients written against v1.","schema":{"format":"byte","type":"string"}},"X-Qmarket-Access":{"description":"Access result: free, owned, bought with credits, or paid with x402.","schema":{"type":"string","enum":["free","owned","bought","paid"]},"x-qmarket-demo":true},"X-Qmarket-Price-Cents":{"description":"What this read actually charged, which on a first read is the trial price.","schema":{"type":"integer"}}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A qm_sk_ API key or a verified Privy access token."},"x402Payment":{"description":"x402 v1 payment: base64-encoded PaymentPayload signed against the 402's accepts[0]. Sending it is what selects the wallet rail over credits.","in":"header","name":"X-PAYMENT","type":"apiKey"}}},"paths":{"/":{"get":{"description":"Every route, the auth model and how to pay, as prose in one JSON document. Start here or at /openapi.json.","operationId":"index","security":[{}],"summary":"Service index","tags":["meta"],"responses":{"200":{"description":"The index.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/healthz":{"get":{"description":"200 while the database is reachable, 503 when it is not. Readiness rather than liveness: a database outage must not restart every replica.","operationId":"health","security":[{}],"summary":"Readiness probe","tags":["meta"],"x-qmarket-demo":true,"responses":{"200":{"description":"Ready.","content":{"application/json":{"example":{"ok":true},"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"Database unavailable.","x-qmarket-demo":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"openapi","security":[{}],"summary":"This document","tags":["meta"],"responses":{"200":{"description":"OpenAPI 3.0.3.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/llms.txt":{"get":{"description":"The llmstxt.org discovery file, rendered from this deployment's config.","operationId":"llmsTxt","security":[{}],"summary":"llms.txt","tags":["meta"],"responses":{"200":{"description":"The file.","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/mcp":{"post":{"description":"The marketplace as agent tools. Read-only tools are anonymous; the rest take the bearer key on this request. qmarket_create_topup_intent and qmarket_topup_status return the TopUpIntent object served by this API.","operationId":"mcp","requestBody":{"content":{"application/json":{"schema":{"type":"object"}}},"required":true},"security":[{"bearerAuth":[]},{}],"summary":"MCP (streamable HTTP)","tags":["meta"],"responses":{"200":{"description":"JSON-RPC response.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/chain":{"get":{"operationId":"chain","security":[{}],"summary":"On-chain rail configuration","tags":["payments"],"responses":{"200":{"description":"Network, USDC asset, pay-to and escrow descriptor.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainInfo"}}}}}}},"/x402/discovery/resources":{"get":{"description":"Four x402 v2 payment resources: fund a question, read a fresh report, buy credits, and pay a top-up intent. Quotes and discovery remain available without facilitator credentials; payment retries then return 503 x402_not_configured.","operationId":"discoveryResources","security":[{}],"summary":"x402 discovery listing","tags":["meta","payments"],"x-qmarket-demo":true,"responses":{"200":{"description":"The listing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryListing"}}}}}}},"/v1/questions":{"get":{"operationId":"listQuestions","parameters":[{"description":"Filter by status.","in":"query","name":"status","schema":{"type":"string","enum":["curating","listed","rejected","duplicate","funded","answering","answered","retired","superseded"]},"x-qmarket-demo":true},{"description":"Filter to one entity, e.g. MRNA.","in":"query","name":"entity","schema":{"type":"string"}},{"description":"Free-text search.","in":"query","name":"q","schema":{"type":"string"}},{"in":"query","name":"limit","description":"Page size defaults to 50. Numeric values are clamped to 1–100 in CX2; non-numeric values are ignored.","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"x-qmarket-demo":true},{"$ref":"#/components/parameters/after"}],"security":[{}],"summary":"Browse questions","tags":["questions"],"x-qmarket-demo":true,"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuestionsPage"}}}},"400":{"description":"Invalid query or cursor.","x-qmarket-demo":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"description":"Create a question for delayed demo curation. Status is curating until the job runs, or listed when the configured delay is zero.","operationId":"listQuestion","requestBody":{"content":{"application/json":{"example":{"budget_cents":2000,"entities":["MRNA"],"text":"Will MRNA report positive phase 3 data for its flu vaccine by Q2 2027?"},"schema":{"$ref":"#/components/schemas/ListQuestionRequest"}}},"required":true},"security":[{"bearerAuth":[]}],"summary":"List a question","tags":["questions"],"x-qmarket-demo":true,"responses":{"202":{"description":"Curated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListQuestionResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/questions/{qid}":{"get":{"operationId":"getQuestion","parameters":[{"description":"Question id.","in":"path","name":"qid","required":true,"schema":{"type":"string"}}],"security":[{}],"summary":"One question","tags":["questions"],"responses":{"200":{"description":"The question.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Question"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/questions/{qid}/fund":{"post":{"description":"A bearer spends credits, clamped to the remaining budget. An anonymous request receives a quote. A payment header requires a bearer and settles USDC through x402. An unavailable round returns 409 before settlement. A settled payment whose delivery fails returns 502 for reconciliation.","operationId":"fundQuestion","parameters":[{"description":"Question id.","in":"path","name":"qid","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/paymentSignature"},{"$ref":"#/components/parameters/xPayment"}],"requestBody":{"content":{"application/json":{"example":{"amount_cents":500},"schema":{"$ref":"#/components/schemas/FundRequest"}}},"required":true},"security":[{"bearerAuth":[]},{"bearerAuth":[],"x402Payment":[]},{}],"summary":"Fund a question","tags":["questions","payments"],"x-qmarket-demo":true,"responses":{"200":{"description":"Escrowed.","headers":{"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"},"X-Payment-Response":{"$ref":"#/components/headers/X-Payment-Response"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"description":"Anonymous x402 quote, or insufficient credits for an authenticated account. Only a quote carries PAYMENT-REQUIRED.","x-qmarket-demo":true,"headers":{"PAYMENT-REQUIRED":{"$ref":"#/components/headers/PAYMENT-REQUIRED"}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PaymentRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"CX2 refuses unavailable rounds with not_fundable or budget_met.","x-qmarket-demo":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"$ref":"#/components/responses/SettlementUnresolved"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/artifacts":{"get":{"operationId":"listArtifacts","parameters":[{"description":"Filter to one entity.","in":"query","name":"entity","schema":{"type":"string"}},{"in":"query","name":"limit","description":"Page size defaults to 50. Numeric values are clamped to 1–100 in CX2; non-numeric values are ignored.","schema":{"type":"integer","default":50,"minimum":1,"maximum":100},"x-qmarket-demo":true},{"$ref":"#/components/parameters/after"}],"security":[{}],"summary":"Browse artifacts","tags":["artifacts"],"x-qmarket-demo":true,"responses":{"200":{"description":"A page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactsPage"}}}},"400":{"description":"Invalid query or cursor.","x-qmarket-demo":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/artifacts/{aid}/teaser":{"get":{"operationId":"teaser","parameters":[{"description":"Artifact id.","in":"path","name":"aid","required":true,"schema":{"type":"string"}}],"security":[{}],"summary":"Teaser (free)","tags":["artifacts"],"responses":{"200":{"description":"The summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArtifactSummary"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/artifacts/{aid}/stale":{"get":{"description":"A revision is free once a newer one supersedes it or it ages past the freshness window. 404 no_free_revision while none has.","operationId":"stale","parameters":[{"description":"Artifact id.","in":"path","name":"aid","required":true,"schema":{"type":"string"}}],"security":[{}],"summary":"Newest freed revision (free)","tags":["artifacts"],"responses":{"200":{"description":"The revision.","headers":{"Cache-Control":{"schema":{"enum":["private, no-store"],"type":"string"}}},"content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/artifacts/{aid}/fresh":{"get":{"description":"Funders and buyers of this revision receive owned access. A superseded revision or one at least 72 hours old is free. During the first 24 hours other viewers receive 403 headstart. Otherwise a bearer spends credits: the first artifact purchase costs 10 cents, later revisions cost 50. An anonymous request receives a 50-cent quote. A payment header settles USDC through x402 and returns the report with paid access.","operationId":"fresh","parameters":[{"description":"Artifact id.","in":"path","name":"aid","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/paymentSignature"},{"$ref":"#/components/parameters/xPayment"}],"security":[{"bearerAuth":[]},{"x402Payment":[]},{}],"summary":"Current revision (paid)","tags":["artifacts","payments"],"x-qmarket-demo":true,"responses":{"200":{"description":"The revision.","headers":{"Cache-Control":{"schema":{"enum":["private, no-store"],"type":"string"}},"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"},"X-Payment-Response":{"$ref":"#/components/headers/X-Payment-Response"},"X-Qmarket-Access":{"$ref":"#/components/headers/X-Qmarket-Access"},"X-Qmarket-Price-Cents":{"$ref":"#/components/headers/X-Qmarket-Price-Cents"}},"content":{"text/markdown":{"schema":{"type":"string"}}}},"402":{"description":"Anonymous x402 quote, or insufficient credits for an authenticated account. Only a quote carries PAYMENT-REQUIRED.","x-qmarket-demo":true,"headers":{"PAYMENT-REQUIRED":{"$ref":"#/components/headers/PAYMENT-REQUIRED"}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PaymentRequired"},{"$ref":"#/components/schemas/Error"}]}}}},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"502":{"$ref":"#/components/responses/SettlementUnresolved"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/accounts/agent":{"post":{"description":"Create an agent account without authentication. The account starts with zero credits and its qm_sk_ API key is shown once. Buy credits through x402 or create a top-up intent for a wallet to pay.","operationId":"createAgentAccount","requestBody":{"content":{"application/json":{"example":{"label":"my-research-agent","wallet_address":"0x1111111111111111111111111111111111111111"},"schema":{"$ref":"#/components/schemas/AgentAccountRequest"}}},"required":true},"security":[{}],"summary":"Create an agent account (no auth)","tags":["accounts"],"x-qmarket-demo":true,"responses":{"201":{"description":"The account and its key, shown once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAccount"}}}},"400":{"$ref":"#/components/responses/BadRequest"}}}},"/v1/credits/topup":{"post":{"description":"The one-request on-ramp: without a payment header it quotes a 402 for amount_cents, with or without a bearer key, so an x402 client can discover the price the standard way; with a payment header it settles and credits, and the bearer key is required then because credits have to land on an account. The caller drives the x402 retry itself. A client that cannot -- an MCP or GraphQL session, or a wallet that will not carry a bearer key -- should create a top-up intent instead.","operationId":"topUp","parameters":[{"$ref":"#/components/parameters/paymentSignature"},{"$ref":"#/components/parameters/xPayment"}],"requestBody":{"content":{"application/json":{"example":{"amount_cents":500},"schema":{"$ref":"#/components/schemas/TopUpRequest"}}},"required":true},"security":[{"bearerAuth":[]},{"bearerAuth":[],"x402Payment":[]}],"summary":"Buy credits with USDC (same-request x402)","tags":["payments"],"responses":{"200":{"description":"Credited.","headers":{"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"},"X-Payment-Response":{"$ref":"#/components/headers/X-Payment-Response"}},"content":{"application/json":{"example":{"credited_cents":500,"balance_credits":1250,"tx":"0xabc123","replay":false},"schema":{"$ref":"#/components/schemas/TopUpResult"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"409":{"$ref":"#/components/responses/Conflict"},"502":{"$ref":"#/components/responses/SettlementUnresolved"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/credits/topup/intent":{"post":{"description":"Mints a pending intent for amount_cents and returns everything needed to pay it: a URL under /v1/pay/topup/ that takes no bearer key, the exact 402 that URL answers with (sign accepts[0] without provoking it), and the status URL to poll. The intent id is the capability: holding it lets a wallet put money on this account and nothing else. Expires after 1h0m0s.","operationId":"createTopUpIntent","requestBody":{"content":{"application/json":{"example":{"amount_cents":500},"schema":{"$ref":"#/components/schemas/TopUpRequest"}}},"required":true},"security":[{"bearerAuth":[]}],"summary":"Create a top-up intent","tags":["payments"],"responses":{"201":{"description":"The intent.","content":{"application/json":{"example":{"intent_id":"xp_00000000example0","status":"pending","account_id":"acc_example","amount_cents":500,"credited_cents":0,"balance_credits":0,"tx":null,"payer":null,"detail":null,"created_at":"2026-01-01T00:00:00Z","expires_at":"2026-01-01T01:00:00Z","updated_at":"2026-01-01T00:00:00Z","payment":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","method":"POST","auth":"none","content_type":"application/json","body":null,"x402":{"version":2,"request_header":"PAYMENT-SIGNATURE","response_header":"PAYMENT-RESPONSE","encoding":"base64(json)","challenge":{"x402Version":2,"error":"payment required","accepts":[{"scheme":"exact","network":"eip155:8453","amount":"5000000","maxAmountRequired":"5000000","resource":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json","payTo":"0x0000000000000000000000000000000000000000","maxTimeoutSeconds":60,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","extra":{"name":"USD Coin","version":"2"}}],"resource":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json"},"extensions":{"bazaar":{"info":{"input":{"body":{},"bodyType":"json","method":"POST","type":"http"},"output":{"type":"json"}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"properties":{"body":{"type":"object"},"bodyType":{"enum":["json"]},"method":{"enum":["GET","POST"]},"type":{"const":"http"}},"required":["type","method"],"type":"object"},"output":{"properties":{"type":{"enum":["json","text"]}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"}}},"chainId":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."},"retry":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","header":"PAYMENT-SIGNATURE","note":"Sign accepts[0] -- the eip712 field is the document, complete but for from, validAfter, validBefore and nonce -- then send this exact request again, same method and same body and same bearer, with the signed payment in the header named here. X-PAYMENT is accepted for a v1 payload."}},"chain_id":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."}}},"verify":{"url":"https://api.notthelivesite.com/v1/credits/topup/intent/xp_00000000example0","method":"GET","auth":"bearer","credited_status":"credited","terminal_statuses":["credited","expired","failed","unresolved","duplicate"],"poll_seconds":5}},"schema":{"$ref":"#/components/schemas/TopUpIntent"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/credits/topup/intent/{id}":{"get":{"description":"The intent as its owner sees it. status is the field to watch; credited means the balance moved and balance_credits is the result. Another account's intent is 404.","operationId":"getTopUpIntent","parameters":[{"description":"Intent id.","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"summary":"Verify a top-up intent","tags":["payments"],"responses":{"200":{"description":"The intent.","content":{"application/json":{"example":{"intent_id":"xp_00000000example0","status":"pending","account_id":"acc_example","amount_cents":500,"credited_cents":0,"balance_credits":0,"tx":null,"payer":null,"detail":null,"created_at":"2026-01-01T00:00:00Z","expires_at":"2026-01-01T01:00:00Z","updated_at":"2026-01-01T00:00:00Z","payment":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","method":"POST","auth":"none","content_type":"application/json","body":null,"x402":{"version":2,"request_header":"PAYMENT-SIGNATURE","response_header":"PAYMENT-RESPONSE","encoding":"base64(json)","challenge":{"x402Version":2,"error":"payment required","accepts":[{"scheme":"exact","network":"eip155:8453","amount":"5000000","maxAmountRequired":"5000000","resource":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json","payTo":"0x0000000000000000000000000000000000000000","maxTimeoutSeconds":60,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","extra":{"name":"USD Coin","version":"2"}}],"resource":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json"},"extensions":{"bazaar":{"info":{"input":{"body":{},"bodyType":"json","method":"POST","type":"http"},"output":{"type":"json"}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"properties":{"body":{"type":"object"},"bodyType":{"enum":["json"]},"method":{"enum":["GET","POST"]},"type":{"const":"http"}},"required":["type","method"],"type":"object"},"output":{"properties":{"type":{"enum":["json","text"]}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"}}},"chainId":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."},"retry":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","header":"PAYMENT-SIGNATURE","note":"Sign accepts[0] -- the eip712 field is the document, complete but for from, validAfter, validBefore and nonce -- then send this exact request again, same method and same body and same bearer, with the signed payment in the header named here. X-PAYMENT is accepted for a v1 payload."}},"chain_id":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."}}},"verify":{"url":"https://api.notthelivesite.com/v1/credits/topup/intent/xp_00000000example0","method":"GET","auth":"bearer","credited_status":"credited","terminal_statuses":["credited","expired","failed","unresolved","duplicate"],"poll_seconds":5}},"schema":{"$ref":"#/components/schemas/TopUpIntent"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/v1/pay/topup":{"post":{"description":"The way in for a wallet with no account. Takes no Authorization header, because the caller has none -- that is the situation this answers. Mints an unbound intent for amount_cents and returns the URL that pays it and the exact 402 that URL answers with. Nothing is created here: pay the intent and the settlement opens the account, binds it to the wallet that paid, credits it, and returns account_id with api_key once. An intent nobody pays expires after 1h0m0s having created no account and no key. A second payment from a wallet that already has an account is credited to it and returns no key, because the key was already issued.","operationId":"createSignupIntent","requestBody":{"content":{"application/json":{"example":{"amount_cents":500},"schema":{"$ref":"#/components/schemas/TopUpRequest"}}},"required":true},"security":[{}],"summary":"Open an account by paying (no bearer key)","tags":["payments"],"responses":{"201":{"description":"The intent.","content":{"application/json":{"example":{"intent_id":"xp_00000000example0","status":"pending","account_id":"acc_example","amount_cents":500,"credited_cents":0,"balance_credits":0,"tx":null,"payer":null,"detail":null,"created_at":"2026-01-01T00:00:00Z","expires_at":"2026-01-01T01:00:00Z","updated_at":"2026-01-01T00:00:00Z","payment":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","method":"POST","auth":"none","content_type":"application/json","body":null,"x402":{"version":2,"request_header":"PAYMENT-SIGNATURE","response_header":"PAYMENT-RESPONSE","encoding":"base64(json)","challenge":{"x402Version":2,"error":"payment required","accepts":[{"scheme":"exact","network":"eip155:8453","amount":"5000000","maxAmountRequired":"5000000","resource":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json","payTo":"0x0000000000000000000000000000000000000000","maxTimeoutSeconds":60,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","extra":{"name":"USD Coin","version":"2"}}],"resource":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","description":"Qmarket credits for acc_example","mimeType":"application/json"},"extensions":{"bazaar":{"info":{"input":{"body":{},"bodyType":"json","method":"POST","type":"http"},"output":{"type":"json"}},"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"properties":{"body":{"type":"object"},"bodyType":{"enum":["json"]},"method":{"enum":["GET","POST"]},"type":{"const":"http"}},"required":["type","method"],"type":"object"},"output":{"properties":{"type":{"enum":["json","text"]}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"}}},"chainId":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."},"retry":{"url":"https://api.notthelivesite.com/v1/pay/topup/xp_00000000example0","header":"PAYMENT-SIGNATURE","note":"Sign accepts[0] -- the eip712 field is the document, complete but for from, validAfter, validBefore and nonce -- then send this exact request again, same method and same body and same bearer, with the signed payment in the header named here. X-PAYMENT is accepted for a v1 payload."}},"chain_id":8453,"eip712":{"domain":{"chainId":8453,"name":"USD Coin","verifyingContract":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","version":"2"},"primaryType":"TransferWithAuthorization","types":{"EIP712Domain":[{"name":"name","type":"string"},{"name":"version","type":"string"},{"name":"chainId","type":"uint256"},{"name":"verifyingContract","type":"address"}],"TransferWithAuthorization":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"},{"name":"validAfter","type":"uint256"},{"name":"validBefore","type":"uint256"},{"name":"nonce","type":"bytes32"}]},"message":{"from":"<your address>","nonce":"<0x + 32 random bytes as hex; never reuse one>","to":"0x0000000000000000000000000000000000000000","validAfter":"<unix seconds, a few minutes in the past>","validBefore":"<unix seconds, at most 60 ahead of now>","value":"5000000"},"fill":"Replace from, validAfter, validBefore and nonce; sign the result with eth_signTypedData_v4 (the domain is the USDC contract's, not this service's). Then send base64({\"x402Version\":2,\"payload\":{\"signature\":<sig>,\"authorization\":<message>},\"accepted\":<the accepts entry you signed>}) in the PAYMENT-SIGNATURE header. A v1 payload in X-PAYMENT is still accepted. value and the message fields are decimal strings."}}},"verify":{"url":"https://api.notthelivesite.com/v1/credits/topup/intent/xp_00000000example0","method":"GET","auth":"bearer","credited_status":"credited","terminal_statuses":["credited","expired","failed","unresolved","duplicate"],"poll_seconds":5}},"schema":{"$ref":"#/components/schemas/TopUpIntent"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/pay/topup/{id}":{"post":{"description":"The wallet half of the intent. No body, no Authorization header. Without X-PAYMENT: the 402 for the intent's amount. With it: settle and credit the intent's account, answering 200 with X-Payment-Response. Idempotent -- the same payment retried answers the same result with replay: true, and a settlement whose credit did not land the first time is completed rather than charged again. A refused payment answers 402 again with error naming why; nothing was charged and the intent stays payable.","operationId":"payTopUpIntent","parameters":[{"description":"Intent id.","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/paymentSignature"},{"$ref":"#/components/parameters/xPayment"}],"security":[{"x402Payment":[]},{}],"summary":"Pay a top-up intent (no bearer key)","tags":["payments"],"responses":{"200":{"description":"Credited.","headers":{"PAYMENT-RESPONSE":{"$ref":"#/components/headers/PAYMENT-RESPONSE"},"X-Payment-Response":{"$ref":"#/components/headers/X-Payment-Response"}},"content":{"application/json":{"example":{"intent_id":"xp_00000000example0","credited_cents":500,"balance_credits":1250,"tx":"0xabc123","replay":false},"schema":{"$ref":"#/components/schemas/TopUpResult"}}}},"402":{"$ref":"#/components/responses/PaymentRequired"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"410":{"$ref":"#/components/responses/Gone"},"502":{"$ref":"#/components/responses/SettlementUnresolved"},"503":{"$ref":"#/components/responses/X402NotConfigured"}}}},"/v1/ledger/credits":{"get":{"operationId":"creditsLedger","security":[{"bearerAuth":[]}],"summary":"Credit balance and recent entries","tags":["payments"],"responses":{"200":{"description":"The ledger, newest first, 100 entries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsLedger"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/ledger/royalties":{"get":{"operationId":"royaltiesLedger","security":[{"bearerAuth":[]}],"summary":"Royalty accruals","tags":["payments"],"responses":{"200":{"description":"Accruals by artifact and role.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoyaltiesLedger"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/watches":{"post":{"description":"Follow an entity or an existing question. Entity keys are trimmed and uppercased; question ids are case-sensitive. Repeated writes are idempotent. Feed and update delivery are planned.","operationId":"watch","requestBody":{"content":{"application/json":{"example":{"key":"q_68b0c1d2a1b2c3d4e5","kind":"question"},"schema":{"$ref":"#/components/schemas/WatchRequest"}}},"required":true},"security":[{"bearerAuth":[]}],"summary":"Follow an entity or a question","tags":["accounts"],"x-qmarket-demo":true,"responses":{"200":{"description":"Watching.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}},"delete":{"description":"The undo for POST /v1/watches, with the same key in the query string rather than a body. Unfollowing something you were not following answers 200: the caller is in the state they asked for, and reporting a failure for arriving at the right answer only invites a retry that cannot help.","operationId":"unwatch","parameters":[{"description":"What the key names. Defaults to entity.","in":"query","name":"kind","schema":{"enum":["entity","question"],"type":"string"}},{"description":"The entity or question id to stop following. Entity keys are matched case-insensitively; a question id is not.","in":"query","name":"key","schema":{"type":"string"}}],"security":[{"bearerAuth":[]}],"summary":"Stop following an entity or a question","tags":["accounts"],"responses":{"200":{"description":"Not following it any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ok"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/v1/auth/demo":{"post":{"x-qmarket-demo":true,"summary":"Create a labelled demo account with demo credits, without Privy","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"201":{"description":"Synthetic account and bearer key shown once. Credits have no cash value.","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"api_key":{"type":"string"},"balance_credits":{"type":"integer"},"demo":{"type":"boolean","enum":[true]}},"required":["account_id","api_key","balance_credits","demo"]}}}},"400":{"description":"Invalid JSON object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Database unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/activity":{"get":{"x-qmarket-demo":true,"summary":"Public demo activity, newest first","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Activity events.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DemoActivityEntry"}}}}},"400":{"description":"Invalid query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Question not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/questions/{qid}/activity":{"get":{"x-qmarket-demo":true,"summary":"Public demo activity, newest first","parameters":[{"schema":{"type":"string"},"required":true,"name":"qid","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Activity events.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DemoActivityEntry"}}}}},"400":{"description":"Invalid query.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Question not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/auth/privy":{"post":{"x-qmarket-demo":true,"summary":"Resolve a verified Privy identity","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identity_token":{"type":"string","minLength":1}},"required":["identity_token"]}}}},"responses":{"200":{"description":"Account; demo credits are granted once.","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"display_name":{"type":"string"},"balance_credits":{"type":"integer"},"demo":{"type":"boolean"}},"required":["account_id","display_name","balance_credits","demo"]}}}},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid identity token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Identity verifier unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"x-qmarket-demo":true,"summary":"Current account and safe key metadata","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Account and activity summaries; API key secrets and hashes are never returned.","content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["human","agent"]},"display_name":{"type":"string"}},"required":["id","kind","display_name"]},"account_id":{"type":"string"},"kind":{"type":"string","enum":["human","agent"]},"display_name":{"type":"string"},"balance_cents":{"type":"integer"},"demo":{"type":"boolean"},"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"revoked_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","prefix","created_at","revoked_at"]}},"contributions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question_id":{"type":"string"},"account_id":{"type":"string"},"amount_cents":{"type":"integer"},"rail":{"type":"string","enum":["credits","x402"]},"created_at":{"type":"string","format":"date-time"},"completed_round":{"type":"boolean"},"run_id":{"type":"string","nullable":true},"demo":{"type":"boolean"}},"required":["id","question_id","account_id","amount_cents","rail","created_at","completed_round","run_id","demo"]}},"purchases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account_id":{"type":"string","nullable":true},"revision_id":{"type":"string"},"artifact_id":{"type":"string"},"price_cents":{"type":"integer"},"rail":{"type":"string","enum":["credits","x402"]},"wallet_address":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"}},"required":["id","account_id","revision_id","artifact_id","price_cents","rail","wallet_address","created_at"]}}},"required":["account","account_id","kind","display_name","balance_cents","demo","keys","contributions","purchases"]}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/accounts/keys":{"post":{"x-qmarket-demo":true,"summary":"Mint an API key for an authenticated human","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Key secret shown once.","content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string"},"api_key":{"type":"string"},"prefix":{"type":"string","enum":["qm_sk_"]},"created_at":{"type":"string","format":"date-time"}},"required":["key_id","api_key","prefix","created_at"]}}}},"401":{"description":"Authentication required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Human account required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}