LLM chat completion API: text generation with Llama 4 Scout

$0.002 per call · failed calls are never charged · no account or subscription: pay per call with a card key or USDC

LLM chat completion and text generation: send a prompt (or an OpenAI messages array with tools and JSON mode) and get an answer from Meta's Llama 4 Scout, up to 1,024 output tokens, in a couple of seconds; OpenAI-compatible at /v1/chat/completions. Use for drafting, summaries, classification, reasoning steps and any quick LLM call without an AI provider account.

Run it free (25 free calls) Buy credits by card (from $1) Example result (JSON)

Try it with your own inputs

User prompt, up to 8,000 characters

Uses one of your 25 free calls. Nothing is charged, and a call that fails is not counted.

Inputs

NameTypeDescription
prompt (required)stringUser prompt, up to 8,000 characters
systemstringOptional system prompt, up to 2,000 characters
maxTokensintegerMaximum output tokens, 1-1024 (default 400)
temperaturenumber0-1.5 (default 0.6)
messagesstringOptional OpenAI messages array as JSON (system, user, assistant with tool_calls, tool); replaces prompt and system. Together with tools, at most 20,000 characters
toolsstringOptional OpenAI tools array as JSON (function calling, up to 32 functions); the answer then carries tool_calls
tool_choicestringOptional: auto, none, required, or a JSON object naming one function
response_formatstringOptional OpenAI response_format as JSON: {"type":"json_object"} or a json_schema

Request

Over HTTP, with a card key from /credits:

curl -H "Authorization: Bearer adt_…" "https://agent-data-tools.revmesh2074.workers.dev/llm/chat?prompt=Explain%20x402%20in%20one%20sentence."

Or one of your 25 free calls, no key:

curl "https://agent-data-tools.revmesh2074.workers.dev/llm/chat?prompt=Explain%20x402%20in%20one%20sentence.&trial=1"

Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.

Example result

{
  "model": "@cf/meta/llama-4-scout-17b-16e-instruct",
  "response": "x402 lets software pay for an HTTP request with a stablecoin by answering a 402 Payment Required challenge.",
  "tool_calls": [],
  "finish_reason": "stop",
  "usage": {
    "prompt_tokens": 24,
    "completion_tokens": 22,
    "total_tokens": 46
  }
}

From an AI agent (MCP)

Add the MCP server to Claude, Cursor or any MCP client. This tool is llm_chat, and the first 25 successful calls are free:

https://agent-data-tools.revmesh2074.workers.dev/mcp

Related tools