{"uid":"cap_xg1K25rv7fR21dnvE6fbg","slug":"model-access-gateway-grok-4-7-chat-completions-2c54b3e3","name":"Model Access Gateway – Grok 4.7 Chat Completions","description":"LLM inference API: OpenAI-compatible chat completions for 136 AI models (Claude, GPT, Gemini, Grok, DeepSeek, Qwen, Kimi, GLM), paid per call in USDC on Base with x402. No account, no API key, automatic refund if the model fails.","url":"https://agent402-arb.rosariovitale0096.workers.dev/llm/grok-4.7?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"model":{"type":"string","description":"Optional: fixed by the route (xai/grok-4.7)"},"tools":{"type":"array"},"stream":{"type":"boolean","description":"true: server-sent events after payment"},"messages":{"type":"array","items":{"type":"object","required":["role"],"properties":{"role":{"enum":["system","user","assistant","tool","developer"],"type":"string"},"content":{"type":["string","array","null"]}}},"minItems":1},"max_tokens":{"type":"integer","maximum":16384,"minimum":1,"description":"Optional, default 4096"},"temperature":{"type":"number","maximum":2,"minimum":0},"response_format":{"type":"object"}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-7f3c2a91","model":"xai/grok-4.7","usage":{"total_tokens":10,"prompt_tokens":9,"completion_tokens":1},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"OK"},"finish_reason":"stop"}],"created":1791979200}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0091","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.0091/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0091","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0091","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_5xXgun6zd_q2-psnXot2T","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0091","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Provides OpenAI-compatible chat completions via xAI's Grok 4.7 model, paid per request in USDC on Base using the x402 payment protocol — no account or API key required.","exampleAgentPrompt":"Using the Grok 4.7 pay-per-request gateway, send a chat message asking 'What are the three laws of thermodynamics?' and return the assistant's response — pay the 0.0014 USDC fee automatically via x402 on Base.","exampleUseCases":[{"title":"Agentic Q&A without API accounts","prompt":"I need you to ask Grok 4.7 'Summarize the key differences between transformer and diffusion architectures' — use the pay-per-request gateway so I don't have to set up any API keys, just pay the micro-fee in USDC."},{"title":"Crypto-native LLM pipeline inference","prompt":"In my on-chain agent workflow, call Grok 4.7 with the system prompt 'You are a helpful DeFi assistant' and user message 'Explain impermanent loss in two sentences', paying with USDC on Base via x402."},{"title":"Rapid prototyping with Grok model","prompt":"I want to test Grok 4.7's reasoning — send it 'What is the capital of France and why is it historically significant?' through the OpenAI-compatible gateway and show me the response along with how many tokens were used."}],"resultDescription":"Returns an OpenAI-compatible chat completion JSON object containing the assistant's message content, finish reason (e.g. 'stop'), token usage breakdown (prompt, completion, total tokens), model identifier ('xai/grok-4.7'), and a unique completion ID.","failureModes":["Payment not included or insufficient USDC — returns HTTP 402 Payment Required","Malformed request body missing required fields (type, method, bodyType, body) — returns 400 Bad Request","Model temporarily unavailable upstream at xAI — may return 503 or timeout","Invalid JSON in chat messages — returns 400 parsing error","Network timeout on Cloudflare Worker — returns 524 or 504"],"whenToPreferThis":"Choose this endpoint when you need Grok 4.7 specifically (xAI's model) via an OpenAI-compatible interface, want pay-per-request billing in USDC without registering an account or managing API keys, and are operating in a crypto-native or x402-enabled agent environment on Base. Prefer it over centralized LLM APIs when you need accountless, trustless inference access or are building agentic workflows that pay for compute on-chain.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-15T12:32:05.768Z","isFirstParty":false,"canonicalSlug":"model-access-gateway-grok-4-7-chat-completions-2c54b3e3"}