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.
auto, eco, premium) — $0.00. No on-chain challenge. Bypasses the paywall.gpt-5.2, claude-opus-5, deepseek-v4-pro) — charged at upstream cost + 30% margin. Amount varies by model and token count.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
}
| Field | Type | Description |
|---|---|---|
| model | string | Model ID. Short names accepted: gpt-5.2, claude-opus-5, deepseek-v4-pro. Free aliases: auto, eco, premium. |
| messages | array | Required. Conversation messages with role (system/user/assistant) and content. |
| max_tokens | integer | Max tokens to generate (default 1024, max 4096). Lower values reduce cost for paid models. |
| temperature | number | Sampling temperature 0–2 (default 0.7). |
{
"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
}
}
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).
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.
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"}]}'