# Telnyx x402 Llama 3.1 8B Chat Completions

> Telnyx x402 Llama 3.1 8B Chat Completions is a paid API for AI agents from x402.telnyx.com, paid per call via x402, $0.002237/call, status unknown (last checked 2026-10-10).

Generate chat completions using Meta-Llama-3.1-8B-Instruct via Telnyx's x402 pay-per-request USDC gateway

## Facts

- Endpoint: POST https://x402.telnyx.com/v1/chat/completions/_t/llama-3.1-8b?utm_source=zero.xyz
- Price: $0.002237/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/telnyx-x402-llama-3-1-8b-chat-completions-17a71178
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_12-5HIaWkY1y7OehXF42L

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-llama-3-1-8b-chat-completions-17a71178 -d '<json body>'
```

Example prompt: Ask the Llama 3.1 8B model on Telnyx to explain what a Merkle tree is in simple terms — keep the response under 200 tokens and use a temperature of 0.7.

## When to prefer this

Choose this endpoint when you need a lightweight, fast, open-weight LLM (Llama 3.1 8B) with no subscription commitment, paying only per call in USDC via the x402 micropayment protocol. Ideal for agentic workflows that need to control LLM spend at the request level, or for apps that want an OpenAI-compatible chat API without storing credentials. Prefer larger models (like Llama 70B or GPT-4) for complex reasoning tasks; use this for simpler generation, summarization, or classification where cost efficiency matters.

## Known failure modes

- Insufficient USDC balance causes HTTP 402 payment required
- Messages array exceeds 32 items returns validation error
- Content exceeds 8000 character limit per message
- max_tokens above 512 rejected by schema validation
- Invalid role value in messages array causes 422 error
- Model identifier mismatch (must be meta-llama/Meta-Llama-3.1-8B-Instruct) causes routing error
- Temperature outside 0-2 range returns validation error

## How this service works

Chat completions via Telnyx Inference (meta-llama/Meta-Llama-3.1-8B-Instruct). OpenAI-compatible. $0.002237 USDC per call.

## Output

Returns an OpenAI-compatible chat completion JSON object containing the assistant's reply message, finish reason (e.g. 'stop'), token usage breakdown (prompt, completion, total tokens), and a unique completion ID. The choices array contains exactly one completion.

## 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": "meta-llama/Meta-Llama-3.1-8B-Instruct",
   "description": "Model identifier; fixed to meta-llama/Meta-Llama-3.1-8B-Instruct 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": 8000
     }
    }
   },
   "maxItems": 32,
   "description": "OpenAI-style chat messages."
  },
  "max_tokens": {
   "type": "integer",
   "maximum": 512,
   "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-llama-3-1-8b-chat-completions-17a71178/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)
