X

x402-gateway · Tools LLM Chat

by x402-gateway

POSTBase

$0.05

per call · USD Coin on Base

LLM Chat: Chat with a language model. OpenAI-compatible /v1/chat/completions interface. Supports 50+ models. Free models (auto, eco, premium) are $0 — paid models (gpt-5.2, claude-opus-5, deepseek-v4-pro, ...) are charged at cost. See /tools/llm_chat/models for the full model list and rates. Pay per call in USDC on Base via x402 — POST https://x402.freeq.one/tools/llm_chat.

Endpoint

POST https://x402.freeq.one/tools/llm_chat

5

Calls / 30d

1

Unique payers / 30d

Aug 27

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://x402.freeq.one/tools/llm_chat", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "max_tokens": {
      "description": "Maximum tokens to generate (default 1024, max 4096). Lower values reduce cost for paid models.",
      "type": "integer"
    },
    "messages": {
      "description": "Conversation messages array",
      "items": {
        "properties": {
          "content": {
            "description": "Message text content",
            "type": "string"
          },
          "role": {
            "description": "Message role",
            "enum": [
              "system",
              "user",
              "assistant"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "model": {
      "description": "Model ID. Examples: auto/eco/premium (free, $0.002), openai/gpt-5.2, anthropic/claude-opus-5, google/gemini-3.1-pro, deepseek/deepseek-v4-pro. Short names accepted (gpt-5.2, claude-opus-5). See /tools for full list.",
      "type": "string"
    },
    "temperature": {
      "description": "Sampling temperature 0-2 (default 0.7)",
      "type": "number"
    }
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://x402.freeq.one/tools/llm_chat" \
  -H "Content-Type: application/json" \
  -d '{"max_tokens":{"description":"Maximum tokens to generate (default 1024, max 4096). Lower values reduce cost for paid models.","type":"integer"},"messages":{"description":"Conversation messages array","items":{"properties":{"content":{"description":"Message text content","type":"string"},"role":{"description":"Message role","enum":["system","user","assistant"],"type":"string"}},"type":"object"},"type":"array"},"model":{"description":"Model ID. Examples: auto/eco/premium (free, $0.002), openai/gpt-5.2, anthropic/claude-opus-5, google/gemini-3.1-pro, deepseek/deepseek-v4-pro. Short names accepted (gpt-5.2, claude-opus-5). See /tools for full list.","type":"string"},"temperature":{"description":"Sampling temperature 0-2 (default 0.7)","type":"number"}}' \
  -H "X-PAYMENT: <signed x402 payment>"

Payment details

Pay to0x90b0dc893406d6ea63bb077ed59f5e8340f98d84
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of AI & Inference and the homepage with a featured placement.

Get featured →

More from x402-gateway & similar services