Cookbook
Cookbook
Runnable recipes — Krawl wired into the agent SDKs your team already uses (OpenAI Agents, Anthropic via MCP, Vercel AI SDK, LangChain, CrewAI).
Each recipe is a single working file checked into docs/cookbook/ on this
repo and runs end-to-end from a clean checkout with a demo key. The files
are the source of truth — the page below quotes the same code.
Pick a runtime:
| Recipe | Pattern | File |
|---|---|---|
| OpenAI Agents SDK | o3-deep-research-shaped agent with Krawl as the model | openai-agents-sdk.py |
| Anthropic via MCP | Claude calls Krawl tools over MCP | anthropic-via-mcp.py |
Vercel AI SDK streamText | Stream a cited report into React or Node | vercel-ai-sdk-streamtext.ts |
LangChain BaseRetriever | RAG with live web/X/crypto sources | langchain-retriever.py |
| CrewAI tool | Delegate deep research from an in-Crew analyst | crewai-tool.py |
Get a demo key
Every recipe assumes a Krawl API key on X-API-Key. Mint one with no
signup:
curl -X POST https://api.krawl.sh/auth/demo-keyThe response contains a krawl_demo_* key. Set it once:
export KRAWL_API_KEY=krawl_demo_xxxHouse rules
- Cite every claim. Krawl's synthesis step verifies citations against the fetched source text. If you re-prompt downstream, keep the source block in context.
- Stream when you can. Live SSE keeps wall-clock low and the user sees evidence as it lands. See SSE Events.
- Pay-as-you-go is supported. Drop the
X-API-Keyheader and Krawl returns a 402 challenge. See Payments & x402.
Versioning
Recipes are pinned to a runtime version when the file is checked in. If a recipe breaks against a newer SDK, the file's header is the source of truth — re-pin the upstream version on your side or open a docs issue.