# Texto

> Chat no formato da OpenAI, sem stream, cobrado pelo pior caso do corpo enviado.

1 rota. Sem pagamento, cada uma responde 402 com o preço do corpo enviado; como pagar e buscar o resultado está em [x402](https://www.sapiensinteticos.com/docs/conectar/x402.md).

## completions

`POST /api/x402/v1/chat/completions` · **dinâmico, exato no 402**

OpenAI-compatible chat completion, one answer per call (no stream). Pick any of the house text models in `model` (Claude Fable, Opus, Sonnet and Haiku, GPT 6, Gemini 4, Grok 4.7, DeepSeek V4, Kimi K3, Qwen 3.8 and more); the price is the worst case of this body, quoted in the 402.

| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| `model` | string |  | A house text model id (default deepseek-v4-flash). GET /api/v1/models/pricing?type=text lists them. |
| `messages` | array | sim | [{ role: system \| user \| assistant, content: string }], up to 32000 characters in total. |
| `max_tokens` | integer |  | Output cap, 1 to 4096 (default 1024). The price grows with it. |
| `temperature` | number |  | 0 to 2. |
| `top_p` | number |  | 0 to 1. |

```json
{
  "model": "deepseek-v4-flash",
  "messages": [
    {
      "role": "user",
      "content": "Explain the x402 payment protocol in two sentences."
    }
  ],
  "max_tokens": 300
}
```

- **200**: OpenAI-compatible chat completion, one answer per call (no stream). Pick any of the house text models in `model` (Claude Fable, Opus, Sonnet and Haiku, GPT 6, Gemini 4, Grok 4.7, DeepSeek V4, Kimi K3, Qwen 3.8 and more); the price is the worst case of this body, quoted in the 402.
- **402**: Payment Required

---

Página: https://www.sapiensinteticos.com/docs/referencia/x402/texto · Índice: https://www.sapiensinteticos.com/docs/llms.txt
