Skip to main content

1. Create a Proxy Key

1

Go to Settings

Navigate to app.meshai.dev/settings → Proxy Keys tab.
2

Create Key

Click “Create Proxy Key” and provide:
  • Label: descriptive name (e.g., “production-claude-code”)
  • Allowed models (optional): restrict which models this key can use
  • Budget limit (optional): monthly spend cap in USD
3

Copy Key

Copy the proxy key (msh_...). It’s shown once — save it securely.

2. Configure Your Agent

Method A: URL-Embedded Key (Simplest)

Embed the key in the base URL — works with tools that can’t set custom headers:
# Anthropic (e.g., Claude Code)
export ANTHROPIC_BASE_URL=https://proxy.meshai.dev/v1/anthropic/k/msh_YOUR_KEY

# OpenAI (e.g., Codex, Cline)
export OPENAI_BASE_URL=https://proxy.meshai.dev/v1/openai/k/msh_YOUR_KEY

Method B: Header-Based Key

Set the X-MeshAI-Key header and override the base URL:
export ANTHROPIC_BASE_URL=https://proxy.meshai.dev/v1/anthropic
# Then in your code, add header: X-MeshAI-Key: msh_YOUR_KEY

3. Verify

Make a request through your agent. Check the dashboard — you should see:
  • The agent appear in the Registry
  • Token usage in the Cost tab
  • Request count in the Dashboard

Budget Limits

If you set a budget limit on the proxy key, requests are blocked when the monthly spend exceeds the limit:
{"error": "Monthly budget limit exceeded for this proxy key"}

Managed Provider Keys

For enterprise deployments, MeshAI can manage your provider API keys via GCP Secret Manager. This means agents never see the raw provider key — MeshAI injects it at the proxy layer. Configure in Settings → Managed Keys.