API Reference

One endpoint. That's it. That's the API.

Authentication

All requests require an X-API-Key header. You can generate a key from your dashboard (once we build one).

Header
X-API-Key: diceify_sk_live_xxxxxxxxxxxxxxxx

Base URL

Production
https://api.diceify.se/api/v1
GET/api/v1/roll

Rolls a dice. Returns a random number between 1 and 6. That's literally all it does. We spent 4 sprints on this.

Headers

X-API-Keyrequired

Your API key. Without it, the dice refuses to roll.

Response

200 OK
{
  "result": 4,
  "hallucinated": "maybe",
  "timestamp": "2026-06-30T01:00:00Z",
  "disclaimer": "This number is not financial advice."
}

Error Responses

401 Unauthorized
{
  "error": "missing_api_key",
  "message": "The dice doesn't know who you are."
}
429 Too Many Requests
{
  "error": "rate_limited",
  "message": "The dice is tired. Try again in 60 seconds.",
  "retry_after": 60
}
503 Service Unavailable
{
  "error": "dice_on_break",
  "message": "dices responded that they are on a lunch break"
}

Example

cURL
curl -X GET https://api.diceify.se/api/v1/roll \
  -H "X-API-Key: diceify_sk_live_xxxxxxxxxxxxxxxx"
JavaScript
const response = await fetch("https://api.diceify.se/api/v1/roll", {
  headers: {
    "X-API-Key": "diceify_sk_live_xxxxxxxxxxxxxxxx",
  },
});

const { result } = await response.json();
console.log(`The dice rolled: ${result}`);
// The dice rolled: 4
// (it's always 4)

Rate Limits

PlanRequests / minNote
Basic Roll10The dice needs rest
Pro Roll100The dice had coffee
Enterprise Roll∞**Subject to dice mood