{"openapi":"3.1.0","info":{"title":"GEDX402 Gateway","version":"6","description":"Frontier chat, text-to-image, image-to-image, and text-to-speech via Workers AI unified catalog — OpenAI chat/completions, POST /v1/unified/run, /v1/unified/image, /v1/unified/image-edit, or /v1/unified/tts; per-model x402 pricing.","contact":{"email":"support@macrostrategies.ai","url":"https://gateway.gedx402.com"},"x-guidance":"Pay per request with USDC on Base via x402 v2 (Coinbase CDP facilitator). Choose any listed network in the 402 accepts[] response. 5 routes on this shard (competitive heroes default; ?full=1 for all). Full catalog: GET https://gedx402.com/v1/models Start here: POST /v1/chat/completions","x-service":{"serviceName":"GEDX402 Gateway","tags":["unified","frontier","anthropic","openai","google","usdc"],"iconUrl":"https://gateway.gedx402.com/favicon.svg"},"x-hub":"https://gedx402.com","x-payments":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"x-openapi-scope":"competitive","full_catalog":"https://gateway.gedx402.com/openapi.json?full=1"},"servers":[{"url":"https://gateway.gedx402.com"}],"paths":{"/v1/unified/run":{"post":{"operationId":"unified_run","summary":"Unified Frontier Unified","description":"Frontier chat via env.AI.run(author/model). POST a sold author/model slug (GET /v1/models?bundle=frontier) and text messages[]; returns text, usage, and the raw result. x402 priced per request from the model, input size, and max_tokens.","tags":["Unified"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"17.823440","max":"17.823440"}},"responses":{"200":{"description":"Inference result","content":{"application/json":{"schema":{"type":"object"},"example":{"service":"gedx402-unified","model":"openai/gpt-4o-mini","content":[{"type":"text","text":"Hello!"}],"usage":{"input_tokens":12,"output_tokens":8}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Unified catalog slug (author/model), e.g. anthropic/claude-sonnet-4.6."},"messages":{"type":"array","description":"Chat messages (role + content).","items":{"type":"object"}},"max_tokens":{"type":"number","description":"Max completion tokens."}},"required":["model","messages"]},"example":{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Say hi in one sentence."}],"max_tokens":64}}}},"servers":[{"url":"https://gateway.gedx402.com"}],"x-resource-url":"https://gateway.gedx402.com/v1/unified/run"}},"/v1/unified/image":{"post":{"operationId":"unified_image","summary":"Cloudflare Unified Image Unified","description":"Third-party text-to-image via env.AI.run(author/model). POST a sold author/model slug (GET /v1/models?bundle=frontier) and prompt; returns image when the provider supplies one, plus the raw result. x402 priced per image from the model in the body. Workers AI /v1/image/* on image.gedx402.com is unchanged.","tags":["Unified"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.789500","max":"0.790000"}},"responses":{"200":{"description":"Inference result","content":{"application/json":{"schema":{"type":"object"},"example":{"service":"gedx402-unified","route":"/v1/unified/image","model":"pruna/p-image","image":"<base64>","result":{}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Unified Text-to-Image slug (author/model), e.g. pruna/p-image."},"prompt":{"type":"string","description":"Text description of the image to generate."},"aspect_ratio":{"type":"string","description":"Optional aspect ratio when the model supports it (e.g. 1:1, 16:9)."},"resolution":{"type":"string","description":"Optional resolution hint when the model supports it (e.g. 1k)."},"width":{"type":"integer","description":"Optional width in pixels when the model supports it."},"height":{"type":"integer","description":"Optional height in pixels when the model supports it."},"seed":{"type":"integer","description":"Optional seed for reproducible generation."}},"required":["prompt"]},"example":{"model":"pruna/p-image","prompt":"A small furry elephant pet looks out from a cat house","aspect_ratio":"1:1"}}}},"servers":[{"url":"https://gateway.gedx402.com"}],"x-resource-url":"https://gateway.gedx402.com/v1/unified/image"}},"/v1/unified/image-edit":{"post":{"operationId":"unified_image-edit","summary":"Cloudflare Unified Image Edit Unified","description":"Third-party image-to-image via env.AI.run(author/model). POST a sold author/model slug (GET /v1/models?bundle=frontier), image or images, and prompt/instruction when the model requires it; returns image when the provider supplies one, plus the raw result. x402 priced per image from the model in the body. Workers AI /v1/image/* on image.gedx402.com is unchanged.","tags":["Unified"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.080750","max":"0.090000"}},"responses":{"200":{"description":"Inference result","content":{"application/json":{"schema":{"type":"object"},"example":{"service":"gedx402-unified","route":"/v1/unified/image-edit","model":"pruna/p-image-edit","image":"<base64-or-url>","result":{}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Unified Image-to-Image slug (author/model), e.g. pruna/p-image-edit."},"image":{"type":"string","description":"Single input image as an HTTP(S) URL or data URI (alias for images:[url])."},"images":{"type":"array","items":{"type":"string"},"description":"One or more input images (URL or data URI). Max depends on the model (1–5)."},"prompt":{"type":"string","description":"Edit instruction for models that take prompt (e.g. pruna/p-image-edit). Also accepted as instruction."},"instruction":{"type":"string","description":"Edit instruction for models that take instruction (e.g. bria/fibo-edit-1.5). Also accepted as prompt."},"aspect_ratio":{"type":"string","description":"Optional aspect ratio when the model supports it."},"seed":{"type":"integer","description":"Optional seed for reproducible generation."},"mask":{"type":"string","description":"Optional mask URL or data URI when the model supports masked edits."}},"required":[]},"example":{"model":"pruna/p-image-edit","prompt":"Transform the subject into a watercolor painting style with vibrant colors","images":["https://gedx402.com/logo.png"],"aspect_ratio":"1:1"}}}},"servers":[{"url":"https://gateway.gedx402.com"}],"x-resource-url":"https://gateway.gedx402.com/v1/unified/image-edit"}},"/v1/unified/tts":{"post":{"operationId":"unified_tts","summary":"Cloudflare Unified TTS Unified","description":"Third-party text-to-speech via env.AI.run(author/model). POST a sold author/model slug (GET /v1/models?bundle=frontier) and text; returns audio when the provider supplies it, plus the raw result. x402 priced per character from the model and text length in the body. Workers AI /v1/tts/* on media.gedx402.com is unchanged.","tags":["Unified"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"1.052000","max":"1.060000"}},"responses":{"200":{"description":"Inference result","content":{"application/json":{"schema":{"type":"object"},"example":{"service":"gedx402-unified","route":"/v1/unified/tts","model":"openai/tts-1","chars":48,"audio":"<base64-or-url>","result":{}}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Unified Text-to-Speech slug (author/model), e.g. openai/tts-1."},"text":{"type":"string","description":"Text to synthesize (priced per character; max 4000)."},"voice":{"type":"string","description":"Optional voice id when the model uses OpenAI-style voice names (e.g. alloy)."},"voice_id":{"type":"string","description":"Optional voice id when the model uses provider voice_id (e.g. Inworld Dennis)."},"response_format":{"type":"string","description":"Optional audio format when the model supports it (e.g. mp3)."},"output_format":{"type":"string","description":"Optional audio format alias used by some providers (e.g. mp3)."},"speed":{"type":"number","description":"Optional speaking speed when the model supports it."},"speaking_rate":{"type":"number","description":"Optional speaking rate alias used by some providers."}},"required":["text"]},"example":{"model":"openai/tts-1","text":"Hello! Welcome to GEDX402 unified text-to-speech.","voice":"alloy","response_format":"mp3"}}}},"servers":[{"url":"https://gateway.gedx402.com"}],"x-resource-url":"https://gateway.gedx402.com/v1/unified/tts"}},"/v1/chat/completions":{"post":{"operationId":"chat_completions","summary":"Chat Completions","description":"A written reply from the model, in an OpenAI chat.completion (the text is choices[0].message.content). POST { messages, max_tokens?, model? }. A short prompt on the default model costs the least; the 402 quotes the exact amount for your body before you pay.","tags":["Chat"],"security":[{"x402":[]}],"x-payment-info":{"protocols":[{"x402":{"network":"eip155:8453","asset":"USDC","label":"Base"}}],"price":{"mode":"dynamic","currency":"USD","min":"0.002000","max":"0.004558"}},"responses":{"200":{"description":"Inference result","content":{"application/json":{"schema":{"type":"object"},"example":{"id":"chatcmpl-example","object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}]}}}},"400":{"description":"Invalid or over-limit payload"},"402":{"description":"Payment required (x402 v2 USDC on Base). Unpaid 402 includes PAYMENT-REQUIRED. After a rejected PAYMENT-SIGNATURE the JSON body is { reason_code, detail, next_step }.","headers":{"PAYMENT-REQUIRED":{"description":"Base64-encoded x402 v2 PaymentRequired with accepts[] per network","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":true},"example":{}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","description":"Model id or tier alias (fast, smart, micro). See GET /v1/models."},"messages":{"type":"array","description":"Conversation turns in order (system, user, assistant).","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"],"description":"Speaker role for this turn."},"content":{"type":"string","description":"Message text for this turn."}},"required":["role","content"]}},"max_tokens":{"type":"integer","minimum":1,"maximum":4096,"description":"Maximum tokens to generate in the assistant reply."}},"required":["messages"]},"example":{"messages":[{"role":"user","content":"Hi"}],"max_tokens":16}}}},"servers":[{"url":"https://gateway.gedx402.com"}],"x-resource-url":"https://gateway.gedx402.com/v1/chat/completions"}},"/v1/models":{"get":{"operationId":"models","summary":"Shard route catalog","description":"Free catalog for this shard with pricing and descriptions.","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Catalog JSON"}}}},"/v1/demo":{"get":{"operationId":"demo_index","summary":"Response shape previews","description":"Free cached JSON examples (not charged).","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Demo index"}}}},"/v1/health":{"get":{"operationId":"health","summary":"Service health","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Health JSON"}}}}},"x-agentcash-guidance":{"llmsTxtUrl":"https://gateway.gedx402.com/llms.txt"},"x-agentcash-provenance":{"ownershipProofs":["0xb3C2776cE3F99cb3366520c27b4aC5D436942Ab6"]},"x-discovery":{"ownershipProofs":["0xb3C2776cE3F99cb3366520c27b4aC5D436942Ab6"]},"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"x402 v2. First POST without this header returns 402 + PAYMENT-REQUIRED. Sign the Base accept (eip155:8453) with @x402/fetch and retry once. After a rejected signature the 402 body is { reason_code, detail, next_step }."}}}}