# Telnyx x402 Gateway – GLM-5.2 Chat Completions

> Telnyx x402 Gateway – GLM-5.2 Chat Completions is a paid API for AI agents from x402.telnyx.com, paid per call via x402, $0.037526/call, status unknown (last checked 2026-10-12).

Pay-per-request chat completions using the zai-org/GLM-5.2 language model, billed in USDC via the x402 micropayment protocol

## Facts

- Endpoint: POST https://x402.telnyx.com/v1/chat/completions/_t/glm-5.2?utm_source=zero.xyz
- Price: $0.037526/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/telnyx-x402-gateway-glm-5-2-chat-completions-a62e4ee6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_xrPYisfZ75hNRNU8F6HZ0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability telnyx-x402-gateway-glm-5-2-chat-completions-a62e4ee6 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay USDC per request for Telnyx Inference and Audio (text-to-speech, speech-to-text) through x402.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/telnyx-x402-gateway-glm-5-2-chat-completions-a62e4ee6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.telnyx.com](https://www.zero.xyz/host/x402.telnyx.com/llms.txt)
