OpenAI-compatible chat completions priced from the request itself
agent402.tools/v1/metered/chat/completions
OpenAI-compatible chat completions priced from the request itself: the 402 quotes this exact body, from $0.001, and a buyer on the upto scheme settles the tokens actually used under that quote. Use it when an agent sends large or variable prompts and wants to pay for what it sends, not a flat tier.
POST
https://agent402.tools/v1/metered/chat/completionsUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agent402.tools/v1/metered/chat/completions", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Reply with exactly: OK"}],"max_tokens":5}),
});
console.log(await res.json());Example input
{
"model": "openai/gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Reply with exactly: OK"
}
],
"max_tokens": 5
}