Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Random Number Generator

math.random_number

ProductionBounded custom (Class B)best-effortinstantv1.0.0
No network

Overview

You set min and max, both inclusive, and we draw one integer uniformly from a cryptographically secure generator. Omit the bounds and we use 0 through 1000000, and you can send a batch array of up to 100 ranges to draw several at once. There is no seed to set and every call gives you a fresh value — do not use this when you need reproducible output or unique identifiers.

LLMs simulate randomness through pattern completion — you need a cryptographic source for unpredictable integers.

Reliability

Non-deterministic by design: the same input gives you a different value almost every call, and only min and max come back unchanged. There is no seed parameter — we neither accept nor return one — so a draw cannot be reproduced or predicted from earlier draws. Bounds are inclusive and every value in [min, max] is equally likely, with no modulo bias. The draw comes from the platform's cryptographically secure generator, but a returned number is ordinary response data, not a secret: for tokens, identifiers or key material reach for a dedicated token skill instead. Input validation (not retryable): min greater than max, bounds that are neither an integer nor a numeric string, or a batch larger than 100 — fix the input before retrying.

Context footprint

One call replaces flawed LLM randomness with a real RNG. A single draw costs 1 execution credit; a batch costs 1 credit per item.

When to use it

When an agent needs a genuinely unpredictable integer within bounds.

When you need reproducibility, unique IDs, or floating-point values.

Scope

Note
Generates cryptographically secure random integers within bounds you specify.

Non-goals

  • Does not generate UUIDs (use platform.entropy_token)
  • Does not produce floating-point numbers
  • Does not guarantee statistical distribution beyond uniform integers

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

mathrandomness

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input256 B

How we handle your data

Structured input
What this means

This skill only accepts structured technical values such as numbers, booleans, enums, timestamps, or identifiers. It does not process free-form text, files, or documents.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
minintegerNoInclusive lower bound for a single draw; omit it for 0.
maxintegerNoInclusive upper bound for a single draw; omit it for 1000000.
batcharrayNoBounded array of per-draw ranges, 1 through 100 closed min/max objects; omit it for a single draw.

Output schema

FieldTypeRequiredDescription
valueintegerYesRandom integer returned for a single draw.
minintegerYesEffective lower bound returned for a single draw.
maxintegerYesEffective upper bound returned for a single draw.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"math.random_number","input":{"min":1,"max":100}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("math.random_number", {"min":1,"max":6});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not generate UUIDs (use platform.entropy_token)
  • Does not produce floating-point numbers
  • Does not guarantee statistical distribution beyond uniform integers
  • Unique identifiers or API tokens (use platform.entropy_token)
  • Cryptographic key material (use platform.entropy_token)
  • Reproducible or seeded random sequences

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "math.random_number",
  "input": {
    "min": 1,
    "max": 6
  }
}

Examples

Six-sided die — min 1, max 6

Inputjson
{
  "min": 1,
  "max": 6
}
Expected outputjson
{
  "min": 1,
  "value": 4,
  "max": 6
}

Draw above a floor and let the ceiling default

Inputjson
{
  "min": 1000
}
Expected outputjson
{
  "min": 1000,
  "value": 486213,
  "max": 1000000
}
  • Dice rolls, coin flips, or lottery-style draws in game agents
  • Pick a random index when you know the collection size
  • Batch-generate several bounded random values in one call

Avoid for

  • Unique identifiers or API tokens (use platform.entropy_token)
  • Cryptographic key material (use platform.entropy_token)
  • Reproducible or seeded random sequences

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

generationmath