LeashgateDocs
Get started

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.

ProviderReplaces the base URL withEnvironment variableStays on your side
OpenAI…/openai/v1OPENAI_BASE_URLOPENAI_API_KEY
Anthropic…/anthropicANTHROPIC_BASE_URLANTHROPIC_API_KEY
Google Gemini…/geminiset it in the clientGEMINI_API_KEY
Google Vertex AI…/vertexset it in the clientservice account (JSON)
Azure OpenAI…/azure/<resource>AZURE_OPENAI_ENDPOINTAZURE_OPENAI_API_KEY
Mistral…/mistral/v1set it in the clientMISTRAL_API_KEY
Groq…/groq/openai/v1set it in the clientGROQ_API_KEY
DeepSeek…/deepseek/v1set it in the clientDEEPSEEK_API_KEY
OpenRouter…/openrouter/api/v1set it in the clientOPENROUTER_API_KEY
xAI (Grok)…/xai/v1set it in the clientXAI_API_KEY
Together AI…/together/v1set it in the clientTOGETHER_API_KEY
Fireworks…/fireworks/inference/v1set it in the clientFIREWORKS_API_KEY
Perplexity…/perplexityset it in the clientPERPLEXITY_API_KEY
Cerebras…/cerebras/v1set it in the clientCEREBRAS_API_KEY
Qwen (Alibaba)…/qwen/compatible-mode/v1set it in the clientDASHSCOPE_API_KEY
Moonshot (Kimi)…/moonshot/v1set it in the clientMOONSHOT_API_KEY
Cohere…/cohere/compatibility/v1set it in the clientCOHERE_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.com

Other 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.