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:

RecipePatternFile
OpenAI Agents SDKo3-deep-research-shaped agent with Krawl as the modelopenai-agents-sdk.py
Anthropic via MCPClaude calls Krawl tools over MCPanthropic-via-mcp.py
Vercel AI SDK streamTextStream a cited report into React or Nodevercel-ai-sdk-streamtext.ts
LangChain BaseRetrieverRAG with live web/X/crypto sourceslangchain-retriever.py
CrewAI toolDelegate deep research from an in-Crew analystcrewai-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-key

The response contains a krawl_demo_* key. Set it once:

export KRAWL_API_KEY=krawl_demo_xxx

House 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-Key header 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.

On this page