canonical: https://jentic.com/apis/dnd5eapi.co/dnd5eapi

# Dnd5eapi D&D 5e API

The D&D 5e API is an open, read-only reference for Dungeons & Dragons 5th Edition data drawn from the Systems Reference Document, including ability scores, classes, races, spells, monsters, equipment and rules. It exposes 47 GET endpoints under https://www.dnd5eapi.co/api covering character-building data and game mechanics, with no authentication required. The 5e-bits project attaches its own OpenAPI document to each GitHub release of the API; the specification behind this page is an earlier revision of that same project document, covering the same 47 operations on the unversioned /api/ paths, which the live service now 301-redirects to their `/api/2014`/ equivalents. Useful for character generators, encounter builders, rules lookup tools, and AI agents that need structured tabletop reference data.

## For AI agents

Look up D&D 5e Systems Reference Document data such as classes, spells, monsters and equipment to power character builders, rules helpers, or campaign tools.

## Scope

Does not handle homebrew content, non-SRD published material, character persistence, or dice-rolling - use for SRD reference data lookup only.

## Capabilities

- Look up ability scores, skills and proficiencies for character sheet generation
- Retrieve full class definitions including features, levels, spellcasting and subclasses
- Search the spell catalogue by index or class to populate spell lists
- Pull monster stat blocks for encounter builders and combat trackers
- Browse equipment and magic item details with weight, cost and damage data
- Fetch alignments, conditions, damage types and other rules references
- Retrieve race and subrace traits to drive character creation flows

## Use cases

### Character Sheet Generator

Populate a 5e character sheet with canonical SRD data by pulling races, classes, backgrounds, ability scores, skills and starting equipment from a single source. The API exposes 47 GET endpoints covering every character-build resource, so a generator can render legal options without bundling its own dataset. Integration takes hours since there is no auth and responses are cleanly indexed.

Example prompt: Fetch the class details for `/api/classes/wizard`, then list its level-1 spell options from `/api/classes/wizard/levels/1/spells` and return them as a chooseable spell list.

### Encounter and Combat Helper

Build a DM tool that pulls monster stat blocks, spell descriptions and condition rules at runtime. Endpoints under `/api/monsters` and `/api/spells` return complete combat-ready data including hit points, actions, damage dice and saving throws. Useful for virtual tabletops, initiative trackers and rules-lookup chatbots running during live sessions.

Example prompt: Retrieve `/api/monsters/beholder` and extract its hit_points, armor_class, and legendary_actions to seed an encounter tracker entry.

### Rules Reference Chatbot

Power a Discord or web chatbot that answers rules questions by querying canonical SRD content. Endpoints for ability scores, skills, conditions, damage types and equipment categories let an agent answer 'what does the Grappled condition do?' or 'how much does plate armor cost?' with authoritative text. No rate limits or keys are advertised, making it suitable for community projects.

Example prompt: Call `/api/conditions/grappled` and return the description text along with the index for citation in a chat reply.

### AI Agent Game Master Companion

Through Jentic, an AI game-master agent can resolve player questions, build NPC stat blocks and validate character choices against the SRD without bundling D&D data. The agent searches Jentic for an intent like 'look up a 5e spell', loads the operation schema and calls the endpoint with one line. This avoids stale local copies and keeps responses anchored to the official SRD subset.

Example prompt: Use Jentic to search 'look up a D&D spell', load the `/api/spells/{index}` operation, and execute it with index='fireball' to return casting time, range, and damage.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/classes/{index}` | Get full details for a character class |
| GET | `/api/classes/{index}/spells` | List spells available to a class |
| GET | `/api/spells/{index}` | Get a spell description and mechanics |
| GET | `/api/monsters/{index}` | Get a monster stat block |
| GET | `/api/equipment/{index}` | Get equipment item details |
| GET | `/api/races/{index}` | Get race details and traits |
| GET | `/api/ability-scores/{index}` | Get an ability score and its skills |

## Key resources

- **Classes** — Class definitions, levels, features, spellcasting and subclasses
- **Spells** — Full spell list with descriptions, level, school and components
- **Monsters** — Monster stat blocks with actions, hit points and abilities
- **Equipment** — Weapons, armor, gear and magic items with cost and properties
- **Races** — Races, subraces and racial traits
- **Rules** — Conditions, damage types, alignments and rules sections

## Why Jentic

- **Setup:** The D&D 5e API needs no credentials, so wiring it by hand mostly means learning its index-based routes for classes, spells, and monsters yourself. Through Jentic you install once, import the D&D 5e API from the API Directory, and your agent calls it with no token to manage.
- **Permission scoping:** The D&D 5e API is read-only SRD reference data, so scope your agent to the lookup operations it needs, such as fetching a spell or a monster stat block by index. You choose the operations it may call, so class or equipment lookups are not included unless you add them.
- **Credential handling:** The D&D 5e API requires no credentials, so there is no token to store; your Jentic One instance simply executes the calls. No secret ever enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'look up a D&D spell' or 'fetch a monster stat block', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **GitHub API** — Hosts the underlying 5e SRD database and API source repositories used to build companion tools
- **Open edX LMS API** — Education content delivery API - different domain but similar 'reference content' integration pattern
- **GitHub REST API** — Host D&D content on GitHub; agents can fetch markdown/JSON via GitHub.
- **OpenAI API** — Combine with LLMs to generate dynamic D&D narrative around dnd5eapi facts.

## FAQ

### Which OpenAPI specification does this D&D 5e API page describe?

An earlier revision of the 5e-bits project's own OpenAPI document, covering 47 read-only D&D 5e API operations. The maintainers now attach an updated OpenAPI document to each GitHub release of the API at `https://github.com/5e-bits/5e-srd-api/releases/latest/download/openapi.json`, which describes the same 47 operations under versioned `/api/2014`/ paths scoped to the 2014 ruleset. The revision here keeps the unversioned /api/ paths, which the live service 301-redirects to their `/api/2014`/ equivalents, so a redirect-following client resolves an existing call without rewriting every route. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the D&D 5e API use?

The D&D 5e API requires no authentication. Every endpoint is read-only GET and publicly accessible at https://www.dnd5eapi.co/api. When called through Jentic, no credentials need to be stored or rotated, which makes it a good first integration for testing the search-load-execute flow.

### Can I retrieve a complete monster stat block with the D&D 5e API?

Yes. Call GET `/api/monsters/{index}` with an index like 'beholder' or 'goblin' to retrieve hit points, armor class, ability scores, actions, and legendary actions in a single response, sufficient to drive a virtual tabletop or combat tracker.

### What are the rate limits for the D&D 5e API?

The D&D 5e API does not document hard rate limits, but the maintainers ask consumers to cache responses where possible since the dataset is static SRD content. Jentic agents that repeatedly look up the same spell or monster should cache locally rather than re-query.

### How do I get a class spell list with the D&D 5e API through Jentic?

Search Jentic for 'get D&D class spells', load the `/api/classes/{index}/spells` operation, and execute it with the class index (for example 'wizard'). The response returns the full spell list with names and references that can be drilled into via `/api/spells/{index}.`

### Is the D&D 5e API free to use?

Yes. The API is MIT-licensed and the underlying data is published under the SRD and OGL. There are no paid tiers and no signup, though donations to the maintainers are welcomed via their GitHub project.

### Can I limit what my agent is allowed to do with the D&D 5e API?

Yes. Because Jentic One is self-hosted, your own rules decide which operations and credentials your agent may use, and the D&D 5e API is read-only SRD reference data. You can scope the agent to only the lookup operations it needs, such as fetching a spell with GET `/api/spells/{index}` or a monster stat block with GET `/api/monsters/{index}.` Class, race, or equipment lookups stay out of reach unless you add them, so the operator controls exactly which endpoints the agent can call.
