78trust / 100
Chat Completions
by Onchain Router in AI models & inference
x402 APIPassing, checked 8 min ago
Request-priced LLM inference · 0% service fee launch promotion
POST https://onchainrouter.dev/v1/chat/completions
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 257 ms typical, 333 ms slowest 5%
- Last check
- 8 min ago
- Next check
- in 19 min
How to call it
# See the payment challenge (nothing is charged)
curl -i -X POST "https://onchainrouter.dev/v1/chat/completions" \
-H "content-type: application/json" \
-d '{"max_tokens":512,"messages":[{"content":"Hello","role":"user"}],"model":"gemini-3.6-flash","stream":false}'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%2Fonchainrouter.dev%2Fv1%2Fchat%2Fcompletions
const res = await pay("https://onchainrouter.dev/v1/chat/completions", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"max_tokens":512,"messages":[{"content":"Hello","role":"user"}],"model":"gemini-3.6-flash","stream":false}),
});
console.log(await res.json());Example input
{
"max_tokens": 512,
"messages": [
{
"content": "Hello",
"role": "user"
}
],
"model": "gemini-3.6-flash",
"stream": false
}Example output
{
"choices": [],
"id": "chatcmpl_example",
"model": "gemini-3.6-flash",
"object": "chat.completion",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0
}
}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 |
|---|---|---|---|---|
| 8 min ago | Passed | 402 | 224 ms | $0.002 |
| 4 h ago | Passed | 402 | 266 ms | $0.002 |
| 7 h ago | Passed | 402 | 268 ms | $0.002 |
| 11 h ago | Passed | 402 | 257 ms | $0.002 |
| 15 h ago | Passed | 402 | 256 ms | $0.002 |
| 18 h ago | Passed | 402 | 333 ms | $0.002 |
| 22 h ago | Passed | 402 | 254 ms | $0.002 |
| 25 h ago | Passed | 402 | 369 ms | $0.002 |
| 29 h ago | Passed | 402 | 235 ms | $0.002 |
| 33 h ago | Passed | 402 | 269 ms | $0.002 |
| 36 h ago | Passed | 402 | 244 ms | $0.002 |
| 41 h ago | Passed | 402 | 328 ms | $0.002 |