83trust / 100

Llm

by LLM inference in AI models & inference

x402 APIPassing, checked 3 h ago

LLM inference proxy - send an OpenAI-format chat/completions request and get a response from GPT-4o-mini. Supports vision (up to 2 image URLs, low detail) and structured output (response_format: json_object or json_schema). No API key needed; pay per call via x402. Input capped at 16k chars, output at 4096 tokens.

POST https://agent402.tools/api/llm

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
199 ms typical, 199 ms slowest 5%
Last check
3 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/api/llm" \
  -H "content-type: application/json" \
  -d '{"max_tokens":64,"messages":[{"content":"Say hello in one sentence.","role":"user"}],"model":"gpt-4o-mini"}'
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%2Fapi%2Fllm
const res = await pay("https://agent402.tools/api/llm", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"max_tokens":64,"messages":[{"content":"Say hello in one sentence.","role":"user"}],"model":"gpt-4o-mini"}),
});
console.log(await res.json());

Example input

{
  "max_tokens": 64,
  "messages": [
    {
      "content": "Say hello in one sentence.",
      "role": "user"
    }
  ],
  "model": "gpt-4o-mini"
}

Example output

{
  "choices": [
    {
      "finish_reason": "stop",
      "message": {
        "content": "Hello! How can I help you today?",
        "role": "assistant"
      }
    }
  ],
  "model": "gpt-4o-mini",
  "provider": "openai",
  "usage": {
    "completion_tokens": 8,
    "prompt_tokens": 12,
    "total_tokens": 20
  }
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402199 ms$0.01
8 h agoPassed402327 ms$0.01