{"uid":"cap_30438lh0POOyDPULd0Wl2","slug":"polygon-mapleai-chat-completions-fed5a013","name":"Polygon MapleAI Chat Completions","description":"OpenAI-compatible chat completion, priced by counted input tokens + max output tokens at per-model rates","url":"https://polygon.mapleai.shop/api/v1/chat/completions?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Model ID from GET /v1/models"},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant","tool"],"type":"string"},"content":{"type":"string"}}}},"max_tokens":{"type":"integer","minimum":1}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001623/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001623","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001623","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_wQAsTdKswzWbwq3bRAY9I","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001623","costPer":"request","priority":0,"asset":"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"OpenAI-compatible chat completion endpoint priced per call based on counted input tokens plus max output tokens at per-model rates","exampleAgentPrompt":"Using the gpt-3.5-turbo model, send this conversation to the polygon.mapleai.shop chat completions API with a max of 512 output tokens: system says 'You are a helpful assistant', and the user asks 'What are three tips for writing clean Python code?'","exampleUseCases":[{"title":"AI coding assistant for developer tools","prompt":"Send this to the chat completions API using the code-focused model with up to 1024 output tokens — system prompt: 'You are an expert software engineer', user message: 'Refactor this Python function to be more readable and efficient: def calc(x,y): return x*x+2*x*y+y*y'"},{"title":"Customer support response generation","prompt":"I need to generate a polished customer support reply — use the chat completions endpoint with max 300 tokens, system: 'You are a friendly customer support agent for a SaaS company', user: 'My subscription renewal failed and I can't access my account.'"},{"title":"Automated document summarization","prompt":"Summarize this legal clause for me using the chat API with up to 256 output tokens — system: 'You are a legal summarization assistant', user: 'The indemnifying party shall defend, indemnify, and hold harmless the indemnified party from and against any and all claims arising from third-party intellectual property infringement.'"}],"resultDescription":"Returns an OpenAI-compatible chat completion response containing the assistant's generated message, model used, finish reason, and token usage (prompt tokens, completion tokens, total tokens).","failureModes":["Invalid or unsupported model ID returns an error — use GET /v1/models to fetch available models","Missing required 'messages' field or malformed message objects cause 400 validation errors","Exceeding model context window with large message arrays may result in truncation or error","Payment failure via x402 protocol returns 402 Payment Required","max_tokens set too low may result in truncated or incomplete responses","Network timeouts possible for large max_tokens values with slow model inference"],"whenToPreferThis":"Choose this endpoint when you need an OpenAI-compatible chat completion API with transparent per-call micropayment pricing via the x402 protocol, particularly useful for agents that need to pay for inference on a per-request basis without a subscription. Prefer this over standard OpenAI when you want token-counted pricing (input tokens + max output tokens) and compatibility with the x402 payment standard.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T06:32:59.851Z","isFirstParty":false,"canonicalSlug":"polygon-mapleai-chat-completions-fed5a013"}