A 5e storytelling engine with an LLM DM
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use STORIED_ANTHROPIC_API_KEY to avoid collision with Claude Code

The SDK defaults to reading ANTHROPIC_API_KEY, which conflicts with
Claude Code's own API key when running storied from within it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+5 -2
+1 -1
.envrc.private.example
··· 1 1 # Copy this file to .envrc.private and fill in your API keys 2 2 # .envrc.private is gitignored and will not be committed 3 3 4 - export ANTHROPIC_API_KEY="your-api-key-here" 4 + export STORIED_ANTHROPIC_API_KEY="your-api-key-here"
+4 -1
src/storied/engine.py
··· 1 1 """DM Engine - the agentic loop for running D&D sessions.""" 2 2 3 3 import copy 4 + import os 4 5 from collections.abc import Iterator 5 6 from pathlib import Path 6 7 ··· 46 47 model: Claude model to use 47 48 prompt_name: System prompt to use (default: "dm-system", or "character-creation") 48 49 """ 49 - self.client = anthropic.Anthropic() 50 + self.client = anthropic.Anthropic( 51 + api_key=os.environ.get("STORIED_ANTHROPIC_API_KEY"), 52 + ) 50 53 self.model = model 51 54 self.world_id = world_id 52 55 self.player_id = player_id