82trust / 100

Nano Messages

by Messages nano in AI models & inference

x402 APIPassing, checked 4 h ago

Anthropic Messages API over x402 - point the Anthropic SDK (or Claude Code / the Agent SDK) at base_url https://agent402.tools/v1/nano and pay $0.003 per call in USDC, no API key, no signup. Same models, caps and price as this tier's /chat/completions route; any model here is served through the Messages wire (Claude natively, others translated). Depth: `effort` (low..max) on Claude 4.7+, thinking.budget_tokens on older Claude. Up to 12,000 input chars and 768 output tokens; streaming supported.

POST https://agent402.tools/v1/nano/messages

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
184 ms typical, 184 ms slowest 5%
Last check
4 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/v1/nano/messages" \
  -H "content-type: application/json" \
  -d '{"max_tokens":256,"messages":[{"content":"Summarize x402 in one sentence.","role":"user"}],"model":"google/gemini-3.1-flash-lite"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.03:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fv1%2Fnano%2Fmessages
const res = await pay("https://agent402.tools/v1/nano/messages", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":256,"messages":[{"content":"Summarize x402 in one sentence.","role":"user"}],"model":"google/gemini-3.1-flash-lite"}),
});
console.log(await res.json());

Example input

{
  "max_tokens": 256,
  "messages": [
    {
      "content": "Summarize x402 in one sentence.",
      "role": "user"
    }
  ],
  "model": "google/gemini-3.1-flash-lite"
}

Example output

{
  "content": [
    {
      "text": "x402 is an HTTP-native way for agents to pay per request with USDC.",
      "type": "text"
    }
  ],
  "id": "msg_…",
  "model": "anthropic/claude-sonnet-5",
  "role": "assistant",
  "stop_reason": "end_turn",
  "type": "message",
  "usage": {
    "input_tokens": 14,
    "output_tokens": 18
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
4 h agoPassed402184 ms$0.003