# D&D 5e Loot Generator API

> D&D 5e Loot Generator API is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Generates SRD-compliant D&D 5e treasure (coins, gems, art objects, magic items) scaled by challenge-rating band, with optional seeding for reproducibility

## Facts

- Endpoint: POST https://x402.agentutility.ai/loot-gen
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/d-d-5e-loot-generator-api-45698f90
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1NdM769jxtvNXp1GwPaUG

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability d-d-5e-loot-generator-api-45698f90 -d '<json body>'
```

Example prompt: Roll me a full treasure hoard for a CR 11 D&D 5e encounter — include coins, gems, art objects, and a magic item slot, and use seed 42 so I can reproduce it later.

## When to prefer this

Choose this endpoint when you need SRD-compliant, mathematically scaled D&D 5e treasure generation — especially when reproducibility via seeding matters (e.g. published modules or automated campaign tools). Prefer it over manual table lookups or LLM-improvised loot when consistency with the 5e treasure math is required. Best for agents running tabletop automation workflows, virtual tabletop (VTT) integrations, or game-master assistant bots.

## Known failure modes

- Invalid or out-of-range challenge rating band returns a 400 error
- Payment not settled (x402 USDC payment failure) results in a 402 response and no loot generated
- Missing required POST body fields return validation errors
- Non-numeric seed value may be rejected or ignored depending on implementation

## How this service works

Loot generator / treasure generator API for D&D 5e. Rolls coins (and, for hoards, gems/art objects and a magic-item slot) scaled by a challenge-rating band. SRD-style treasure math (OGL 1.0a / CC-BY-4.0). Seedable.

## Output

Returns a structured breakdown of treasure: coin denominations (CP, SP, EP, GP, PP) rolled according to 5e SRD tables for the specified CR band; for hoard requests, also includes gem and art object tables plus a rolled magic item slot. Results are deterministic when a seed is provided.

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "type": "hoard",
  "coins": {
   "gp": 1500,
   "pp": 90
  },
  "valuables": [
   "jade",
   "silver ewer"
  ],
  "magic_items": [
   "potion of greater healing"
  ],
  "approx_total_gp": 3409,
  "challenge_rating": 8
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/d-d-5e-loot-generator-api-45698f90/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
