{"uid":"cap_xrPYisfZ75hNRNU8F6HZ0","slug":"telnyx-x402-gateway-glm-5-2-chat-completions-a62e4ee6","name":"Telnyx x402 Gateway – GLM-5.2 Chat Completions","description":"Pay USDC per request for Telnyx Inference and Audio (text-to-speech, speech-to-text) through x402.","url":"https://x402.telnyx.com/v1/chat/completions/_t/glm-5.2?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"n":{"type":"integer","const":1,"description":"Fixed to one completion per paid call."},"model":{"type":"string","const":"zai-org/GLM-5.2","description":"Model identifier; fixed to zai-org/GLM-5.2 on this route."},"tools":{"type":"array","items":{"type":"object"},"maxItems":16},"messages":{"type":"array","items":{"type":"object","required":["role","content"],"properties":{"role":{"enum":["system","user","assistant","tool"],"type":"string"},"content":{"type":"string","maxLength":32000}}},"maxItems":32,"description":"OpenAI-style chat messages."},"max_tokens":{"type":"integer","maximum":2048,"minimum":1},"temperature":{"type":"number","maximum":2,"minimum":0}}},"responseSchema":{"type":"json","example":{"id":"chatcmpl-xxx","usage":{"total_tokens":16,"prompt_tokens":12,"completion_tokens":4},"object":"chat.completion","choices":[{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.037526","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.037526/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.037526","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.037526","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_meaB2Zao8i7E92ndeqnwJ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.037526","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pay-per-request chat completions using the zai-org/GLM-5.2 language model, billed in USDC via the x402 micropayment protocol","exampleAgentPrompt":"Using the GLM-5.2 model on Telnyx's x402 gateway, send this conversation — system: 'You are a helpful assistant', user: 'Explain quantum entanglement in two sentences' — with a max of 512 tokens and temperature 0.7, paying per request in USDC.","exampleUseCases":[{"title":"On-demand LLM for autonomous agent","prompt":"I need to query the GLM-5.2 model on Telnyx's x402 gateway with this message thread — system: 'You are a concise summarizer', user: 'Summarize the following article: [article text]' — keep it under 256 tokens and use temperature 0.3, billed per call so I don't pay a flat monthly fee."},{"title":"Tool-calling workflow with GLM-5.2","prompt":"Send this multi-turn conversation to GLM-5.2 via the Telnyx x402 gateway, including a tool definition for 'get_weather', and let the model decide whether to call the tool — messages: system 'You are a weather assistant', user 'What's the weather in Berlin?' — cap at 1024 tokens."},{"title":"Prototyping AI feature with pay-per-use billing","prompt":"I'm testing an AI chatbot and want to use the GLM-5.2 model through Telnyx's x402 pay-per-request gateway — just send a single user message 'Write me a haiku about the ocean' with temperature 1.0 and max 100 tokens, charged in USDC so I only pay for what I use."}],"resultDescription":"Returns an OpenAI-compatible chat.completion JSON object containing the assistant's reply text, finish reason (e.g. 'stop'), token usage breakdown (prompt, completion, total tokens), and a completion ID. The model is always zai-org/GLM-5.2.","failureModes":["Payment not received or USDC balance insufficient — 402 Payment Required returned","Invalid or missing messages array — 400 Bad Request","Content exceeds 32,000 character per message limit — validation error","max_tokens exceeds 2048 ceiling — rejected with schema validation error","Temperature outside 0–2 range — 400 Bad Request","Model field set to anything other than zai-org/GLM-5.2 — rejected (const constraint)","Upstream inference service timeout — 503 or timeout error"],"whenToPreferThis":"Choose this endpoint when you need OpenAI-compatible chat completions from the GLM-5.2 model specifically, want pay-as-you-go USDC micropayment billing rather than a monthly subscription, are building autonomous agents that need programmatic crypto-native payment flows via x402, or want to avoid API key management in favour of per-request stablecoin payment. Prefer alternatives if you need a different model, streaming responses, or responses longer than 2048 tokens.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T12:31:49.632Z","isFirstParty":false,"canonicalSlug":"telnyx-x402-gateway-glm-5-2-chat-completions-a62e4ee6"}