LLM Chat

$0.001

Chat with a language model via an OpenAI-compatible /v1/chat/completions interface. Supports 50+ models. Free models are $0 (bypass the paywall entirely) — paid models are charged at cost + small margin.

FREE models: auto, eco, premium PAID models: gpt-5.2, claude-opus-5, deepseek-v4-pro, ...

Pricing

Request

POST /tools/llm_chat
Content-Type: application/json

{
  "model": "auto",
  "messages": [
    { "role": "user", "content": "Say hello in 3 words" }
  ],
  "max_tokens": 1024,
  "temperature": 0.7
}

Parameters

FieldTypeDescription
modelstringModel ID. Short names accepted: gpt-5.2, claude-opus-5, deepseek-v4-pro. Free aliases: auto, eco, premium.
messagesarrayRequired. Conversation messages with role (system/user/assistant) and content.
max_tokensintegerMax tokens to generate (default 1024, max 4096). Lower values reduce cost for paid models.
temperaturenumberSampling temperature 0–2 (default 0.7).

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "model": "free/gpt-oss-120b",
  "choices": [{
    "index": 0,
    "message": { "role": "assistant", "content": "Hello there! 👋" },
    "finish_reason": "stop"
  }],
  "usage": {
    "prompt_tokens": 66,
    "completion_tokens": 38,
    "total_tokens": 104
  }
}

Model Catalog

Fetch the full list of supported models and their rates dynamically:

GET /tools/llm_chat/models

Returns a JSON array of all models with id, name, upstreamCost, and whether the model is free (free: true).

Free-model bypass: When model is auto, eco, or premium, the paywall short-circuits before any on-chain challenge — the call completes with no USDC transfer. Paid models trigger the standard x402 payment flow.

Try it

curl -s 'https://x402.freeq.one/tools/llm_chat' \
  -H 'Content-Type: application/json' \
  -d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}'

# Paid model (triggers x402 challenge):
curl -s 'https://x402.freeq.one/tools/llm_chat' \
  -H 'Content-Type: application/json' \
  -d '{"model":"gpt-5.2","messages":[{"role":"user","content":"hi"}]}'