Connect clients and applications
Getting your API key
Your API key for the gateway must include LLM proxy access. Print one with the CLI:
obot login --url https://obot.example.com --scope llm --print-token
Add --no-expiration if you want a key that doesn't expire.
Quick start with curl
Anthropic
export ANTHROPIC_BASE_URL="https://obot.example.com/api/llm-proxy/anthropic"
export ANTHROPIC_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# Assumes you have access to claude-opus-4.8 via a Model Access Policy
curl $ANTHROPIC_BASE_URL/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-opus-4.8","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
OpenAI
The OpenAI passthrough serves the OpenAI Responses API (/v1/responses).
export OPENAI_BASE_URL="https://obot.example.com/api/llm-proxy/openai"
export OPENAI_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# Assumes you have access to gpt-5.5 via a Model Access Policy
curl $OPENAI_BASE_URL/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.5","input":[{"role":"user","content":"hi"}]}'
Generic Responses Compatible
The Generic Responses route serves the Responses API using the base URL configured by your administrator. The upstream API key is optional, which supports local services such as Ollama as well as authenticated Responses API-compatible services such as LiteLLM.
export OPENAI_BASE_URL="https://obot.example.com/api/llm-proxy/generic-responses"
export OPENAI_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# Use a model name shown in the Generic Responses Compatible section of the Models page
curl $OPENAI_BASE_URL/v1/responses \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"open-model","input":[{"role":"user","content":"hi"}]}'
To list the Generic Responses models you can access:
curl $OPENAI_BASE_URL/v1/models \
-H "Authorization: Bearer $OPENAI_API_KEY"
Amazon Bedrock
Amazon Bedrock gateway routes proxy directly to Bedrock Mantle. You must use the /messages API with anthropic.* models and the /responses API with openai.* and google.* models. The gateway uses the requested endpoint to select the corresponding Bedrock API. Vendor-specific tools such as Claude Code and Codex choose the correct request path automatically.
Select the authentication method configured by your administrator. The selection is synchronized with the other Bedrock examples on this page.
- Static credentials
- API key
export OBOT_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# Anthropic-compatible Bedrock model
curl https://obot.example.com/api/llm-proxy/aws-bedrock/v1/messages \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"anthropic.claude-sonnet-5","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
# OpenAI-compatible Bedrock model
curl https://obot.example.com/api/llm-proxy/aws-bedrock/v1/responses \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"openai.gpt-5.4","input":[{"role":"user","content":"hi"}]}'
# List available Bedrock models
curl https://obot.example.com/api/llm-proxy/aws-bedrock/v1/models \
-H "Authorization: Bearer $OBOT_API_KEY"
export OBOT_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# Anthropic-compatible Bedrock model
curl https://obot.example.com/api/llm-proxy/aws-bedrock-api-key/v1/messages \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"anthropic.claude-sonnet-5","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
# OpenAI-compatible Bedrock model
curl https://obot.example.com/api/llm-proxy/aws-bedrock-api-key/v1/responses \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"openai.gpt-5.4","input":[{"role":"user","content":"hi"}]}'
# List available Bedrock models
curl https://obot.example.com/api/llm-proxy/aws-bedrock-api-key/v1/models \
-H "Authorization: Bearer $OBOT_API_KEY"
For Anthropic models on Bedrock, model availability depends on AWS region and account access. See the AWS Bedrock Anthropic model cards for region availability.
Azure
Azure has separate gateway routes for API key and Entra authentication. The gateway uses the request endpoint to select the model dialect:
Use /v1/messages for an AnthropicMessages deployment and /v1/responses for an OpenAIResponses deployment. Use the deployment name shown on the Models page as model; it is not used to select the request format.
Select the authentication method configured by your administrator. The selection is synchronized with the other Azure examples on this page.
- API key
- Entra ID
export OBOT_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# AnthropicMessages deployment
curl https://obot.example.com/api/llm-proxy/azure/v1/messages \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"my-claude-deployment","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
# OpenAIResponses deployment
curl https://obot.example.com/api/llm-proxy/azure/v1/responses \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"my-gpt-deployment","input":[{"role":"user","content":"hi"}]}'
# List available OpenAI-compatible Azure models
curl https://obot.example.com/api/llm-proxy/azure/v1/models \
-H "Authorization: Bearer $OBOT_API_KEY"
export OBOT_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# AnthropicMessages deployment
curl https://obot.example.com/api/llm-proxy/azure-entra/v1/messages \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"my-claude-deployment","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
# OpenAIResponses deployment
curl https://obot.example.com/api/llm-proxy/azure-entra/v1/responses \
-H "Authorization: Bearer $OBOT_API_KEY" \
-H "content-type: application/json" \
-d '{"model":"my-gpt-deployment","input":[{"role":"user","content":"hi"}]}'
# List available OpenAI-compatible Azure models
curl https://obot.example.com/api/llm-proxy/azure-entra/v1/models \
-H "Authorization: Bearer $OBOT_API_KEY"
Client requests always authenticate to Obot with the Obot API key. Obot supplies the Azure API key or obtains the Entra token upstream.
The Azure models endpoint uses Azure's OpenAI-compatible Models API and returns only accessible deployments configured for OpenAI Responses API. Clients may request either /v1/models or /openai/v1/models. Microsoft Foundry does not implement an Anthropic Models API, so Anthropic deployments are available on Obot's Models page but are not returned by this endpoint.
Provider setup
An administrator configures one of these providers under Model Providers:
- Azure requires the Azure resource endpoint (for example,
https://my-resource.services.ai.azure.com) and an API key. - Azure Entra requires the Azure resource endpoint plus tenant ID, client ID, and client secret for a service principal. Obot requests tokens for the
https://ai.azure.com/.defaultscope. Assign the service principal Cognitive Services User or Foundry User (formerly Azure AI User) on the specific Foundry resource. Cognitive Services OpenAI User may allow OpenAI requests but does not provide all permissions needed for Anthropic requests. See Azure provider configuration for portal instructions and official references.
Configure each model's target model as its Azure deployment name. The provider's model metadata must expose either AnthropicMessages or OpenAIResponses as the dialect. The Models page groups models by that dialect, even if deployment names are arbitrary or misleading.
Using with Claude Code
Claude Code can route through the Anthropic passthrough and even discover which models you have access to.
# 1. Point Claude Code at the gateway and authenticate with your Obot API key.
export ANTHROPIC_BASE_URL="https://obot.example.com/api/llm-proxy/anthropic"
export ANTHROPIC_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
# 2. (Optional) Discover the models you have access to at startup.
# Claude Code queries the gateway's /v1/models endpoint and adds the results
# to the /model picker. Requires Claude Code v2.1.129 or later.
export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
# 3. Launch Claude Code.
claude
Inside Claude Code:
- Run
/modeland select an Obot gateway model. Discovered models are labeled "From gateway". - Run
/statusto confirm which authentication method is active.
Claude Code with Amazon Bedrock Mantle
Claude Code can also route Bedrock Mantle traffic through Obot. Use this mode for Bedrock anthropic.* models.
- Static credentials
- API key
export ANTHROPIC_BEDROCK_MANTLE_BASE_URL="https://obot.example.com/api/llm-proxy/aws-bedrock"
export ANTHROPIC_AUTH_TOKEN="$(obot login --url https://obot.example.com --scope llm --print-token)"
export CLAUDE_CODE_SKIP_MANTLE_AUTH=1
export CLAUDE_CODE_USE_MANTLE=1
claude --model anthropic.claude-sonnet-5
export ANTHROPIC_BEDROCK_MANTLE_BASE_URL="https://obot.example.com/api/llm-proxy/aws-bedrock-api-key"
export ANTHROPIC_AUTH_TOKEN="$(obot login --url https://obot.example.com --scope llm --print-token)"
export CLAUDE_CODE_SKIP_MANTLE_AUTH=1
export CLAUDE_CODE_USE_MANTLE=1
claude --model anthropic.claude-sonnet-5
For a local Obot server, replace https://obot.example.com with http://localhost:8080 in the selected base URL.
--model is optional, but it is useful since Claude Code does not support model discovery with AWS Bedrock. The default models presented by Claude Code's model selector should be compatible with our Bedrock provider as long as the corresponding Bedrock model ID is enabled in Obot.
For more details, see Claude Code's Route Mantle through a gateway documentation.
Claude Code with Azure
Claude Code can use an Azure deployment whose model dialect is AnthropicMessages:
- API key
- Entra ID
export ANTHROPIC_FOUNDRY_BASE_URL="https://obot.example.com/api/llm-proxy/azure"
export ANTHROPIC_FOUNDRY_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
export CLAUDE_CODE_USE_FOUNDRY=1
claude --model my-claude-deployment
export ANTHROPIC_FOUNDRY_BASE_URL="https://obot.example.com/api/llm-proxy/azure-entra"
export ANTHROPIC_FOUNDRY_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"
export CLAUDE_CODE_USE_FOUNDRY=1
claude --model my-claude-deployment
For a local Obot server, replace https://obot.example.com with http://localhost:8080 in both the selected base URL and the obot login command.
ANTHROPIC_FOUNDRY_API_KEY contains an Obot gateway token in this setup, not an Azure API key; Obot replaces it with the configured Azure credential before forwarding the request. The value passed to --model must be the exact Azure deployment name listed in the Anthropic-compatible Azure section on the Models page.
Microsoft Foundry does not implement the Anthropic Models API. Do not enable CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY; pass the Azure deployment name with --model or configure Claude Code's default Foundry model variables.
See the Claude Code documentation for details:
- LLM gateway configuration
- Claude Code on Microsoft Foundry
- Route Mantle through a gateway
- Model configuration (the
/modelpicker and gateway discovery) - Authentication (
/loginand/logout) - Environment variables
Using with Codex
Codex works with the OpenAI passthrough. Because Codex uses the OpenAI Responses API, define a custom model provider in your Codex config.
-
Add the following to
~/.codex/config.toml:model_provider = "obot_openai"[model_providers.obot_openai]name = "OpenAI Obot LLM Gateway"base_url = "https://obot.example.com/api/llm-proxy/openai"env_key = "OBOT_API_KEY"env_key_instructions = "Set OBOT_API_KEY and restart to authenticate with the Obot LLM Gateway"supports_websockets = falseFor a local deployment, use
base_url = "http://localhost:8080/api/llm-proxy/openai". -
Set your API key and start Codex:
export OBOT_API_KEY="$(obot login --url https://obot.example.com --scope llm --print-token)"codex # Codex CLI# orcodex app # Codex App
Set model in your config (or pick one in Codex) to a model name shown on the Models page, for example gpt-5.5.
Codex uses the OpenAI Responses API by default, which is what the gateway serves. The provider ID (obot_openai above) can be any name except the reserved IDs openai, ollama, and lmstudio.
Codex with Amazon Bedrock
Codex can use Bedrock openai.* and google.* models through Obot's OpenAI-compatible Bedrock route.
Amazon Bedrock does not support Codex's built-in server-side web search, so disable it in the Codex configuration.
Add one of the following configurations to ~/.codex/config.toml:
- Static credentials
- API key
model = "openai.gpt-5.4"
# Bedrock's google.* models are also compatible
# model = "google.gemma-4-31b"
model_provider = "obot_bedrock"
web_search = "disabled"
[model_providers.obot_bedrock]
name = "Amazon Bedrock Obot LLM Gateway"
base_url = "https://obot.example.com/api/llm-proxy/aws-bedrock"
env_key = "OBOT_API_KEY"
env_key_instructions = "Set OBOT_API_KEY and restart to authenticate with the Obot LLM Gateway"
supports_websockets = false
model = "openai.gpt-5.4"
# Bedrock's google.* models are also compatible
# model = "google.gemma-4-31b"
model_provider = "obot_bedrock"
web_search = "disabled"
[model_providers.obot_bedrock]
name = "Amazon Bedrock Obot LLM Gateway"
base_url = "https://obot.example.com/api/llm-proxy/aws-bedrock-api-key"
env_key = "OBOT_API_KEY"
env_key_instructions = "Set OBOT_API_KEY and restart to authenticate with the Obot LLM Gateway"
supports_websockets = false
For a local Obot server, replace https://obot.example.com with http://localhost:8080 in the selected base URL.
Codex with Azure
Codex can use an Azure deployment whose model dialect is OpenAIResponses. Add the configuration for your Azure authentication method to ~/.codex/config.toml, replacing the example deployment name and Obot URL:
Azure does not support Codex's built-in server-side web search, so disable it in the Codex configuration.
- API key
- Entra ID
model = "my-gpt-deployment"
model_provider = "obot_azure"
web_search = "disabled"
[model_providers.obot_azure]
name = "Azure via Obot LLM Gateway"
base_url = "https://obot.example.com/api/llm-proxy/azure"
env_key = "OBOT_API_KEY"
env_key_instructions = "Set OBOT_API_KEY and restart to authenticate with the Obot LLM Gateway"
supports_websockets = false
model = "my-gpt-deployment"
model_provider = "obot_azure"
web_search = "disabled"
[model_providers.obot_azure]
name = "Azure via Obot LLM Gateway"
base_url = "https://obot.example.com/api/llm-proxy/azure-entra"
env_key = "OBOT_API_KEY"
env_key_instructions = "Set OBOT_API_KEY and restart to authenticate with the Obot LLM Gateway"
supports_websockets = false
For a local Obot server, replace https://obot.example.com with http://localhost:8080 in the selected base URL.
See the Codex documentation for details:
- Configuration reference (the
[model_providers]keys) - Advanced configuration (custom providers and
wire_api)