83trust / 100
Metered Messages
by Messages metered in Email & messaging
x402 APIPassing, checked 11 min ago
The Anthropic Messages wire priced from the request itself: the 402 quotes this exact body, from $0.001, with upto buyers settling actual usage under the quote. Use it when an agent built on the Anthropic SDK, or Claude Code, needs any supported model paid per call with no account.
POST https://agent402.tools/v1/metered/messages
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 190 ms typical, 190 ms slowest 5%
- Last check
- 11 min ago
- Next check
- in 20 min
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/v1/metered/messages" \
-H "content-type: application/json" \
-d '{"max_tokens":256,"messages":[{"content":"Summarize x402 in one sentence.","role":"user"}],"model":"anthropic/claude-haiku-4.5"}'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.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fv1%2Fmetered%2Fmessages
const res = await pay("https://agent402.tools/v1/metered/messages", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"max_tokens":256,"messages":[{"content":"Summarize x402 in one sentence.","role":"user"}],"model":"anthropic/claude-haiku-4.5"}),
});
console.log(await res.json());Example input
{
"max_tokens": 256,
"messages": [
{
"content": "Summarize x402 in one sentence.",
"role": "user"
}
],
"model": "anthropic/claude-haiku-4.5"
}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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 11 min ago | Passed | 402 | 189 ms | $0.0019 |
| 3 h ago | Passed | 402 | 190 ms | $0.0019 |
| 9 h ago | Passed | 402 | 325 ms | $0.0019 |