Random Number Generator
math.random_number
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
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
Capabilities
Cost & billing
Flat rate per invocation
File handling
How we handle your data
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.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| min | integer | No | Inclusive lower bound for a single draw; omit it for 0. |
| max | integer | No | Inclusive upper bound for a single draw; omit it for 1000000. |
| batch | array | No | Bounded array of per-draw ranges, 1 through 100 closed min/max objects; omit it for a single draw. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| value | integer | Yes | Random integer returned for a single draw. |
| min | integer | Yes | Effective lower bound returned for a single draw. |
| max | integer | Yes | Effective upper bound returned for a single draw. |
API contract
POST /v1/executecurl -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}}'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
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 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)
{
"skillKey": "math.random_number",
"input": {
"min": 1,
"max": 6
}
}Examples
Six-sided die — min 1, max 6
{
"min": 1,
"max": 6
}{
"min": 1,
"value": 4,
"max": 6
}Draw above a floor and let the ceiling default
{
"min": 1000
}{
"min": 1000,
"value": 486213,
"max": 1000000
}Recommended use cases
- 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
Related skills
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.