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

WhenResultHTTPTimePrice
8 min agoPassed402224 ms$0.002
4 h agoPassed402266 ms$0.002
7 h agoPassed402268 ms$0.002
11 h agoPassed402257 ms$0.002
15 h agoPassed402256 ms$0.002
18 h agoPassed402333 ms$0.002
22 h agoPassed402254 ms$0.002
25 h agoPassed402369 ms$0.002
29 h agoPassed402235 ms$0.002
33 h agoPassed402269 ms$0.002
36 h agoPassed402244 ms$0.002
41 h agoPassed402328 ms$0.002