{"openapi":"3.1.0","info":{"title":"OpenMayhem API","version":"1.0.0","description":"Pay-per-use AI inference over a decentralised provider network. OpenAI-compatible where an equivalent exists. Billing is reserve-then-settle from prepaid credit; every charge settles against a provider-signed receipt. Human docs: https://openmayhem.ai/docs (each page also at /docs/<slug>.md)."},"servers":[{"url":"https://api.openmayhem.ai/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/chat/completions":{"post":{"summary":"Chat completion","description":"OpenAI-compatible. Requires the CHAT scope. Streaming defaults to off; explicit stream: true enables progressive server-sent events (SSE). The API forwards emitted deltas without buffering the entire output; a provider backend may buffer its own output rather than emit token by token. Native Core durable jobs preserve billing and reconciliation. Disconnecting does not guarantee cancellation or a refund; charges settle exactly from the signed receipt for work performed. Budget with max_tokens. stream_recovery_unavailable means the gateway does not yet support stream recovery: the request fails before inference starts; use stream: false instead. Send an Idempotency-Key header to make retries safe.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{}}}},"max_tokens":{"type":"integer","description":"Budget generously (2000+) for reasoning models; thinking consumes tokens."},"stream":{"type":"boolean","description":"Defaults to false. Set true explicitly for progressive OpenAI-compatible SSE with x-openmayhem-stream-mode: live."},"stream_options":{"type":"object","description":"For streaming Chat Completions, set include_usage: true to receive a final usage chunk after the last delta and before [DONE]. Without this option, the usage chunk is omitted.","properties":{"include_usage":{"type":"boolean"}}}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"With streaming off, an OpenAI-shaped completion plus usage.cost (USD string) and openmayhem.request_id / openmayhem.receipt. With stream: true, text/event-stream with x-openmayhem-stream-mode: live; Chat Completions chunks end with [DONE], preceded by an optional final usage chunk when stream_options.include_usage is true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/completions":{"post":{"summary":"Legacy text completion","description":"Requires the COMPLETIONS scope. Streaming defaults to off; explicit stream: true enables progressive OpenAI-compatible SSE. The API forwards emitted deltas without buffering the entire output; a provider backend may buffer its own output rather than emit token by token. Set stream_options.include_usage: true for a final usage chunk after the last delta and before [DONE]; otherwise that chunk is omitted. Native Core durable jobs preserve billing and reconciliation. Disconnecting does not guarantee cancellation or a refund; charges settle exactly from the signed receipt for work performed. Budget with max_tokens. stream_recovery_unavailable means the gateway does not yet support stream recovery: the request fails before inference starts; use stream: false instead.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"prompt":{"type":"string"},"max_tokens":{"type":"integer"},"stream":{"type":"boolean","description":"Defaults to false. Set true explicitly for progressive OpenAI-compatible SSE with x-openmayhem-stream-mode: live."}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"With streaming off, an OpenAI-shaped completion with usage.cost and openmayhem fields. With stream: true, text/event-stream with x-openmayhem-stream-mode: live; Completions chunks end with [DONE], preceded by an optional final usage chunk when stream_options.include_usage is true."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/responses":{"post":{"summary":"Stateless responses API","description":"Requires the RESPONSES scope. Stateless by design. Streaming defaults to off; explicit stream: true enables progressive SSE using the distinct OpenAI Responses event protocol, not Chat/Completions chunks or their [DONE] terminator. The API forwards emitted deltas without buffering the entire output; a provider backend may buffer its own output rather than emit token by token. Native Core durable jobs preserve billing and reconciliation. Disconnecting does not guarantee cancellation or a refund; charges settle exactly from the signed receipt for work performed. Budget with max_tokens. stream_recovery_unavailable means the gateway does not yet support stream recovery: the request fails before inference starts; use stream: false instead.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"input":{}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"With streaming off, a Responses-shaped result with usage.cost and openmayhem fields. With stream: true, text/event-stream carrying Responses events with x-openmayhem-stream-mode: live."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/embeddings":{"post":{"summary":"Embedding vectors","description":"Requires the EMBEDDINGS scope.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"input":{}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"OpenAI-shaped embedding list with usage.cost."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/decisions":{"post":{"summary":"Typed policy decision","description":"Requires the DECISIONS scope. Native Laya and the Flash JEV decision model evaluate application state against typed choice, score, or yes-or-no questions. Flash JEV may also use /decisions/flash-jev. These endpoints are synchronous, not OpenAI chat endpoints.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","state","questions"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"state":{"description":"A string, object, or message array containing the state to evaluate."},"questions":{"type":"object","description":"Question map. Every entry declares type choice, score, or noul and its instructions; choice and score questions also declare criteria.","additionalProperties":true},"checkpoint":{"type":"string","enum":["english","multilingual","typed-decisions"]},"task":{"type":"string","enum":["typed_decisions"]},"lang":{"type":"string","minLength":1,"maxLength":128},"auto_task_detection":{"type":"boolean","default":false},"email":{"type":"object"},"shortlist":{"type":"object"},"temperature":{"type":"object"},"limits":{"type":"object"}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"Typed answers, checkpoint routing, receipt-backed usage.cost, and openmayhem request evidence."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/decisions/flash-jev":{"post":{"summary":"Flash JEV typed decisions","description":"Requires the DECISIONS scope. Uses openmayhem/flash-jev, a platform-side typed-decision view of the canonical Qwen3.8 Flash-Next chat model. The request is charged at Flash-Next's current input and output token rates; there is no separate tariff. It asks Flash for probabilities in strict JSON and applies the same mechanical validation, bounded normalization (sum error at most 0.051), lexical tie break, weighted score, and request-sourced score legend used in the published evaluation. Confidence is a deterministic concentration display, not an independently calibrated forecast. No label-specific correction is applied. Invalid outputs return 502 after the signed model usage is charged; do not retry an ambiguous outcome as new work. Maximum input is 64,000 exact model tokens across state and questions, and 32,000 for state plus any single question. At most 64 named questions. The decision result is synchronous and does not stream.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["model","state","questions"],"properties":{"model":{"type":"string","enum":["openmayhem/flash-jev"]},"state":{"oneOf":[{"type":"string"},{"type":"object"},{"type":"array"}]},"questions":{"type":"object","minProperties":1,"maxProperties":64,"description":"Map of question IDs to {type, instructions, criteria?}. type is noul, choice or score; choice criteria maps labels to descriptions, and score criteria is an ordered description array.","additionalProperties":{"type":"object"}}}}}}},"responses":{"200":{"description":"decision.result with named, validated decisions; usage.cost and signed receipt evidence."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"The exact model tokenizer found an input above the 64k total or 32k per-question limit; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"502":{"description":"The model produced invalid decision JSON or probabilities; signed usage may still be charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/tokenize":{"post":{"summary":"Exact model tokenization","description":"Returns the serving runtime's exact, chat-template-aware token count. This is a control request: it creates no inference job, credit reservation, receipt, or charge. Models without an exact native tokenizer return token_count_unsupported.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"messages":{"type":"array","items":{"type":"object"}},"prompt":{"type":"string"},"return_tokens":{"type":"boolean","default":false}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"Exact token count, optional token IDs, runtime context limit, and selected provider."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/count_tokens":{"post":{"summary":"Exact model token count","description":"Alias of POST /tokenize. Supply exactly one of messages or prompt. This request is authenticated and rate-limited but never billed.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"messages":{"type":"array","items":{"type":"object"}},"prompt":{"type":"string"},"return_tokens":{"type":"boolean","default":false}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"200":{"description":"Exact tokenization response."},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/estimates":{"post":{"summary":"Estimate an exact billable request","description":"Validates the request with the same model contract, route controls, key limits and live pricing used at execution. Creates no credit hold and no model charge. The estimate expires after ten minutes and is a snapshot, not a price or capacity reservation.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["endpoint","body"],"properties":{"endpoint":{"type":"string","enum":["CHAT","COMPLETIONS","RESPONSES","EMBEDDINGS","DECISIONS","IMAGES","VIDEOS","AUDIO_SPEECH","AUDIO_TRANSCRIPTIONS","AUDIO_GENERATIONS","MUSIC","WORKFLOWS"]},"body":{"type":"object","description":"The exact endpoint request, including model.","additionalProperties":true}}}}}},"responses":{"200":{"description":"Expiring estimate with expected cost, maximum hold, price version and current can_start snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestEstimate"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/balance":{"get":{"summary":"Read API account credit","description":"Requires BILLING_READ. Returns exact posted, reserved and available USD credit. Set include_rails=1 only when the FIAT, TNK and TAP split is needed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"include_rails","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Current account balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks BILLING_READ.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/profile":{"get":{"summary":"Read the API account profile","description":"Requires PROFILE. Returns the stable account identity used by an authorized MCP client. It never returns credentials, payment methods or wallet details.","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Basic linked account profile.","content":{"application/json":{"schema":{"type":"object","required":["id","email"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"nickname":{"type":"string"}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks PROFILE.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/requests/{id}":{"get":{"summary":"Settled usage, cost and receipt for one request","description":"Requires the CHAT scope. The id arrives as openmayhem.request_id in every response body.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Request id from openmayhem.request_id."}],"responses":{"200":{"description":"Request record with settled usage, cost and receipt identity."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Unknown request or owned by another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/images/generations":{"post":{"summary":"Image generation job","description":"Requires the IMAGES scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"prompt":{"type":"string"},"size":{"type":"string","example":"1024x1024"}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/videos":{"post":{"summary":"Video generation job","description":"Requires the VIDEOS scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"prompt":{"type":"string"},"seconds":{"description":"Duration; some contracts type this as a string enum."}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audio/speech":{"post":{"summary":"Text-to-speech job","description":"Requires the AUDIO_SPEECH scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"input":{"type":"string"},"voice":{"type":"string"}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audio/transcriptions":{"post":{"summary":"Speech-to-text job","description":"Requires the AUDIO_TRANSCRIPTIONS scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input_audio"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"input_audio":{"type":"object","properties":{"data":{"type":"string","description":"Base64 audio."},"format":{"type":"string"}}}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audio/generations":{"post":{"summary":"Audio generation job","description":"Requires the AUDIO_GENERATIONS scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"prompt":{"type":"string"}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/music/generations":{"post":{"summary":"Music generation job","description":"Requires the MUSIC scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"prompt":{"type":"string"},"duration":{"type":"number"},"lyrics":{"type":"string"}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/workflows":{"post":{"summary":"ComfyUI workflow-graph job","description":"Requires the WORKFLOWS scope. Returns an asynchronous job.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/MinAttTier"},{"$ref":"#/components/parameters/MinCtx"},{"$ref":"#/components/parameters/Quant"},{"$ref":"#/components/parameters/PreferProviders"},{"$ref":"#/components/parameters/Hedge"},{"$ref":"#/components/parameters/MinTokS"},{"$ref":"#/components/parameters/MaxWaitMs"},{"$ref":"#/components/parameters/MaxRetailCostUsd"},{"$ref":"#/components/parameters/MaxInputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxOutputPricePerMillionUsd"},{"$ref":"#/components/parameters/MaxRepresentativeRequestPriceUsd"},{"$ref":"#/components/parameters/EstimateId"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","workflow"],"properties":{"model":{"type":"string","description":"Catalog model id (vendor/model)."},"workflow":{"type":"object","description":"ComfyUI API-format node graph matching the selected model's signed workflow policy. Start with its approved preset or a request prepared in Studio. Supported dimensions, nodes, model parts and LoRAs are contract-dependent; arbitrary graph changes are not accepted. LoRAs are configured in approved graph nodes, not a universal top-level loras field. Guide: https://openmayhem.ai/docs/media#workflow-api","additionalProperties":true},"input_files":{"type":"array","description":"Reference files required by the graph. Filenames must match its file references; accepted formats and limits depend on the model contract. File contents are base64, not local paths or LoRA weight uploads.","items":{"type":"object","properties":{"filename":{"type":"string"},"content_type":{"type":"string"},"encoding":{"type":"string","enum":["base64"]},"data":{"type":"string"}}}},"timeout_ms":{"type":"integer"},"response_format":{"type":"string","enum":["artifact","json"]}},"additionalProperties":{"description":"Any attribute of the model's signed request contract; see GET /models/by-id?id={url-encoded-id}."}}}}},"responses":{"202":{"description":"The created job. Poll polling_url until a terminal status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"Contract violation; nothing charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"Insufficient credit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"Scope, allowlist, spend limit or account restriction.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"Rate limit; wait Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"No provider capacity; retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/jobs":{"get":{"summary":"List recent jobs","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Recent jobs for the account.","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}}}}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/jobs/{id}":{"get":{"summary":"Poll job status, cost and artifacts","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id."}],"responses":{"200":{"description":"The job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Unknown job or owned by another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"summary":"Cancel a running job","description":"Work the provider already completed is still billed.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Job id."}],"responses":{"200":{"description":"The cancelled job."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Unknown job or owned by another account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/artifacts/{id}":{"get":{"summary":"Download a job artifact","description":"Redirects to a short-lived signed URL. Artifacts are cached for at most 12 hours from job creation and are not backed up.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Artifact id from a completed job."}],"responses":{"302":{"description":"Redirect to the signed download URL."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Unknown, foreign or expired artifact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/artifacts/{id}/link":{"post":{"summary":"Create a short-lived artifact link","description":"Verifies ownership and the job modality scope, then returns a five-minute HTTPS link capped by the artifact's own expiry.","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Artifact id from a completed job."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"download":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Artifact metadata, private URL and expiry."},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"The key lacks the artifact job's modality scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"Unknown, foreign or expired artifact.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/models":{"get":{"summary":"Public model catalog","description":"No auth. Prices, availability, parameters and request contracts per model.","security":[],"parameters":[{"name":"live","in":"query","schema":{"type":"boolean","default":false},"description":"When true, every capability filter is evaluated against routes that are live now. When false or omitted, registered capabilities are used."},{"name":"endpoint_family","in":"query","schema":{"type":"string","enum":["CHAT","COMPLETIONS","RESPONSES","EMBEDDINGS","DECISIONS","IMAGES","VIDEOS","AUDIO_SPEECH","AUDIO_TRANSCRIPTIONS","AUDIO_GENERATIONS","MUSIC","WORKFLOWS"]},"description":"Only models that expose this hosted endpoint family."},{"name":"modality","in":"query","schema":{"type":"string","enum":["text","embedding","decision","image","video","audio","music","workflow"]},"description":"Only models that can produce or consume the requested modality."},{"name":"attestation_tier","in":"query","schema":{"type":"integer","minimum":1,"maximum":4},"description":"Exact tier match. Cannot be combined with min_attestation_tier. With live=true, the exact tier must be live now."},{"name":"min_attestation_tier","in":"query","schema":{"type":"integer","minimum":1,"maximum":4},"description":"Minimum tier match: the route tier must be greater than or equal to this value. Cannot be combined with attestation_tier."},{"name":"max_input_price_per_million_usd","in":"query","schema":{"$ref":"#/components/schemas/CatalogUsdDecimal"},"description":"Maximum retail input-token price in USD per one million tokens."},{"name":"max_output_price_per_million_usd","in":"query","schema":{"$ref":"#/components/schemas/CatalogUsdDecimal"},"description":"Maximum retail output-token price in USD per one million tokens."},{"name":"max_representative_request_price_usd","in":"query","schema":{"$ref":"#/components/schemas/CatalogUsdDecimal"},"description":"Maximum retail cost of the catalog's representative request for that model. This remains unit-aware across token, media, and workflow models."},{"name":"min_context_tokens","in":"query","schema":{"type":"integer","minimum":1,"maximum":4294967295},"description":"Minimum registered or live context capacity in tokens."},{"name":"quantization","in":"query","schema":{"type":"string","minLength":1,"maxLength":32,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$"},"description":"Canonical quantization bucket, for example bf16, nvfp4, int8, or int4. Matching lowercases the value and converts underscores to hyphens."},{"name":"tools","in":"query","schema":{"type":"boolean"},"description":"Filter by native tool/function-call support."},{"name":"structured_output","in":"query","schema":{"type":"boolean"},"description":"Filter by structured JSON output support."},{"name":"provider","in":"query","schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"description":"Only models registered or live through this provider public key."},{"name":"prompt_confidential","in":"query","schema":{"type":"boolean"},"description":"Filter by prompt-confidential compute availability."},{"name":"sort","in":"query","schema":{"type":"string","enum":["id","providers","input_price","output_price","request_price","context","listed"],"default":"id"},"description":"Sort key. request_price uses the unit-aware representative request cost, never incomparable raw unit rates."},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"description":"Sort direction."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum number of models returned."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor returned by the previous page. Do not construct or modify it."}],"responses":{"200":{"description":"Filtered model page with pricing, trust, capacity and provider availability.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogPage"}}}},"400":{"description":"Invalid, repeated or incompatible catalog filter.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/models/by-id":{"get":{"summary":"Model detail","description":"No auth. Pricing, supported parameters and signed request contracts.","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Exact model id, including any vendor/model slash."}],"responses":{"200":{"description":"The model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogModel"}}}},"404":{"description":"Unknown or disabled model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/models/by-id/stats":{"get":{"summary":"Throughput and latency statistics","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Exact model id, including any vendor/model slash."}],"responses":{"200":{"description":"Statistics."}}}},"/models/by-id/activity":{"get":{"summary":"Recent request activity","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Exact model id, including any vendor/model slash."}],"responses":{"200":{"description":"Activity buckets."}}}},"/models/by-id/availability":{"get":{"summary":"Provider availability history","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Exact model id, including any vendor/model slash."}],"responses":{"200":{"description":"Availability events."}}}},"/models/by-id/pricing-history":{"get":{"summary":"Every published price version","security":[],"parameters":[{"name":"id","in":"query","required":true,"schema":{"type":"string"},"description":"Exact model id, including any vendor/model slash."}],"responses":{"200":{"description":"Price versions."}}}}},"components":{"parameters":{"MinAttTier":{"name":"X-Mayhem-Min-Att-Tier","in":"header","required":false,"schema":{"oneOf":[{"type":"integer","minimum":1,"maximum":4},{"type":"string","enum":["T1","T2","T3","T4"]}]},"description":"Minimum acceptable provider attestation tier. Unlike the catalog's exact attestation_tier filter, dispatch accepts this tier or any higher tier."},"MinCtx":{"name":"X-Mayhem-Min-Ctx","in":"header","required":false,"schema":{"type":"integer","minimum":1,"maximum":4294967295},"description":"Text generation only. Minimum provider context capacity in tokens. The effective floor is never lower than the request's calculated input plus output requirement."},"Quant":{"name":"X-Mayhem-Quant","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":32,"example":"nvfp4"},"description":"Require one canonical quantization bucket; matching is case-insensitive after normalization."},"PreferProviders":{"name":"X-Mayhem-Prefer-Providers","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{64}(\\s*,\\s*[0-9a-fA-F]{64}){0,63}$"},"description":"Ordered, comma-separated provider public keys. This is a strict provider set: failover follows the listed order and does not fall back outside the set."},"Hedge":{"name":"X-Mayhem-Hedge","in":"header","required":false,"schema":{"type":"integer","enum":[0,1],"default":0},"description":"Text generation only. Set to 1 to request hedged dispatch across eligible routes, or 0 to disable it. It cannot be combined with X-Mayhem-Prefer-Providers."},"MinTokS":{"name":"X-Mayhem-Min-Tok-S","in":"header","required":false,"schema":{"type":"number","exclusiveMinimum":0},"description":"Minimum sustained throughput in the endpoint's native measured unit per second. For text this is tokens per second; other endpoint families use their Core-defined native unit."},"MaxWaitMs":{"name":"X-Mayhem-Max-Wait-Ms","in":"header","required":false,"schema":{"type":"integer","minimum":0,"maximum":60000},"description":"Maximum time in milliseconds to wait for an eligible provider admission. This is not the inference or asynchronous job runtime limit."},"MaxRetailCostUsd":{"name":"X-OpenMayhem-Max-Cost-Usd","in":"header","required":false,"schema":{"$ref":"#/components/schemas/UsdDecimal"},"description":"Maximum retail USD hold for this request, with at most 6 decimal places. The request is rejected before spend if its worst case is higher. The stricter of this value and the API key's per-request cap wins. This never controls the private wholesale X-Mayhem-Max-Price-Au limit."},"MaxInputPricePerMillionUsd":{"name":"X-OpenMayhem-Max-Input-Price-Per-Million-Usd","in":"header","required":false,"schema":{"$ref":"#/components/schemas/UsdDecimal"},"description":"Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the model's retail input price per one million tokens (pricing.prompt_per_million_au) is higher. The catalog filter max_input_price_per_million_usd takes the same number. It has no effect on a model without an input token rate."},"MaxOutputPricePerMillionUsd":{"name":"X-OpenMayhem-Max-Output-Price-Per-Million-Usd","in":"header","required":false,"schema":{"$ref":"#/components/schemas/UsdDecimal"},"description":"Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the model's retail output price per one million tokens (pricing.completion_per_million_au) is higher. The catalog filter max_output_price_per_million_usd takes the same number. It has no effect on a model without an output token rate."},"MaxRepresentativeRequestPriceUsd":{"name":"X-OpenMayhem-Max-Representative-Request-Price-Usd","in":"header","required":false,"schema":{"$ref":"#/components/schemas/UsdDecimal"},"description":"Price ceiling for the model of this request. The request is refused before any credit hold with 403 price_ceiling_exceeded when the retail price of the model's representative request (pricing.representative_request_au) is higher. The catalog filter max_representative_request_price_usd takes the same number. Use it for media, audio, video and workflow models."},"EstimateId":{"name":"X-OpenMayhem-Estimate","in":"header","required":false,"schema":{"type":"string","minLength":16},"description":"An estimate_id from POST /estimates. When present, it must match this key, model, body and routing controls; execution refuses a higher live maximum before holding credit."}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key from the dashboard, format sk-om-v1-..."}},"schemas":{"RequestEstimate":{"type":"object","required":["object","estimate_id","endpoint","model","estimated_cost_usd","maximum_cost_usd","price_version","expires_at","can_start"],"properties":{"object":{"type":"string","const":"request.estimate"},"estimate_id":{"type":"string"},"endpoint":{"type":"string","enum":["CHAT","COMPLETIONS","RESPONSES","EMBEDDINGS","DECISIONS","IMAGES","VIDEOS","AUDIO_SPEECH","AUDIO_TRANSCRIPTIONS","AUDIO_GENERATIONS","MUSIC","WORKFLOWS"]},"model":{"type":"string"},"estimated_cost_usd":{"$ref":"#/components/schemas/UsdDecimal"},"maximum_cost_usd":{"$ref":"#/components/schemas/UsdDecimal"},"estimated_units":{"type":"object","additionalProperties":{"type":"integer","minimum":0}},"price_version":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"can_start":{"type":"boolean","description":"Read-only current route and whole-rail funding snapshot; nothing is reserved."}}},"Balance":{"type":"object","required":["object","posted","reserved","available"],"properties":{"object":{"type":"string","const":"balance"},"posted":{"$ref":"#/components/schemas/UsdDecimal"},"reserved":{"$ref":"#/components/schemas/UsdDecimal"},"available":{"$ref":"#/components/schemas/UsdDecimal"},"rails":{"type":"object","additionalProperties":{"type":"object","properties":{"posted":{"$ref":"#/components/schemas/UsdDecimal"},"reserved":{"$ref":"#/components/schemas/UsdDecimal"},"available":{"$ref":"#/components/schemas/UsdDecimal"}}}}}},"AttestationTier":{"type":"string","enum":["T1","T2","T3","T4"],"description":"T1 verified software report; T2 hardware device identity; T3 prompt-confidential hardware; T4 admin KYB identity. Higher is not synonymous with prompt confidentiality: inspect prompt_confidential separately."},"UsdDecimal":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$","example":"0.50","description":"Non-negative decimal USD string with at most 6 decimal places, parsed with exact fixed-point arithmetic."},"CatalogUsdDecimal":{"type":"string","pattern":"^(0|[1-9][0-9]*)(\\.[0-9]{1,18})?$","example":"0.50","description":"Non-negative catalog price in USD with at most 18 decimal places, parsed with exact fixed-point arithmetic."},"CatalogProvider":{"type":"object","required":["id","live"],"properties":{"id":{"type":"string","pattern":"^[0-9a-f]{64}$"},"live":{"type":"boolean"}}},"CatalogKybIdentity":{"type":"object","required":["provider","legal_name","jurisdiction","proof_hash","kyb_ref"],"properties":{"provider":{"type":"string","pattern":"^[0-9a-f]{64}$"},"legal_name":{"type":"string"},"jurisdiction":{"type":"string"},"proof_hash":{"type":"string"},"kyb_ref":{"type":"string"}}},"CatalogRoute":{"type":"object","required":["provider","live","attestation_tier","quantization","context_tokens","prompt_confidential","tools","structured_output"],"properties":{"provider":{"type":"string","pattern":"^[0-9a-f]{64}$"},"live":{"type":"boolean"},"attestation_tier":{"type":["integer","null"],"minimum":1,"maximum":4},"quantization":{"type":["string","null"]},"context_tokens":{"type":["integer","null"],"minimum":1},"prompt_confidential":{"type":"boolean"},"tools":{"type":"boolean"},"structured_output":{"type":"boolean"},"kyb":{"oneOf":[{"$ref":"#/components/schemas/CatalogKybIdentity"},{"type":"null"}]},"attestation_verification":{"type":["object","null"],"description":"Sanitized route policy readiness; internal reasons are never exposed.","properties":{"policy_required":{"type":["boolean","null"]},"locally_ready":{"type":["boolean","null"]}}}}},"CatalogCapacity":{"type":"object","required":["context_tokens","output_tokens","concurrent_requests"],"properties":{"context_tokens":{"type":["integer","null"],"minimum":1},"output_tokens":{"type":["integer","null"],"minimum":1},"concurrent_requests":{"type":["integer","null"],"minimum":1}}},"CatalogRate":{"type":"object","required":["unit","per_unit_au","granularity"],"properties":{"unit":{"type":"string"},"per_unit_au":{"type":"string","pattern":"^[0-9]+$","description":"Atto-USD per billing unit."},"granularity":{"type":"integer","minimum":1}}},"CatalogPricing":{"type":"object","required":["unit","rates","prompt_per_million_au","completion_per_million_au","request_au","min_request_au","price_version","representative_request_au","representative_usage"],"properties":{"unit":{"type":"string","enum":["au_usd"]},"rates":{"type":"array","items":{"$ref":"#/components/schemas/CatalogRate"}},"dimensions":{"type":"array","items":{"$ref":"#/components/schemas/CatalogRate"}},"prompt_per_million_au":{"type":["string","null"],"pattern":"^[0-9]+$"},"completion_per_million_au":{"type":["string","null"],"pattern":"^[0-9]+$"},"request_au":{"type":"string","pattern":"^[0-9]+$"},"min_request_au":{"type":"string","pattern":"^[0-9]+$"},"price_version":{"type":"integer","minimum":1},"representative_request_au":{"type":"string","pattern":"^[0-9]+$","description":"Retail price for one granularity block of every priced dimension. Use this unit-aware reference for cross-modality comparison; it is not a forecast for an arbitrary request."},"representative_usage":{"type":"object","additionalProperties":{"type":"integer","minimum":0}}}},"CatalogModel":{"type":"object","required":["id","name","endpoints","providers_online","attestation_tiers","live_attestation_tiers","attestation_tier_labels","live_attestation_tier_labels","quantizations","live_quantizations","route_count","registered_route_count","provider_count","registered_provider_count","providers","prompt_confidential","registered_prompt_confidential","kyb_identities","registered_kyb_identities","attestation_verification","capacity","routes","pricing"],"properties":{"id":{"type":"string","description":"Lowercase catalog model id."},"object":{"type":"string","enum":["model"]},"name":{"type":"string"},"endpoints":{"type":"array","items":{"type":"string","enum":["CHAT","COMPLETIONS","RESPONSES","EMBEDDINGS","DECISIONS","IMAGES","VIDEOS","AUDIO_SPEECH","AUDIO_TRANSCRIPTIONS","AUDIO_GENERATIONS","MUSIC","WORKFLOWS"]}},"family":{"type":["string","null"]},"model_class":{"type":["string","null"]},"context_length":{"type":["integer","null"],"minimum":1},"max_tokens":{"type":["integer","null"],"minimum":1},"parameters":{"type":["array","null"],"items":{"type":"string"}},"request_contracts":{"type":"array","description":"Signed endpoint request contracts, including required attributes and allowed values. Inspect the contract for the selected endpoint rather than assuming all models accept the same parameters.","items":{"type":"object","additionalProperties":true}},"workflow":{"type":["object","null"],"description":"Signed workflow policy when available, including approved graph constraints and parts. Custom dimensions and LoRAs remain subject to this policy.","additionalProperties":true},"workflow_media":{"type":["object","null"],"description":"Validated media presentation metadata when available: supported controls, presets and approved selections used by Studio. This does not imply every model supports these features.","additionalProperties":true},"live_capacity_profiles":{"type":"array","description":"Current provider capacity profiles. A request must fit an eligible provider as well as the model contract; a catalog preset is not an availability guarantee.","items":{"type":"object","additionalProperties":true}},"registered_capacity_profiles":{"type":"array","description":"Registered capacity profiles, including providers that may not currently be available.","items":{"type":"object","additionalProperties":true}},"listed_at":{"type":["string","null"],"format":"date-time"},"providers_online":{"type":"integer","minimum":0},"attestation_tiers":{"type":"array","items":{"type":"integer","minimum":1,"maximum":4}},"live_attestation_tiers":{"type":"array","items":{"type":"integer","minimum":1,"maximum":4}},"attestation_tier_labels":{"type":"object","additionalProperties":{"type":"string"}},"live_attestation_tier_labels":{"type":"object","additionalProperties":{"type":"string"}},"quantizations":{"type":"array","items":{"type":"string"}},"live_quantizations":{"type":"array","items":{"type":"string"}},"route_count":{"type":"integer","minimum":0},"registered_route_count":{"type":"integer","minimum":0},"provider_count":{"type":"integer","minimum":0},"registered_provider_count":{"type":"integer","minimum":0},"providers":{"type":"array","items":{"$ref":"#/components/schemas/CatalogProvider"}},"prompt_confidential":{"type":"boolean","description":"True when a live confidential route exists."},"registered_prompt_confidential":{"type":"boolean"},"kyb_identities":{"type":"array","items":{"$ref":"#/components/schemas/CatalogKybIdentity"}},"registered_kyb_identities":{"type":"array","items":{"$ref":"#/components/schemas/CatalogKybIdentity"}},"attestation_verification":{"type":["object","null"],"description":"Sanitized aggregate policy-readiness counts from Core.","additionalProperties":true},"capacity":{"$ref":"#/components/schemas/CatalogCapacity"},"routes":{"type":"array","description":"Sanitized registered route tuples. live marks routes currently dispatch-eligible; one tuple must satisfy all composed route filters.","items":{"$ref":"#/components/schemas/CatalogRoute"}},"pricing":{"$ref":"#/components/schemas/CatalogPricing"}}},"CatalogPage":{"type":"object","required":["object","data","next_cursor"],"properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogModel"}},"next_cursor":{"type":["string","null"],"description":"Opaque continuation cursor bound to the current filter and sort query."}}},"ErrorEnvelope":{"type":"object","description":"Most errors. Failures before body parsing (missing/invalid key, oversized body) are the flat inner object without the error wrapper.","properties":{"error":{"type":"object","required":["statusCode","message"],"properties":{"statusCode":{"type":"integer"},"message":{"type":"string"},"code":{"$ref":"#/components/schemas/ErrorCode"},"retryAfterSeconds":{"type":"integer"},"model":{"type":"string","description":"price_ceiling_exceeded only: the model of the request."},"field":{"type":"string","enum":["max_input_price_per_million_usd","max_output_price_per_million_usd","max_representative_request_price_usd"],"description":"price_ceiling_exceeded only: the ceiling the price is above."},"ceiling":{"type":"string","description":"price_ceiling_exceeded only: the ceiling in USD."},"current":{"type":"string","description":"price_ceiling_exceeded only: the model's current retail price in that unit, as exact USD."},"details":{"type":"array","description":"422 only: each invalid field.","items":{"type":"object","properties":{"path":{},"message":{"type":"string"}}}}}}}},"ErrorCode":{"type":"string","description":"Stable machine-readable cause.","enum":["missing_api_key","invalid_api_key","insufficient_scope","model_not_allowed","key_spend_limit_exceeded","request_cost_limit_exceeded","retail_cost_limit_exceeded","price_ceiling_exceeded","account_not_active","insufficient_credit","invalid_content_length","request_body_too_large","contract_attribute_required","invalid_request","invalid_catalog_filter","invalid_routing_control","routing_control_not_public","routing_control_not_supported_for_endpoint","incompatible_routing_constraints","validation_failed","model_not_found","job_not_found","request_not_found","artifact_not_found","artifact_expired","endpoint_not_supported","token_count_unsupported","token_count_failed","idempotency_in_flight","idempotency_conflict","idempotency_replay_unavailable","rate_limited","client_closed","state_conflict","upstream_error","capacity_unavailable","no_provider_satisfies_attestation_tier","no_provider_satisfies_quant","context_requirement_unavailable","preferred_provider_unavailable","context_capacity_unavailable","no_provider_within_price_band","confidential_compute_unavailable","api_key_verification_unavailable"]},"Job":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["submitted","running","reconciling","completed","failed","cancelled"]},"polling_url":{"type":"string"},"cost":{"type":"string","description":"USD, set once settled."},"retail_cost_limit":{"type":["string","null"],"description":"Effective per-request retail USD cap after combining request and API-key limits."},"routing":{"type":"object","description":"Validated routing controls frozen when the job was submitted.","additionalProperties":true},"artifacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content_type":{"type":"string"},"size_bytes":{"type":"integer"}}}}}},"ChatCompletion":{"type":"object","description":"OpenAI chat completion plus OpenMayhem billing fields.","properties":{"choices":{"type":"array","items":{"type":"object"}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"cost":{"type":"string","description":"Exact settled cost in USD."}}},"openmayhem":{"type":"object","properties":{"request_id":{"type":"string"},"receipt":{"type":"object","properties":{"session_id":{"type":"string"},"sequence":{"type":"integer"},"final":{"type":"boolean"},"verified":{"type":"boolean"}}}}}}}}}}