{"openapi":"3.1.0","info":{"title":"MapleAI","version":"1.0.0","description":"Pay-per-request API access via x402 on Polygon mainnet. 4 GPT models, 7 image models, and Jev structured decisions; no accounts or client API keys.","contact":{"name":"MapleAI","email":"contact@mapleai.shop","url":"https://polygon.mapleai.shop"},"license":{"name":"Proprietary"},"x-payment":{"protocol":"x402","network":"eip155:137","asset":"USDC","assetAddress":"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","payTo":"0x63db6eaf635a31bbc6714fe37bdc85243864f611","facilitator":"https://api.cdp.coinbase.com/platform/v2/x402","minimumChargeUsd":0.001}},"servers":[{"url":"https://polygon.mapleai.shop"}],"x-discovery":{"well-known":"https://polygon.mapleai.shop/.well-known/x402","llms":"https://polygon.mapleai.shop/llms.txt","agents":"https://polygon.mapleai.shop/AI-AGENTS.md","ownershipProofs":["rQZJejmJ179aDRKDA2Uxmu29u6Cye3JyAjMT7TX7mgfPCikZvn52Aoz2rCFgNiezYcpDT5RkvNpTFeT6sb3YK6X","0x099ce2927a83bb1addab87f88d4d522735b824eabe6394593926374eef4394ae621f4d245671210b713fc0d2752171606c512054830a37e33b5ca5c5993850e91c","0x87c5b0027ad36300dee3d4da0a308803726677d4155a59f1c539bee268c407080309ec89dd23395521ebee327ca8e697f36587612c3d86b2f6a3513e5c32bbc31c","0xb68189e68f6ceeccce47034e41573a6c0221f5a9d98e88c5973a2395b896ebc617eb8694c4a0ef91c29db22cb0b2f6599097ab3e657f6dde74e2ea414f884a121c"]},"x-agentcash-provenance":{"ownershipProofs":["rQZJejmJ179aDRKDA2Uxmu29u6Cye3JyAjMT7TX7mgfPCikZvn52Aoz2rCFgNiezYcpDT5RkvNpTFeT6sb3YK6X","0x099ce2927a83bb1addab87f88d4d522735b824eabe6394593926374eef4394ae621f4d245671210b713fc0d2752171606c512054830a37e33b5ca5c5993850e91c","0x87c5b0027ad36300dee3d4da0a308803726677d4155a59f1c539bee268c407080309ec89dd23395521ebee327ca8e697f36587612c3d86b2f6a3513e5c32bbc31c","0xb68189e68f6ceeccce47034e41573a6c0221f5a9d98e88c5973a2395b896ebc617eb8694c4a0ef91c29db22cb0b2f6599097ab3e657f6dde74e2ea414f884a121c"]},"components":{"securitySchemes":{"x402":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE","description":"x402 payment payload. Request the resource once to receive HTTP 402 with the exact price in the PAYMENT-REQUIRED header, sign the USDC transfer, then retry with the signed payload in PAYMENT-SIGNATURE."}}},"paths":{"/api/v1/images/generations":{"post":{"summary":"Generate images","operationId":"generateImages","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/api/v1/images/generations \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"gpt-image-2\",\"size\":\"1024x1024\",\"n\":1,\"prompt\":\"A maple leaf\"}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD"},"protocols":[{"x402":{}}]},"x-pricing":{"unit":"USD per image","models":{"gpt-image-2":{"1024x1024":0.02},"gpt-image-2.5":{"1024x1024":0.04},"gpt-image-2.5-flare":{"1024x1024":0.04},"gpt-image-2.5-sunburst":{"1024x1024":0.04},"grok-imagine-image":{"1024x1024":0.045},"gpt-image-2-2k":{"2048x2048":0.09},"gpt-image-2.5-sunburst-2k":{"2048x2048":0.22}}},"requestBody":{"required":true,"content":{"application/json":{"example":{"model":"gpt-image-2","size":"1024x1024","n":1,"prompt":"A maple leaf"},"schema":{"type":"object","required":["model","size","prompt"],"properties":{"model":{"type":"string","enum":["gpt-image-2","gpt-image-2.5","gpt-image-2.5-flare","gpt-image-2.5-sunburst","grok-imagine-image","gpt-image-2-2k","gpt-image-2.5-sunburst-2k"]},"size":{"type":"string","example":"1024x1024","description":"A listed size for the selected model"},"n":{"type":"integer","minimum":1,"maximum":4,"default":1},"prompt":{"type":"string","example":"A maple leaf","maxLength":4000}}}}}},"responses":{"200":{"description":"Generated images","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"created":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"b64_json":{"type":"string"}}}}}}}}},"400":{"description":"Invalid image request"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}},"502":{"description":"Image upstream failed"}}}},"/api/v1/images/image2image":{"post":{"summary":"Edit an image","operationId":"editImage","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/api/v1/images/image2image \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"gpt-image-2\",\"size\":\"1024x1024\",\"n\":1,\"prompt\":\"Make the leaf green\",\"image\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC\"}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD"},"protocols":[{"x402":{}}]},"x-pricing":{"unit":"USD per image","models":{"gpt-image-2":{"1024x1024":0.02},"gpt-image-2.5":{"1024x1024":0.04},"gpt-image-2.5-flare":{"1024x1024":0.04},"gpt-image-2.5-sunburst":{"1024x1024":0.04},"grok-imagine-image":{"1024x1024":0.045},"gpt-image-2-2k":{"2048x2048":0.09},"gpt-image-2.5-sunburst-2k":{"2048x2048":0.22}}},"requestBody":{"required":true,"content":{"application/json":{"example":{"model":"gpt-image-2","size":"1024x1024","n":1,"prompt":"Make the leaf green","image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC"},"schema":{"type":"object","required":["model","size","prompt","image"],"properties":{"model":{"type":"string","enum":["gpt-image-2","gpt-image-2.5","gpt-image-2.5-flare","gpt-image-2.5-sunburst","grok-imagine-image","gpt-image-2-2k","gpt-image-2.5-sunburst-2k"]},"size":{"type":"string","example":"1024x1024","description":"A listed size for the selected model"},"n":{"type":"integer","minimum":1,"maximum":4,"default":1},"prompt":{"type":"string","example":"A maple leaf","maxLength":4000},"image":{"type":"string","example":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR4nGP4z8AAAAMBAQDJ/pLvAAAAAElFTkSuQmCC","description":"PNG, JPEG or WebP base64 data URI, maximum 10 MB"}}}}}},"responses":{"200":{"description":"Generated images","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"created":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"b64_json":{"type":"string"}}}}}}}}},"400":{"description":"Invalid image request"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}},"502":{"description":"Image upstream failed"}}}},"/prepaid/codes":{"post":{"summary":"Buy a prepaid GPT API code","operationId":"buyPrepaidCode","security":[{"x402":[]}],"description":"Purchases a prepaid bearer API key for https://mapleai.shop/v1. The key is limited to the selected model and a total token budget in 100000-token steps from 100000 to 1000000. Pricing uses the model input rate plus the network settlement fee. Check key usage and status any time: GET https://mapleai.shop/v1/prepaid/status with the prepaid key as the Bearer token.","x-payment-info":{"price":{"mode":"dynamic","currency":"USD"},"protocols":[{"x402":{}}]},"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/prepaid/codes \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"openai/gpt-6-luna\",\"tokens\":100000}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-pricing":{"unit":"prepaid token pack","models":{"openai/gpt-5.6-sol":{"input":2.8,"output":14},"openai/gpt-5.6-terra":{"input":1.4,"output":8.4},"openai/gpt-6-luna":{"input":0.07,"output":0.35},"openai/gpt-6-sol":{"input":1.4,"output":7}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","tokens"],"properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"tokens":{"type":"integer","minimum":100000,"maximum":1000000,"multipleOf":100000}}},"example":{"model":"openai/gpt-6-luna","tokens":100000}}}},"responses":{"201":{"description":"Prepaid bearer API key","content":{"application/json":{"example":{"object":"prepaid_code","code":"oms_buy_example","model":"openai/gpt-6-luna","tokens":{"total":100000,"remaining":100000},"api_base":"https://mapleai.shop/v1","status_url":"https://mapleai.shop/v1/prepaid/status"}}}},"400":{"description":"Invalid model or token amount"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}},"503":{"description":"Prepaid key issuer unavailable"}}}},"/prepaid/codes/auto":{"post":{"summary":"One-shot prepaid tap (empty body)","operationId":"buyPrepaidCodeAuto","security":[{"x402":[]}],"description":"POST with an empty or partial body: defaults buy a 100000-token openai/gpt-6-luna prepaid key without any parameters. Optional model and tokens override follow the same rules as /prepaid/codes.","x-payment-info":{"price":{"mode":"dynamic","currency":"USD"},"protocols":[{"x402":{}}]},"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/prepaid/codes/auto \\\n  -H 'content-type: application/json' \\\n  -d '{}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"tokens":{"type":"integer","minimum":100000,"maximum":1000000}}},"example":{}}}},"responses":{"201":{"description":"Prepaid bearer API key","content":{"application/json":{"example":{"object":"prepaid_code","code":"oms_buy_example","model":"openai/gpt-6-luna","tokens":{"total":100000,"remaining":100000},"api_base":"https://mapleai.shop/v1","status_url":"https://mapleai.shop/v1/prepaid/status"}}}},"400":{"description":"Invalid model or token amount"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}},"503":{"description":"Prepaid key issuer unavailable"}}}},"/v1/embeddings":{"post":{"summary":"Create free embeddings","operationId":"createEmbeddings","security":[],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/v1/embeddings \\\n  -H 'content-type: application/json' \\\n  -d '{\"input\":\"Hello\",\"input_type\":\"query\",\"encoding_format\":\"float\"}'","payment":"none"},"description":"Free NVIDIA Nemotron embeddings. Every request is routed to nvidia/nemotron-3-embed-1b; any supplied model value is ignored. Discovery and health probes that send a body containing only a model field (no input) receive HTTP 200 with an empty data list and a hint describing the expected input, so automated crawlers pass on the first try. ","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","description":"Optional compatibility field; its value is ignored."},"input":{"oneOf":[{"type":"string"},{"type":"array","minItems":1,"maxItems":128,"items":{"type":"string"}}]},"input_type":{"type":"string","enum":["query","passage"]},"encoding_format":{"type":"string","enum":["float","base64"]}}},"example":{"input":"Hello","input_type":"query","encoding_format":"float"},"examples":{"single":{"summary":"Single text","value":{"input":"Hello","input_type":"query","encoding_format":"float"}},"batch":{"summary":"Batch of texts (max 128)","value":{"input":["first document","second document"],"input_type":"passage"}},"probe":{"summary":"Discovery probe (model-only body returns 200 with a hint)","value":{"model":"nvidia/nemotron-3-embed-1b"}}}}}},"responses":{"200":{"description":"Embedding vectors per input, or an empty data list with a hint for model-only probes.","content":{"application/json":{"examples":{"embeddings":{"summary":"Embeddings response","value":{"object":"list","data":[{"object":"embedding","index":0,"embedding":[0.0123,-0.0456]}],"model":"nvidia/nemotron-3-embed-1b"}},"probe":{"summary":"Probe response (model-only body)","value":{"object":"list","data":[],"model":"nvidia/nemotron-3-embed-1b","hint":"Send {\"input\": \"your text\"} or {\"input\": [\"up to 128 strings\"]}"}}}}}},"400":{"description":"Invalid request body. The error includes the expected request schema.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message","type","param","code","details"],"properties":{"message":{"type":"string"},"type":{"const":"invalid_request"},"param":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","required":["expected","schema"],"properties":{"expected":{"type":"string"},"schema":{"type":"object","required":["input"],"properties":{"model":{"type":"string","description":"Optional compatibility field; its value is ignored."},"input":{"oneOf":[{"type":"string"},{"type":"array","minItems":1,"maxItems":128,"items":{"type":"string"}}]},"input_type":{"type":"string","enum":["query","passage"]},"encoding_format":{"type":"string","enum":["float","base64"]}}}}}}}}}}}},"502":{"description":"NVIDIA upstream failed"}}}},"/v1/free/chat/completions":{"post":{"summary":"Free gpt-oss-20b chat completions","operationId":"freeGptOssChat","security":[],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/v1/free/chat/completions \\\n  -H 'content-type: application/json' \\\n  -d '{\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"stream\":false}'","payment":"none"},"description":"Free nvidia/gpt-oss-20b chat via the same OpenAI Chat Completions shape as the paid endpoint. No payment and no key. Rate-limited per agent IP: 10 requests per 10 minutes and 100 per day; max_tokens is capped at 2048. Exceeding the window returns HTTP 429 with a free_tier_exhausted code and a retry-after. Window usage: GET /v1/free/chat/completions/quota.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","description":"Optional; only nvidia/gpt-oss-20b is accepted"},"messages":{"type":"array","minItems":1,"items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string"},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","maximum":2048},"stream":{"type":"boolean"}}},"example":{"messages":[{"role":"user","content":"Hello"}],"stream":false}}}},"responses":{"200":{"description":"Chat completion object with model echoed as nvidia/gpt-oss-20b.","content":{"application/json":{"example":{"id":"chatcmpl_free","object":"chat.completion","model":"nvidia/gpt-oss-20b","choices":[{"index":0,"finish_reason":"stop","message":{"role":"assistant","content":"Hello!"}}],"usage":{"prompt_tokens":32,"completion_tokens":6,"total_tokens":38}}}}},"400":{"description":"Invalid request body (wrong model or missing messages)"},"429":{"description":"Free tier window exhausted for this agent IP; retry-after included."},"502":{"description":"Upstream temporarily unavailable"}}}},"/v1/free/chat/completions/quota":{"get":{"summary":"Free tier window usage for the caller IP","operationId":"freeGptOssQuota","security":[],"responses":{"200":{"description":"Current usage and limits for both windows.","content":{"application/json":{"example":{"object":"free_quota","model":"nvidia/gpt-oss-20b","per10Min":{"limit":10,"used":0},"perDay":{"limit":100,"used":0}}}}}}}},"/jev":{"post":{"summary":"Run Jev structured decision","operationId":"runJev","description":"SystemOne protocol for jev-latest. Returns structured answers, not chat text.","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/jev \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"jev-latest\",\"state\":\"The customer was charged twice for one order.\",\"questions\":{\"billing\":{\"type\":\"noul\",\"instructions\":\"Is this about a billing issue?\"}}}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD"},"protocols":[{"x402":{}}]},"x-pricing":{"unit":"USD per 1M tokens","input":0.12,"output":0},"requestBody":{"required":true,"content":{"application/json":{"example":{"model":"jev-latest","state":"The customer was charged twice for one order.","questions":{"billing":{"type":"noul","instructions":"Is this about a billing issue?"}}},"schema":{"type":"object","required":["model","state","questions"],"properties":{"model":{"type":"string","enum":["jev-latest"],"example":"jev-latest"},"state":{"type":"string","example":"The customer was charged twice for one order."},"questions":{"type":"object","example":{"billing":{"type":"noul","instructions":"Is this about a billing issue?"}},"description":"Named questions. Each value needs type (noul, choice or score) and instructions.","additionalProperties":{"type":"object","required":["type","instructions"],"properties":{"type":{"type":"string","enum":["noul","choice","score"]},"instructions":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Structured answers","content":{"application/json":{"example":{"model":"jev-1.13.0","answers":{"billing":{"type":"noul","noul":0.98}},"usage":{"input_tokens":282,"output_tokens":20}}}}},"400":{"description":"Invalid request"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}},"502":{"description":"Upstream unavailable"}}}},"/v1/chat/completions":{"post":{"summary":"Create chat completion","description":"OpenAI-compatible chat completion, priced by counted input tokens + max output tokens at per-model rates","operationId":"createChatCompletion","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/v1/chat/completions \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"openai/gpt-5.6-sol\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"max_tokens\":8}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000","max":"4.733000"},"protocols":[{"x402":{}}]},"x-pricing":{"type":"dynamic","calculation":"input_tokens * input_rate + max_tokens * output_rate + settlement overhead, floored at the minimum charge","unit":"USD per 1M tokens","minimum_charge_usd":0.001,"settlement_overhead_usd":0.001,"models":[{"id":"openai/gpt-5.6-sol","input":2.8,"output":14},{"id":"openai/gpt-5.6-terra","input":1.4,"output":8.4},{"id":"openai/gpt-6-luna","input":0.07,"output":0.35},{"id":"openai/gpt-6-sol","input":1.4,"output":7}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"messages":{"type":"array","description":"OpenAI chat messages","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","default":4096},"temperature":{"type":"number"},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Successful completion. Set stream: true for server-sent events.","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer","description":"Unix timestamp in seconds"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","const":"assistant"},"content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","required":["name","arguments"],"properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}}}}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"example":{"id":"chatcmpl_worked","object":"chat.completion","created":1700000000,"model":"openai/gpt-5.6-sol","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"usage":{"prompt_tokens":11,"completion_tokens":5,"total_tokens":16}}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events ending with data: [DONE]"}}}},"400":{"description":"Unknown or missing model"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}}}}},"/api/v1/chat/completions":{"post":{"summary":"Create chat completion (agent alias)","description":"OpenAI-compatible chat completion, priced by counted input tokens + max output tokens at per-model rates. Alias of /v1/chat/completions for agent crawlers.","operationId":"createChatCompletionAlias","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/api/v1/chat/completions \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"openai/gpt-5.6-sol\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}],\"max_tokens\":8}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000","max":"4.733000"},"protocols":[{"x402":{}}]},"x-pricing":{"type":"dynamic","calculation":"input_tokens * input_rate + max_tokens * output_rate + settlement overhead, floored at the minimum charge","unit":"USD per 1M tokens","minimum_charge_usd":0.001,"settlement_overhead_usd":0.001,"models":[{"id":"openai/gpt-5.6-sol","input":2.8,"output":14},{"id":"openai/gpt-5.6-terra","input":1.4,"output":8.4},{"id":"openai/gpt-6-luna","input":0.07,"output":0.35},{"id":"openai/gpt-6-sol","input":1.4,"output":7}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"messages":{"type":"array","description":"OpenAI chat messages","items":{"type":"object","required":["role"],"properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","default":4096},"temperature":{"type":"number"},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Successful completion. Set stream: true for server-sent events.","content":{"application/json":{"schema":{"type":"object","required":["id","object","created","model","choices"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"chat.completion"},"created":{"type":"integer","description":"Unix timestamp in seconds"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","required":["index","message","finish_reason"],"properties":{"index":{"type":"integer"},"message":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","const":"assistant"},"content":{"type":["string","null"]},"tool_calls":{"type":"array","items":{"type":"object","required":["id","type","function"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"function":{"type":"object","required":["name","arguments"],"properties":{"name":{"type":"string"},"arguments":{"type":"string"}}}}}}}},"finish_reason":{"type":["string","null"]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"example":{"id":"chatcmpl_worked","object":"chat.completion","created":1700000000,"model":"openai/gpt-5.6-sol","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"usage":{"prompt_tokens":11,"completion_tokens":5,"total_tokens":16}}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events ending with data: [DONE]"}}}},"400":{"description":"Unknown or missing model"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}}}}},"/api/v1/responses":{"post":{"summary":"Create a model response","description":"OpenAI-compatible Responses API (alpha). Translated to a chat completion upstream.","operationId":"createResponse","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/api/v1/responses \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"openai/gpt-5.6-sol\",\"input\":\"Hello\",\"max_output_tokens\":8}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000","max":"4.733000"},"protocols":[{"x402":{}}]},"x-pricing":{"type":"dynamic","calculation":"input_tokens * input_rate + max_tokens * output_rate + settlement overhead, floored at the minimum charge","unit":"USD per 1M tokens","minimum_charge_usd":0.001,"settlement_overhead_usd":0.001,"models":[{"id":"openai/gpt-5.6-sol","input":2.8,"output":14},{"id":"openai/gpt-5.6-terra","input":1.4,"output":8.4},{"id":"openai/gpt-6-luna","input":0.07,"output":0.35},{"id":"openai/gpt-6-sol","input":1.4,"output":7}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}}]},"instructions":{"type":"string"},"max_output_tokens":{"type":"integer","default":4096},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Successful completion. Set stream: true for server-sent events.","content":{"application/json":{"schema":{"type":"object","required":["id","object","created_at","status","model","output","output_text"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer","description":"Unix timestamp in seconds"},"status":{"type":"string","const":"completed"},"model":{"type":"string"},"output":{"type":"array","items":{"oneOf":[{"type":"object","required":["id","type","status","role","content"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"message"},"status":{"type":"string","const":"completed"},"role":{"type":"string","const":"assistant"},"content":{"type":"array","items":{"type":"object","required":["type","text","annotations"],"properties":{"type":{"type":"string","const":"output_text"},"text":{"type":"string"},"annotations":{"type":"array","items":{}}}}}}},{"type":"object","required":["id","type","status","call_id","name","arguments"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"function_call"},"status":{"type":"string","const":"completed"},"call_id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}}}]}},"output_text":{"type":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"example":{"id":"resp_worked","object":"response","created_at":1700000000,"status":"completed","model":"openai/gpt-5.6-sol","output":[{"id":"msg_worked","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"OK","annotations":[]}]}],"output_text":"OK","usage":{"input_tokens":11,"output_tokens":5,"total_tokens":16}}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events ending with data: [DONE]"}}}},"400":{"description":"Unknown or missing model"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}}}}},"/v1/responses":{"post":{"summary":"Create a model response (short path)","description":"Alias of /api/v1/responses. OpenAI-compatible Responses API (alpha), translated to a chat completion upstream.","operationId":"createResponseAlias","security":[{"x402":[]}],"x-worked-example":{"curl":"curl -X POST https://polygon.mapleai.shop/v1/responses \\\n  -H 'content-type: application/json' \\\n  -d '{\"model\":\"openai/gpt-5.6-sol\",\"input\":\"Hello\",\"max_output_tokens\":8}'","payment":"x402","firstAttempt":"402 with PAYMENT-REQUIRED; sign and retry with PAYMENT-SIGNATURE"},"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.001000","max":"4.733000"},"protocols":[{"x402":{}}]},"x-pricing":{"type":"dynamic","calculation":"input_tokens * input_rate + max_tokens * output_rate + settlement overhead, floored at the minimum charge","unit":"USD per 1M tokens","minimum_charge_usd":0.001,"settlement_overhead_usd":0.001,"models":[{"id":"openai/gpt-5.6-sol","input":2.8,"output":14},{"id":"openai/gpt-5.6-terra","input":1.4,"output":8.4},{"id":"openai/gpt-6-luna","input":0.07,"output":0.35},{"id":"openai/gpt-6-sol","input":1.4,"output":7}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","enum":["openai/gpt-5.6-sol","openai/gpt-5.6-terra","openai/gpt-6-luna","openai/gpt-6-sol"]},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}}}]},"instructions":{"type":"string"},"max_output_tokens":{"type":"integer","default":4096},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Successful completion. Set stream: true for server-sent events.","content":{"application/json":{"schema":{"type":"object","required":["id","object","created_at","status","model","output","output_text"],"properties":{"id":{"type":"string"},"object":{"type":"string","const":"response"},"created_at":{"type":"integer","description":"Unix timestamp in seconds"},"status":{"type":"string","const":"completed"},"model":{"type":"string"},"output":{"type":"array","items":{"oneOf":[{"type":"object","required":["id","type","status","role","content"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"message"},"status":{"type":"string","const":"completed"},"role":{"type":"string","const":"assistant"},"content":{"type":"array","items":{"type":"object","required":["type","text","annotations"],"properties":{"type":{"type":"string","const":"output_text"},"text":{"type":"string"},"annotations":{"type":"array","items":{}}}}}}},{"type":"object","required":["id","type","status","call_id","name","arguments"],"properties":{"id":{"type":"string"},"type":{"type":"string","const":"function_call"},"status":{"type":"string","const":"completed"},"call_id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"}}}]}},"output_text":{"type":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}}},"example":{"id":"resp_worked","object":"response","created_at":1700000000,"status":"completed","model":"openai/gpt-5.6-sol","output":[{"id":"msg_worked","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"OK","annotations":[]}]}],"output_text":"OK","usage":{"input_tokens":11,"output_tokens":5,"total_tokens":16}}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events ending with data: [DONE]"}}}},"400":{"description":"Unknown or missing model"},"402":{"description":"Payment required","headers":{"PAYMENT-REQUIRED":{"schema":{"type":"string"},"description":"Base64-encoded x402 payment requirements (price, network, asset, payTo)"}}}}}},"/v1/models":{"get":{"summary":"List available models","description":"Free. Returns every sellable GPT model with live pricing.","operationId":"listModels","security":[],"responses":{"200":{"description":"List of models"}}}},"/.well-known/x402":{"get":{"summary":"x402 resource manifest","description":"Free. Machine-readable x402 discovery document.","operationId":"x402Discovery","security":[],"responses":{"200":{"description":"x402 discovery document"}}}},"/health":{"get":{"summary":"Service health","description":"Free. Liveness probe.","operationId":"health","security":[],"responses":{"200":{"description":"Service status"}}}}}}