{"uid":"cap_VvYcFyfuxDjeAqbvnhnH_","slug":"model-access-gateway-grok-4-7-chat-completions-x402-usdc-3d52e2d5","name":"Model Access Gateway – Grok 4.7 Chat Completions (x402, USDC)","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://modelaccessgateway.com/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_qae6yqYqs-I1-S9eV73yZ","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":"Runs an OpenAI-compatible chat completion request against xAI's Grok 4.7 model, billed per-call in USDC on Base via x402 with no API key required.","exampleAgentPrompt":"Ask Grok 4.7 to explain the difference between proof-of-work and proof-of-stake in simple terms — pay the $0.0091 USDC per-call fee on Base and give me up to 512 tokens in the response.","exampleUseCases":[{"title":"Crypto-native agent using Grok","prompt":"I'm building an agent that needs to call Grok 4.7 without signing up for any API keys — can you send this message array to it and pay per call in USDC? The system prompt is 'You are a concise assistant' and the user asks 'Summarize the latest DeFi trends in 3 bullet points', with max 300 tokens."},{"title":"Streaming Grok response in real time","prompt":"Use Grok 4.7 to draft a short cover letter for a software engineer role at a Web3 startup — stream the response as server-sent events and keep it under 400 tokens."},{"title":"Tool-calling with Grok 4.7","prompt":"Call Grok 4.7 with a tools definition for a weather lookup function and this user message: 'What's the weather in Austin right now?' — pay per call in USDC and return whatever tool call it emits."}],"resultDescription":"Returns an OpenAI-compatible chat.completion JSON object containing the assistant's generated message, finish reason (stop, length, tool_calls), prompt/completion/total token counts, model name (xai/grok-4.7), and a unique completion ID. Streaming mode returns server-sent events chunks instead.","failureModes":["Payment insufficient or x402 handshake fails — no completion returned, USDC refunded automatically","Model error or timeout — automatic refund issued","Invalid messages array (missing role or empty array) — 400 validation error","max_tokens exceeds 16384 — 400 error","temperature out of range 0–2 — 400 error","Streaming requested but client does not handle SSE — partial or garbled response"],"whenToPreferThis":"Choose this endpoint when you need xAI's Grok 4.7 specifically and want to pay per call in USDC on Base without creating an xAI account or managing API keys. Ideal for crypto-native agents, permissionless pipelines, or one-off Grok inference where the automatic refund-on-failure guarantee matters. If you need a different model (Claude, GPT, Gemini), use the corresponding sibling route on this gateway.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-18T06:35:17.382Z","isFirstParty":false,"canonicalSlug":"model-access-gateway-grok-4-7-chat-completions-x402-usdc-3d52e2d5"}