Providers
Every supported provider, the address to use, and what stays on your side.
The address always has the same shape: https://gw.leashgate.com/k/<Leashgate key>/a/<agent name>/<provider path>. The agent name is optional. Your provider credentials travel with each request, as they do today, and Leashgate never stores them.
| Provider | Replaces the base URL with | Environment variable | Stays on your side |
|---|---|---|---|
| OpenAI | …/openai/v1 | OPENAI_BASE_URL | OPENAI_API_KEY |
| Anthropic | …/anthropic | ANTHROPIC_BASE_URL | ANTHROPIC_API_KEY |
| Google Gemini | …/gemini | set it in the client | GEMINI_API_KEY |
| Google Vertex AI | …/vertex | set it in the client | service account (JSON) |
| Azure OpenAI | …/azure/<resource> | AZURE_OPENAI_ENDPOINT | AZURE_OPENAI_API_KEY |
| Mistral | …/mistral/v1 | set it in the client | MISTRAL_API_KEY |
| Groq | …/groq/openai/v1 | set it in the client | GROQ_API_KEY |
| DeepSeek | …/deepseek/v1 | set it in the client | DEEPSEEK_API_KEY |
| OpenRouter | …/openrouter/api/v1 | set it in the client | OPENROUTER_API_KEY |
| xAI (Grok) | …/xai/v1 | set it in the client | XAI_API_KEY |
| Together AI | …/together/v1 | set it in the client | TOGETHER_API_KEY |
| Fireworks | …/fireworks/inference/v1 | set it in the client | FIREWORKS_API_KEY |
| Perplexity | …/perplexity | set it in the client | PERPLEXITY_API_KEY |
| Cerebras | …/cerebras/v1 | set it in the client | CEREBRAS_API_KEY |
| Qwen (Alibaba) | …/qwen/compatible-mode/v1 | set it in the client | DASHSCOPE_API_KEY |
| Moonshot (Kimi) | …/moonshot/v1 | set it in the client | MOONSHOT_API_KEY |
| Cohere | …/cohere/compatibility/v1 | set it in the client | COHERE_API_KEY |
OpenAI
# Render, Vercel, Railway, Docker, .env…: add one variable.
OPENAI_BASE_URL=https://gw.leashgate.com/k/lg_your_key/a/support-bot/openai/v1
# OPENAI_API_KEY stays as it is. No code change for the official SDKs.Anthropic
# Add one variable where your agent runs.
ANTHROPIC_BASE_URL=https://gw.leashgate.com/k/lg_your_key/a/support-bot/anthropic
# ANTHROPIC_API_KEY stays as it is. No code change for the official SDKs.Google Gemini
import os
from google import genai
client = genai.Client(
api_key=os.environ["GEMINI_API_KEY"], # unchanged
http_options={"base_url": "https://gw.leashgate.com/k/lg_your_key/a/support-bot/gemini"},
)Google Vertex AI
from google import genai
# Your service-account file (GOOGLE_APPLICATION_CREDENTIALS) stays where it is.
client = genai.Client(
vertexai=True, project="my-project", location="us-central1",
http_options={"base_url": "https://gw.leashgate.com/k/lg_your_key/a/support-bot/vertex"},
)Azure OpenAI
# Replace your endpoint. Your Azure key stays as it is.
AZURE_OPENAI_ENDPOINT=https://gw.leashgate.com/k/lg_your_key/a/support-bot/azure/my-resource
# "my-resource" is the name in https://my-resource.openai.azure.comOther OpenAI-compatible providers
Mistral, Groq, DeepSeek, OpenRouter, xAI, Together, Fireworks, Perplexity, Cerebras, Qwen, Moonshot and Cohere use their OpenAI-compatible API: set the OpenAI client's base URL to the address in the table and keep their key as the API key.
Your own server or an SDK that only takes a host name
Keep the Leashgate key out of the URL by sending it as a header: use https://gw.leashgate.com/p/<provider path> with x-leash-key: lg_…. SDKs that only accept a host name (the older @google-cloud/vertexai) can use gw.leashgate.com as the API endpoint with the same header.
What is checked
- Every call: daily budget, loop detection and quarantine, personal data masking in the text you send (images and files are left untouched).
- Tool calls in normal answers: judged against your policies and removed when a rule blocks them or asks for approval. The answer keeps the provider's own format.
- Streamed answers: tokens and cost are recorded; tool calls inside a stream are not held back. Use action checks for risky tools if your agent streams.
- Cost is estimated from public list prices per model. Unknown models use the default prices in Settings.
- Not supported as a gateway: AWS Bedrock (its request signature cannot be relayed). Use action checks instead.