{"openapi":"3.1.0","info":{"title":"What's the Token API","version":"1.0.0","description":"Versioned, provenance-backed public list prices for AI inference. Read routes require no authentication; administrative routes require the exact owner identity through Cloudflare Access."},"servers":[{"url":"https://whatsthetoken.com"}],"security":[],"paths":{"/v1/price":{"get":{"summary":"Resolve exactly one current rate card","description":"Resolves a provider-scoped identifier and echoes the exact model query as requested_model.","parameters":[{"name":"provider","in":"query","required":true,"schema":{"type":"string"}},{"name":"model","in":"query","required":true,"description":"Provider-scoped identifier echoed exactly as requested_model.","schema":{"type":"string"}},{"name":"service_family","in":"query","schema":{"type":"string","minLength":1}},{"name":"customer_tier","in":"query","schema":{"type":"string","minLength":1}},{"name":"mode","in":"query","schema":{"type":"string"}},{"name":"region","in":"query","schema":{"type":"string"}},{"name":"schedule","in":"query","schema":{"type":"string"}},{"name":"context_tokens","in":"query","description":"Numeric selector for the provider's pricing threshold band. Inspect conditions.dimensions.thresholdRule to determine whether the provider applies the threshold to input tokens, prompt tokens, or generic context size.","schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"as_of","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"include_provisional","in":"query","schema":{"type":"boolean","default":false}},{"name":"dimension","in":"query","style":"deepObject","explode":true,"description":"Up to 20 provider-specific exact-match filters, for example dimension[pricingPeriod]=peak. Keys must match ^[A-Za-z][A-Za-z0-9_-]{0,63}$.","schema":{"type":"object","maxProperties":20,"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":256}}}],"responses":{"200":{"description":"One unambiguous price"},"401":{"description":"Invalid supplied Access credential, or exact owner identity required by the requested operation"},"404":{"description":"No matching rate"},"409":{"description":"Price query is ambiguous"}}}},"/v1/prices":{"get":{"summary":"List matching current rate cards","description":"Returns one item per rate card. requested_model is null without a model filter; identifiers contains the deterministic set valid at as_of.","parameters":[{"name":"provider","in":"query","required":false,"schema":{"type":"string"}},{"name":"model","in":"query","required":false,"description":"Provider-scoped identifier echoed exactly as requested_model.","schema":{"type":"string"}},{"name":"service_family","in":"query","schema":{"type":"string","minLength":1}},{"name":"customer_tier","in":"query","schema":{"type":"string","minLength":1}},{"name":"mode","in":"query","schema":{"type":"string"}},{"name":"region","in":"query","schema":{"type":"string"}},{"name":"schedule","in":"query","schema":{"type":"string"}},{"name":"context_tokens","in":"query","description":"Numeric selector for the provider's pricing threshold band. Inspect conditions.dimensions.thresholdRule to determine whether the provider applies the threshold to input tokens, prompt tokens, or generic context size.","schema":{"type":"string","pattern":"^[0-9]+$"}},{"name":"as_of","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"include_provisional","in":"query","schema":{"type":"boolean","default":false}},{"name":"dimension","in":"query","style":"deepObject","explode":true,"description":"Up to 20 provider-specific exact-match filters, for example dimension[pricingPeriod]=peak. Keys must match ^[A-Za-z][A-Za-z0-9_-]{0,63}$.","schema":{"type":"object","maxProperties":20,"propertyNames":{"pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$"},"additionalProperties":{"type":"string","minLength":1,"maxLength":256}}}],"responses":{"200":{"description":"Successful response"},"401":{"description":"Invalid supplied Access credential, or exact owner identity required by the requested operation"},"404":{"description":"No matching rate"},"409":{"description":"Price query is ambiguous"}}}},"/v1/providers":{"get":{"summary":"List provider source health","description":"Uses the configured 24-hour verification threshold. Each row retains exact last_verified_at provenance and separately exposes the newest global sweep through latest_refresh_run_id, latest_refresh_run_started_at, latest_refresh_run_completed_at, latest_refresh_outcome, and latest_refresh_error. A provider may be fresh while its newest sweep outcome is failed.","responses":{"200":{"description":"Successful response"},"401":{"description":"Invalid supplied Access credential, or exact owner identity required by the requested operation"},"404":{"description":"No matching rate"},"409":{"description":"Price query is ambiguous"}}}},"/v1/health":{"get":{"summary":"Return dataset and source health","description":"Returns freshness_threshold_seconds and the newest persisted global sweep as latest_refresh_run. Run status is running, healthy, attention, partial, or failed; provider outcomes are pending, published, unchanged, pending_review, or failed. Running and missing runs fail closed. A running run older than timeout_seconds is_stalled.","responses":{"200":{"description":"Successful response"},"401":{"description":"Invalid supplied Access credential, or exact owner identity required by the requested operation"},"404":{"description":"No matching rate"},"409":{"description":"Price query is ambiguous"}}}},"/v1/sources/{fetchId}":{"get":{"summary":"Return public source snapshot metadata","description":"Returns public provenance metadata, including refresh_run_id when the observation belongs to a full sweep. Archived source bytes are intentionally omitted from the public API contract.","parameters":[{"name":"fetchId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"},"401":{"description":"Invalid supplied Access credential, or exact owner identity required by the requested operation"},"404":{"description":"No matching rate"},"409":{"description":"Price query is ambiguous"}}}},"/v1/events":{"post":{"summary":"Record a privacy-minimized product engagement event","description":"Accepts only the documented event/context allowlist. Search terms, model queries, email, IP addresses, raw URLs, and raw user-agent strings are never accepted as event fields.","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"required":["event"],"properties":{"event":{"const":"page_view"}}},{"type":"object","additionalProperties":false,"required":["event","context"],"properties":{"event":{"const":"price_filter"},"context":{"const":"submitted"}}},{"type":"object","additionalProperties":false,"required":["event","context"],"properties":{"event":{"const":"provider_filter"},"context":{"enum":["all","anthropic","cerebras","deepseek","fireworks","google-ai","groq","openai","together","xai"]}}},{"type":"object","additionalProperties":false,"required":["event","context"],"properties":{"event":{"const":"sort_change"},"context":{"enum":["default","input-asc","input-desc","cached-asc","cached-desc","output-asc","output-desc"]}}},{"type":"object","additionalProperties":false,"required":["event","context"],"properties":{"event":{"const":"curl_copy"},"context":{"enum":["hero","docs"]}}},{"type":"object","additionalProperties":false,"required":["event","context"],"properties":{"event":{"const":"source_open"},"context":{"enum":["anthropic","cerebras","deepseek","fireworks","google-ai","groq","openai","together","xai"]}}},{"type":"object","additionalProperties":false,"required":["event"],"properties":{"event":{"const":"api_docs_view"}}}]}}}},"responses":{"204":{"description":"Event accepted"},"401":{"description":"Invalid supplied Access credential"},"413":{"description":"Event body exceeds 160 bytes"},"415":{"description":"JSON Content-Type required"},"422":{"description":"Event or context is not allowlisted"}}}},"/v1/admin/refresh":{"post":{"summary":"Refresh official sources (exact owner identity only)","security":[{"cloudflareAccess":[]}],"responses":{"200":{"description":"Authorized administrative response"},"401":{"description":"Exact owner identity required"},"404":{"description":"Change set not found"},"409":{"description":"Stale, non-pending, or integrity-invalid change set"},"422":{"description":"Mandatory review reason missing"}}}},"/v1/admin/changes":{"get":{"summary":"List pending reviewed change sets (exact owner identity only)","security":[{"cloudflareAccess":[]}],"responses":{"200":{"description":"Authorized administrative response"},"401":{"description":"Exact owner identity required"},"404":{"description":"Change set not found"},"409":{"description":"Stale, non-pending, or integrity-invalid change set"},"422":{"description":"Mandatory review reason missing"}}}},"/v1/admin/changes/{changeSetId}/approve":{"post":{"summary":"Approve and atomically publish one pending change set","security":[{"cloudflareAccess":[]}],"parameters":[{"name":"changeSetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Authorized administrative response"},"401":{"description":"Exact owner identity required"},"404":{"description":"Change set not found"},"409":{"description":"Stale, non-pending, or integrity-invalid change set"},"422":{"description":"Mandatory review reason missing"}}}}},"components":{"securitySchemes":{"cloudflareAccess":{"type":"apiKey","in":"header","name":"Cf-Access-Token","description":"Client-supplied short-lived Access application token obtained after owner login. Service-token identities are rejected; Cloudflare injects Cf-Access-Jwt-Assertion only after successful Access authentication."}}}}