Skip to main content
Change the base URL. Add the X-Majordomo-Key header. Nothing else.

OpenAI SDK

Streaming works unchanged — the gateway proxies the SSE stream transparently.

Anthropic SDK

Prompt caching tokens (cache_read_input_tokens, cache_creation_input_tokens) are tracked and priced separately.

Pydantic AI

No adapter needed — point Pydantic AI’s underlying provider client at the gateway and add the X-Majordomo-Key header. The same pattern works for any framework that lets you configure the base URL and headers of its HTTP client.
Add per-request metadata by passing extra headers through the model settings — for example AnthropicModelSettings(extra_headers={"X-Majordomo-Feature": "document-summarizer"}) on the agent.run(...) call.

majordomo-llm

A unified async Python client for OpenAI, Anthropic, Gemini, and more — with built-in cost tracking, structured output, and multi-provider cascade. Route it through the gateway by passing base_url and default_headers to get_llm_instance.
GitHub →

Metadata tagging

Add any X-Majordomo-* header to tag requests for cost attribution. Works with all SDKs above.
See Cost Attribution for how to query this data.