TickTape Preflight API
Pre-flight verdicts on live Polymarket orders
Pre-flight verdicts on live Polymarket orders
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/ticktape-cc:ticktape-cc-preflight-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: TickTape Preflight API
version: 1.0.0
summary: Independent pre-flight for Polymarket orders and copy trading.
description: 'OK / CAUTION / VETO verdicts on Polymarket orders and COPY / WATCH / VETO ratings on wallets, always with reasons and numbers. Verdicts are deterministic arithmetic on live order books plus Polymarket''s published 2026 taker-fee schedule (fee/share = rate * p * (1-p)) - not predictions and not investment advice. No custody, no execution, no account required. Humans can read. Agents can buy.
Access model: live calls are paid from the first request - HTTP 402 is the whole onboarding. Every live endpoint returns HTTP 402 with x402 payment requirements (USDC on Base) until paid. Free: append `sandbox=1` to any of the four tools for a deterministic example response (unlimited, never charged); append `x402_probe=1` to see payment requirements without paying; preflight_copy QUEUED responses are always free. Fast lane: buy credits once via POST /api/credits and authenticate with a bearer token (~0.4s responses, half price per call).
Operator safety (enforce in code, not prompts): never pay more than $0.10 per TickTape call; set a daily spend cap; only pay endpoints under https://ticktape.cc/; verify payTo matches https://ticktape.cc/llms.txt; asset must be USDC on Base (eip155:8453, 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913); on retry reuse the same payment authorization.
Canonical machine spec: https://ticktape.cc/llms.txt. Machine manifest: https://ticktape.cc/agent.json. Versioning: date-based via the X-API-Version response header (current 2026-07-14); breaking changes bump the date and are announced in llms.txt. Long-running wallet computations use an async-job pattern: HTTP 202 + Retry-After on /api/preflight_copy (QUEUED), poll the same call until 200.'
contact:
name: TickTape
email: hello@ticktape.cc
url: https://ticktape.cc
termsOfService: https://ticktape.cc/terms
servers:
- url: https://ticktape.cc
description: Production (Cloudflare Pages Functions)
tags:
- name: preflight
description: Pre-flight verdicts on live Polymarket orders
paths:
/api/preflight_trade:
get:
operationId: preflightTradeGet
tags:
- preflight
summary: Pre-flight verdict for a Polymarket order
description: 'Deterministic arithmetic on the live CLOB book plus the 2026 taker-fee schedule. Identify the market by `slug` + `outcome` (polymarket.com/event/ URLs work; for multi-outcome events pass a candidate name, partial match OK - a wrong outcome returns the candidate list) or by `token_id`. Live calls are paid from the first request: HTTP 402 (x402). Price per call: $0.02 USDC, or 1 credit with a bearer token. Free integration testing: `sandbox=1`.'
security:
- {}
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/slug'
- $ref: '#/components/parameters/outcome'
- $ref: '#/components/parameters/tokenId'
- $ref: '#/components/parameters/side'
- $ref: '#/components/parameters/usd'
- $ref: '#/components/parameters/maxSlippageC'
- $ref: '#/components/parameters/vetoSlippageC'
- $ref: '#/components/parameters/maxBookAgeS'
- $ref: '#/components/parameters/sandbox'
- $ref: '#/components/parameters/x402Probe'
- $ref: '#/components/parameters/paymentSignatureHeader'
- $ref: '#/components/parameters/xPaymentHeader'
- name: Idempotency-Key
in: header
required: false
schema:
type: string
description: Optional client idempotency key; paid responses are also idempotent per x402 payment authorization (same signed authorization -> cached response, never double-charged)
responses:
'200':
$ref: '#/components/responses/PreflightTradeOk'
'400':
description: Error (JSON, never HTML). 4xx errors are never charged.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
$ref: '#/components/responses/PaymentRequired'
'500':
description: Server error (JSON, never HTML) - never charged; retry with the same payment authorization returns the cached response if the charge went through.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
operationId: preflightTradePost
tags:
- preflight
summary: Pre-flight verdict for a Polymarket order (JSON body)
description: Same behavior as GET; parameters go in the JSON body. `sandbox` and `x402_probe` are also accepted as query parameters.
security:
- {}
- bearerAuth: []
parameters:
- $ref: '#/components/parameters/sandbox'
- $ref: '#/components/parameters/x402Probe'
- $ref: '#/components/parameters/paymentSignatureHeader'
- $ref: '#/components/parameters/xPaymentHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PreflightTradeRequest'
example:
slug: bitcoin-up-or-down-july-13-3pm-et
outcome: Up
side: BUY
usd: 250
max_slippage_c: 1.0
veto_slippage_c: 3.0
max_book_age_s: 60
responses:
'200':
$ref: '#/components/responses/PreflightTradeOk'
'400':
description: Error (JSON, never HTML). 4xx errors are never charged.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'402':
$ref: '#/components/responses/PaymentRequired'
'500':
description: Server error (JSON, never HTML) - never charged; retry with the same payment authorization returns the cached response if the charge went through.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Paid:
type: object
description: 'Payment record attached to paid responses. Per-call x402 settlement: {price_paid_usdc, transaction, network, receipt}. Credit-lane (bearer token) calls: {credits_used, credits_remaining}. Absent on sandbox and free QUEUED responses.'
properties:
price_paid_usdc:
type: string
description: USDC actually settled for this call, as a decimal string (e.g. "0.02").
transaction:
type: string
description: On-chain settlement transaction hash.
network:
type: string
description: CAIP-2 network id, eip155:8453 (Base).
receipt:
type:
- string
- 'null'
format: uri
description: Basescan transaction link for the on-chain settlement.
credits_used:
type: integer
description: Credits debited for this call (credit-lane only).
credits_remaining:
type: integer
description: Credits left on the wallet after this call (credit-lane only).
PreflightTradeRequest:
type: object
description: Identify the market by slug + outcome, or by token_id.
properties:
slug:
type: string
description: Polymarket market or event slug; full event URLs accepted.
outcome:
type: string
description: Outcome to price (partial match OK for multi-outcome events).
token_id:
type: string
description: CLOB token id - alternative to slug + outcome.
side:
type: string
enum:
- BUY
- SELL
default: BUY
usd:
type: number
default: 100
exclusiveMinimum: 0
description: Order size in USD.
max_slippage_c:
type: number
default: 1.0
veto_slippage_c:
type: number
default: 3.0
max_book_age_s:
type: number
default: 60
PreflightTradeResponse:
type: object
required:
- ok
- verdict
- reasons
- market
- order
- numbers
properties:
ok:
type: boolean
verdict:
type: string
enum:
- OK
- CAUTION
- VETO
description: Deterministic verdict on executing this order now, at this size, on this book. Not a prediction of the market outcome.
reasons:
type: array
items:
type: string
description: Human- and machine-readable reasons, each carrying the number that triggered it.
market:
type: object
properties:
slug:
type:
- string
- 'null'
question:
type:
- string
- 'null'
outcome:
type:
- string
- 'null'
token_id:
type: string
description: The market the verdict was computed for.
order:
type: object
properties:
side:
type: string
enum:
- BUY
- SELL
usd:
type: number
description: The order as understood by the endpoint.
numbers:
type: object
properties:
best_price:
type: number
description: Best available price on the relevant side of the book.
expected_vwap:
type: number
description: Volume-weighted average fill price for the requested size.
expected_slippage_cents:
type: number
description: expected_vwap minus best_price, in cents per share.
visible_depth_usd:
type: number
description: Visible depth on the relevant side, in USD.
order_vs_depth_pct:
type: number
description: Order size as a percentage of visible depth.
taker_fee_usd:
type: number
description: Total taker fee for this order under the 2026 schedule.
fee_drag_cents_per_share:
type: number
description: Taker fee expressed in cents per share (rate * p * (1-p)).
fee_category:
type: string
description: Fee schedule category applied to this market.
safe_size_usd:
type: number
description: Largest order size that would still pass the OK thresholds on this book.
book_age_seconds:
type: number
description: Age of the order-book snapshot used.
meta:
type: object
description: Present on live-book responses (absent on sandbox examples).
properties:
beta:
type: boolean
method:
type: string
for_whom:
type: string
thresholds:
type: object
properties:
slippage_caution_cents:
type: number
slippage_veto_cents:
type: number
depth_caution_fraction:
type: number
book_stale_veto_seconds:
type: number
note:
type: string
description: Thresholds used for this verdict - defaults, or the caller's max_slippage_c / veto_slippage_c / max_book_age_s overrides.
sandbox:
type: boolean
description: True when the response is the free deterministic sandbox example.
note:
type: string
paid:
$ref: '#/components/schemas/Paid'
Error:
type: object
required:
- error
properties:
error:
type: string
candidates:
type: array
items:
type: string
description: 'For multi-outcome events: valid outcome names when the requested outcome was not found.'
X402PaymentRequiredBody:
type: object
description: x402 v1-style payment requirements (the v2 equivalent is base64-encoded in the PAYMENT-REQUIRED response header).
required:
- accepts
properties:
x402Version:
type: integer
error:
type: string
accepts:
type: array
items:
type: object
required:
- scheme
- network
- maxAmountRequired
- asset
- payTo
- resource
properties:
scheme:
type: string
const: exact
network:
type: string
description: '"base" in v1 payloads; CAIP-2 eip155:8453 in v2 headers.'
maxAmountRequired:
type: string
description: 'Atomic USDC units (6 decimals): "20000" = $0.02, "100000" = $0.10, "5000000" = $5.'
asset:
type: string
description: 'USDC on Base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. Refuse anything else.'
payTo:
type: string
description: Must equal 0xb28bcb21a054ffeeb6ce62d0f1bb0175c022d2c6 - verify against https://ticktape.cc/llms.txt before signing.
resource:
type: string
format: uri
description: Must be under https://ticktape.cc/ - never pay for resources elsewhere.
description:
type: string
maxTimeoutSeconds:
type: integer
parameters:
slug:
name: slug
in: query
description: Polymarket market or event slug. Full polymarket.com/event/<slug> URLs are accepted. Required unless token_id is given.
schema:
type: string
example: bitcoin-up-or-down-july-13-3pm-et
outcome:
name: outcome
in: query
description: Outcome to price. For multi-outcome events pass a candidate name (partial match OK); a wrong outcome returns the candidate list. Required with slug for multi-outcome events.
schema:
type: string
example: Up
sandbox:
name: sandbox
in: query
description: Set to 1 for a free deterministic example response. Never rate-limited, never charged. Use it to wire up parsing before paying.
schema:
type: integer
enum:
- 1
side:
name: side
in: query
description: Order side.
schema:
type: string
enum:
- BUY
- SELL
default: BUY
x402Probe:
name: x402_probe
in: query
description: Set to 1 to receive the HTTP 402 payment requirements for this call without paying. Free, always.
schema:
type: integer
enum:
- 1
tokenId:
name: token_id
in: query
description: CLOB token id - alternative to slug + outcome.
schema:
type: string
xPaymentHeader:
name: X-PAYMENT
in: header
description: 'x402 v1 (also accepted): signed payment payload, base64-encoded, built from the 402 JSON body''s accepts[]. Reuse the same payment authorization on retries.'
schema:
type: string
contentEncoding: base64
maxBookAgeS:
name: max_book_age_s
in: query
description: 'Threshold override: maximum acceptable order-book age in seconds.'
schema:
type: number
default: 60
maxSlippageC:
name: max_slippage_c
in: query
description: 'Threshold override: slippage in cents above which the verdict degrades from OK to CAUTION.'
schema:
type: number
default: 1.0
paymentSignatureHeader:
name: PAYMENT-SIGNATURE
in: header
description: 'x402 v2 (primary): signed payment payload, base64-encoded. Send it when retrying a request that returned 402 with a PAYMENT-REQUIRED header. Reuse the same payment authorization on retries - the response is cached and never double-charged.'
schema:
type: string
contentEncoding: base64
vetoSlippageC:
name: veto_slippage_c
in: query
description: 'Threshold override: slippage in cents at which the verdict becomes VETO.'
schema:
type: number
default: 3.0
usd:
name: usd
in: query
description: Order size in USD.
schema:
type: number
default: 100
exclusiveMinimum: 0
responses:
PreflightTradeOk:
description: 'Verdict computed. When settled via per-call x402, the response includes a `paid` object (`price_paid_usdc`, `receipt`), and (x402 v2) a PAYMENT-RESPONSE header. Credit-lane calls get `paid: {credits_used, credits_remaining}` instead. With `sandbox=1`, top-level `sandbox` is true and the numbers are a deterministic example, not a live book.'
headers:
PAYMENT-RESPONSE:
$ref: '#/components/headers/PaymentResponse'
content:
application/json:
schema:
$ref: '#/components/schemas/PreflightTradeResponse'
example:
ok: true
verdict: CAUTION
reasons:
- slippage 1.6c per share - consider ~$130 instead
- order is 12.4% of visible depth
market:
slug: example-market
question: Will the example team win?
outcome: 'Yes'
token_id: 0x1234...
order:
side: BUY
usd: 250
numbers:
best_price: 0.52
expected_vwap: 0.536
expected_slippage_cents: 1.6
visible_depth_usd: 2012.5
order_vs_depth_pct: 12.4
taker_fee_usd: 1.87
fee_drag_cents_per_share: 0.4
fee_category: standard
safe_size_usd: 130
book_age_seconds: 3
meta:
beta: true
method: deterministic arithmetic on the live CLOB book + Polymarket's published 2026 fee schedule (rate*p*(1-p)). No model, no prediction.
thresholds:
slippage_caution_cents: 1.0
slippage_veto_cents: 3.0
book_stale_veto_seconds: 60
note: defaults - override via max_slippage_c, veto_slippage_c, max_book_age_s
paid:
price_paid_usdc: '0.02'
transaction: 0xabc123...
network: eip155:8453
receipt: https://basescan.org/tx/0xabc123...
PaymentRequired:
description: 'Live calls are paid from the first request (there is no free live tier), or `x402_probe=1` was set. Pay with x402 to proceed - dual-stack:
- x402 v2 (primary): this response carries base64-encoded payment requirements in the PAYMENT-REQUIRED response header (network CAIP-2 `eip155:8453`). Retry the identical request with the PAYMENT-SIGNATURE request header. The paid 200 carries a PAYMENT-RESPONSE header.
- x402 v1 (also accepted): the JSON body carries the same requirements in `accepts[]` (network `"base"`). Retry with the X-PAYMENT request header.
Asset: USDC on Base only (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913). payTo: 0xb28bcb21a054ffeeb6ce62d0f1bb0175c022d2c6 - verify against https://ticktape.cc/llms.txt before signing. Per-call settlement is on-chain and adds ~2-5s (congestion tails longer); the credit lane (POST /api/credits + bearer token) responds in ~0.4s. Retrying with the SAME payment authorization returns the cached response and never double-charges. Facilitator: Coinbase CDP; settlement synchronous.'
headers:
PAYMENT-REQUIRED:
$ref: '#/components/headers/PaymentRequired'
content:
application/json:
schema:
$ref: '#/components/schemas/X402PaymentRequiredBody'
example:
x402Version: 1
error: 'live calls are paid: $0.02 via x402 (v2 PAYMENT-SIGNATURE or v1 X-PAYMENT), or use credits (POST /api/credits). Free integration testing: ?sandbox=1'
accepts:
- scheme: exact
network: base
maxAmountRequired: '20000'
asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'
payTo: '0xb28bcb21a054ffeeb6ce62d0f1bb0175c022d2c6'
resource: https://ticktape.cc/api/preflight_trade
description: TickTape preflight_trade - one call
maxTimeoutSeconds: 60
headers:
PaymentRequired:
description: 'x402 v2 (primary): base64-encoded payment requirements. Decode, sign a payment authorization for exactly these terms (asset USDC on Base eip155:8453 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, payTo 0xb28bcb21a054ffeeb6ce62d0f1bb0175c022d2c6 - verify against https://ticktape.cc/llms.txt), then retry with the PAYMENT-SIGNATURE request header.'
schema:
type: string
contentEncoding: base64
PaymentResponse:
description: 'x402 v2: base64-encoded settlement confirmation for a paid call (facilitator: Coinbase CDP; settlement synchronous). Present only when the call was settled per-call via PAYMENT-SIGNATURE.'
schema:
type: string
contentEncoding: base64
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: tk_<wallet>_<secret>
description: Credit-lane bearer token issued by POST /api/credits. Treat it as a secret. The last 5 tokens per wallet stay valid; credits are valid 12 months. Authenticated calls skip x402 settlement, respond in ~0.4s, and debit credits (preflight_trade / leaderboard / red_list = 1 credit; preflight_copy = 5 credits).