Skip to content
Fourohtwo

flat-rate-llm.kikoribera03.workers.dev/v1/random/number

Use when an agent needs numbers in a range that will stand up to inspection: uniform random integers between your own bounds, with or without repeats, drawn with rejection sampling so the ends of the range are not slightly less likely, which is what modulo does. Do not use to choose among items (/v1/random/pick) or for a secret (/v1/random/password).

BasePolygonArbitrumUnchecked
POSThttps://flat-rate-llm.kikoribera03.workers.dev/v1/random/number

UptimeNot checked yet

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://flat-rate-llm.kikoribera03.workers.dev/v1/random/number", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"count":1,"max":100,"min":1}),
});
console.log(await res.json());

Example input

{
  "count": 1,
  "max": 100,
  "min": 1
}

More from Random number