Cookbook

Copy-paste recipes that run offline.

Every sample in the cookbook runs without an API key — live calls were recorded once with cassette and replay offline forever. Clone, run, adapt.

cendorhq/cendor-cookbook →20 recipes · 0 API keys required

Showing 20 of 20 recipes

governed-agentruns offline ✓

A governed agent in ~10 lines — a real tool loop with a pre-flight budget, PII redaction, and a tamper-evident audit chain. Built on cendor-sdk.

cendor-sdktokenguardacttracecore
View recipe on GitHub →about the SDK →
openai-chatruns offline ✓

Instrument Chat Completions: budgets, recording, audit on the classic entrypoint.

OpenAIcoretokenguard
View recipe on GitHub →
openai-responsesruns offline ✓

The Responses API — the default for new OpenAI apps — through the same seam.

OpenAIcoretokenguard
View recipe on GitHub →
anthropicruns offline ✓

Budget + audit Claude calls, including prompt-cache read/write accounting.

Anthropiccoretokenguardacttrace
View recipe on GitHub →
langchainruns offline ✓

Wrap the client under a LangChain/LangGraph agent; budgets and audit ride unchanged.

LangChaincoretokenguardacttrace
View recipe on GitHub →
openai-agents-sdkruns offline ✓

A Responses-based agent loop with pre-flight budgets and a tamper-evident trail.

Agents SDKcoretokenguardacttrace
View recipe on GitHub →
llamaindexruns offline ✓

contextkit packing alongside a RAG pipeline — with the assembly receipt.

LlamaIndexcorecontextkitsqueeze
View recipe on GitHub →
ollama-localruns offline ✓

Fully local, zero-key, end-to-end: a llama3 agent that's budgeted, recorded, audited.

Ollamacoretokenguardcassetteacttrace
View recipe on GitHub →
azure-foundry-otelruns offline ✓

A managed runtime owns the loop — ingest its gen_ai.* spans and keep budgets + audit.

Azure AI Foundrycoretokenguardacttrace
View recipe on GitHub →
pytest-cassetteruns offline ✓

A real agent test suite: record once, replay in CI, xdist-safe cassette layout.

pytestcorecassette
View recipe on GitHub →
eu-ai-act-evidenceruns offline ✓

Decisions, human oversight, policy flags → export an evidence pack and verify it offline.

EU AI Actcoreacttrace
View recipe on GitHub →
coreruns offline ✓

The instrument() seam: one wrap, and every model call emits exact usage + decimal cost on the bus.

Quickstartcore
View recipe on GitHub →
core-jsruns offline ✓

The same instrument() seam in TypeScript — exact token counts and decimal-exact money via @cendor/core.

TypeScriptcore
View recipe on GitHub →
tokenguardruns offline ✓

Budgets, spend tracking, and reports — enforced pre-flight, before the call ever runs.

Quickstarttokenguardcore
View recipe on GitHub →
contextkitruns offline ✓

Assemble a token-budgeted context window with an auditable packing receipt.

Quickstartcontextkitcore
View recipe on GitHub →
squeezeruns offline ✓

Deterministic prompt compression with reversible, content-addressed handles.

Quickstartsqueezecore
View recipe on GitHub →
cassetteruns offline ✓

Record a run once, replay it forever — deterministic, offline, free test fixtures.

Quickstartcassettecore
View recipe on GitHub →
acttraceruns offline ✓

A hash-chained audit log that verifies offline — one edited byte fails the chain.

Quickstartacttracecore
View recipe on GitHub →
governed-agent-jsruns offline ✓

The governed agent in TypeScript — zod tools, a pre-flight budget, and a tamper-evident audit chain on @cendor/sdk.

TypeScripttokenguardacttracecore
View recipe on GitHub →
Each recipe is also a regression test — the recorded cassettes double as real-provider response fixtures for CI (no keys, no cost).
Get started

git clone → uv run — that's it.

$ git clone https://github.com/cendorhq/cendor-cookbook

every recipe: uv run recipes/<name>/main.py · no keys · docs →