Getting Started
1. Sign up for an account
Go to app.gomajordomo.com and create your account. You can sign up with email and password, or use GitHub or Google.
If you’re setting up Majordomo for a team, choose Create an Organization during signup to get shared API keys and team-wide usage tracking.
2. Create an API key
Once logged in, go to API Keys in the sidebar and click New API Key. Give it a name (e.g., production).
Optionally, create Proxy Keys for this API key. Proxy keys let you map a single key to different provider API keys (OpenAI, Anthropic, Gemini) — so your application code doesn’t need to manage provider credentials directly.
Copy your Majordomo API key. It starts with mdm_sk_.
3. Update your code
Point your LLM calls at the Majordomo gateway and add your API key as the X-Majordomo-Key header. The gateway detects the provider automatically from the request path.
Using the Python client library
pip install majordomo-llm # or: uv add majordomo-llm
from majordomo_llm import get_llm_instance
llm = get_llm_instance(
"anthropic", "claude-sonnet-4-20250514",
api_key="sk-ant-your-anthropic-key",
base_url="https://gateway.gomajordomo.com",
default_headers={"X-Majordomo-Key": "mdm_sk_your_key_here"},
)
response = await llm.get_response("Hello!")
print(response.content)
print(f"Cost: ${response.total_cost:.4f}")
Using curl
curl -X POST https://gateway.gomajordomo.com/v1/chat/completions \
-H "X-Majordomo-Key: mdm_sk_your_key_here" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Using the OpenAI Python SDK
from openai import OpenAI
client = OpenAI(
api_key="sk-your-openai-key",
base_url="https://gateway.gomajordomo.com/v1",
default_headers={"X-Majordomo-Key": "mdm_sk_your_key_here"},
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
The gateway detects the provider from the request path:
/v1/chat/completions,/v1/completions,/v1/embeddings,/v1/responses→ OpenAI/v1/messages→ Anthropic/<model>:generateContent→ Gemini
You can also set the provider explicitly with the X-Majordomo-Provider header.
Adding custom metadata
Attach metadata to requests using X-Majordomo- prefixed headers. These are stored with each request log and can be used for filtering in the dashboard:
curl -X POST https://gateway.gomajordomo.com/v1/chat/completions \
-H "X-Majordomo-Key: mdm_sk_your_key_here" \
-H "X-Majordomo-Feature: search" \
-H "X-Majordomo-Team: growth" \
-H "X-Majordomo-Environment: production" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "model": "gpt-4o", "messages": [{"role": "user", "content": "Hello!"}] }'
4. See your results
Go to the Usage page in the sidebar. You’ll see:
- Total requests, tokens, and cost across all your API keys
- Daily cost and token charts showing trends over time
- Breakdown by model and API key so you know where spend is going
Go to Requests to see individual request logs — response time, token counts, cost, metadata tags, and the full request/response bodies.
Activate metadata keys on the Metadata Keys page to enable filtering and dimension breakdowns by your custom metadata (e.g., break down cost by feature or team).
What’s next?
- Replay — Test cheaper models against your real production traffic. Go to Replay in the sidebar to create your first replay run.
- Evals — Build evaluation sets from logged requests and score model outputs with custom criteria. Find this under Evals.
- More metadata — The more metadata you attach (
feature,team,environment), the more useful your cost attribution becomes.