{"openapi":"3.1.0","info":{"title":"Trust Cue public API","version":"1.0.0","description":"Read what an X account's public posts show — a rating that lives at most 7 days, each point tied to the posts behind it — and buy one full rating through Stripe MPP machine payment or hosted Checkout. Not an endorsement, and not financial advice."},"x-service-info":{"categories":["trust-and-safety","social-media"],"docs":{"apiReference":"/openapi.json","homepage":"https://trustcue.app/for-ai","llms":"https://trustcue.app/llms.txt"}},"servers":[{"url":"https://api.trustcue.app"}],"paths":{"/v1/public/config":{"get":{"summary":"Discover public pricing and agent-payment availability","responses":{"200":{"description":"Public product and payment configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicConfig"}}}}}}},"/v1/public/snapshots/{handle}":{"get":{"summary":"Read the preview of an X account's current rating","description":"The preview of a live rating: who the account is, how many posts were read over what span and when, the measured facts, the leading topics and, once readers have proven it, a one-line summary. Every response carries an offer to buy the full rating. 404 when no rating is live.","parameters":[{"name":"handle","in":"path","required":true,"schema":{"type":"string"},"description":"X handle without the @."}],"responses":{"200":{"description":"A live rating's preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewResponse"}}}},"404":{"description":"No live rating; the body carries an offer to buy one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotAvailable"}}}}}}},"/v1/public/samples":{"get":{"summary":"List the sample ratings","responses":{"200":{"description":"Sample ratings, each dated to its capture."}}}},"/v1/public/agent-ratings":{"post":{"summary":"Buy one full rating with an agent payment","description":"Preferred machine-to-machine path. Returns an MPP 402 challenge when no payment credential is present. Retry the identical request with the authorised credential to pay through Stripe and receive a Payment-Receipt header plus URLs for the asynchronous result. The amount is fixed by Trust Cue.","x-payment-info":{"offers":[{"currency":"usd","description":"One Trust Cue rating of an X account","intent":"charge","method":"stripe"}]},"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"A random, high-entropy opaque value (a UUID is recommended). Reuse it for the authorised retry and safe network retries."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["handle"],"properties":{"handle":{"type":"string","description":"X handle without the @."}}}}}},"responses":{"202":{"description":"Payment accepted and the check started. Includes a Payment-Receipt header.","headers":{"Payment-Receipt":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineRatingState"}}}},"402":{"description":"MPP payment challenge. Authorize it with an MPP-compatible wallet and retry the identical request.","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}}},"409":{"description":"The idempotency key is bound to another request."},"503":{"description":"MPP is not configured; use the hosted Checkout fallback."}}}},"/v1/public/agent-ratings/{offerId}":{"get":{"summary":"Poll an agent rating purchase","description":"The durable fulfillment or refund state. Supply the Idempotency-Key used to create and pay for the offer. Once fulfilled, rating_url opens the full rating while it lives.","parameters":[{"name":"offerId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":200,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The original opaque purchase key; it authorizes access to this purchase's state."}],"responses":{"200":{"description":"Current purchase and fulfillment state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineRatingState"}}}},"404":{"description":"No purchase matches both the offer ID and purchase key."},"429":{"description":"Polling is too frequent; honor Retry-After."}}}},"/v1/public/rating-offers":{"post":{"summary":"Buy one full rating through hosted Checkout","description":"Creates a hosted Stripe Checkout session for one rating. Agents capable of MPP should prefer /v1/public/agent-ratings. After payment, result_url opens the rating when it is ready.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["handle"],"properties":{"handle":{"type":"string","description":"X handle without the @."}}}}}},"responses":{"200":{"description":"A checkout URL, and the page that opens the rating after payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RatingOffer"}}}}}}}},"components":{"schemas":{"PublicConfig":{"type":"object","required":["prices","agent_payments"],"properties":{"prices":{"type":"object","description":"Current public display prices in integer USD cents."},"agent_payments":{"type":"object","required":["available","protocol","endpoint","fallback_endpoint"],"properties":{"available":{"type":"boolean"},"protocol":{"const":"mpp"},"endpoint":{"type":"string","format":"uri"},"fallback_endpoint":{"type":"string","format":"uri"}}}}},"PreviewResponse":{"type":"object","properties":{"rating":{"type":"object","description":"Identity, coverage (posts read, span, checked and expiry times), measured facts, leading topics and a proven summary. No post text."},"offer":{"$ref":"#/components/schemas/OfferPointer"},"disclaimer":{"type":"string"},"methodology_url":{"type":"string","format":"uri"}}},"NotAvailable":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","example":"RATING_NOT_AVAILABLE"},"offer":{"$ref":"#/components/schemas/OfferPointer"}}},"OfferPointer":{"type":"object","properties":{"method":{"type":"string","example":"POST"},"url":{"type":"string","format":"uri"},"body":{"type":"object"},"price_usd":{"type":["number","null"]},"machine_payment":{"type":"object","properties":{"available":{"type":"boolean"},"protocol":{"const":"mpp"},"method":{"const":"POST"},"url":{"type":"string","format":"uri"},"headers":{"type":"object"},"body":{"type":"object"}}},"note":{"type":"string"}}},"RatingOffer":{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri"},"result_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}},"MachineRatingState":{"type":"object","required":["status","offer_id","status_url","result_url","read_url","amount","request_expires_at","poll_after_seconds"],"properties":{"status":{"type":"string","enum":["awaiting_payment","processing","refunding","fulfilled","refunded","cancelled","expired"]},"offer_id":{"type":"string","format":"uuid"},"status_url":{"type":"string","format":"uri"},"result_url":{"type":"string","format":"uri"},"read_url":{"type":"string","format":"uri"},"rating_url":{"type":"string","format":"uri","description":"Present once fulfilled: the full rating, while it lives."},"rating_expires_at":{"type":"string","format":"date-time"},"amount":{"type":"object","required":["value","currency"],"properties":{"value":{"type":"string","pattern":"^[0-9]+\\.[0-9]{2}$"},"currency":{"const":"usd"}}},"request_expires_at":{"type":"string","format":"date-time"},"poll_after_seconds":{"oneOf":[{"type":"integer","minimum":1},{"type":"null"}]},"idempotent_replay":{"type":"boolean"},"message":{"type":"string"}}}}}}