Skip to content
Docs

Azure OpenAI, Vertex AI and Bedrock APIs

Code written for a managed cloud’s LLM API reaches Lifeboat by changing its base URL. Each of these APIs wraps a request shape Lifeboat already serves, so requests go through the same load balancer, aliases, system prompt and API keys as everything else.

Cloud API Path Served as
Azure OpenAI POST /openai/deployments/{deployment}/chat/completions (also completions, embeddings, images/generations) OpenAI; the deployment name is the model
Azure OpenAI v1 POST /openai/v1/chat/completions (also completions, embeddings, responses), GET /openai/v1/models OpenAI
Vertex AI, Claude POST /v1/projects/{p}/locations/{l}/publishers/anthropic/models/{model}:rawPredict and :streamRawPredict Anthropic Messages
Vertex AI, Claude token count POST .../publishers/anthropic/models/count-tokens:rawPredict Anthropic token count
Vertex AI, Gemini POST .../publishers/google/models/{model}:generateContent (also streamGenerateContent, countTokens, embedContent) Gemini API
Bedrock InvokeModel POST /model/{modelId}/invoke and /invoke-with-response-stream Anthropic Messages; the stream uses AWS’s event-stream framing
Bedrock Converse POST /model/{modelId}/converse and /converse-stream Translated to and from Anthropic Messages
Bedrock CountTokens POST /model/{modelId}/count-tokens Estimated

Vertex paths are served under /v1, /v1beta1 and with no version prefix. The project and location are accepted and ignored. Name the deployment, model or model ID after a Lifeboat alias to pick a model; an unrecognised name is served by whichever generation server is running.

Client How the Lifeboat API key travels
Azure OpenAI SDKs api-key: <key>, or Azure AD style Authorization: Bearer <key>
Vertex AI SDKs Authorization: Bearer <key> — pass the key as the access token
boto3 and the AWS SDKs SigV4: set the access key ID to the Lifeboat key; the secret can be anything
Bedrock API keys Authorization: Bearer <key> (AWS_BEARER_TOKEN_BEDROCK). boto3 sends these only over HTTPS.

Lifeboat does not verify a SigV4 signature — there is no shared secret to verify it with — so a SigV4 request is exactly as strong as a bearer key, which also travels in a header. Serve Lifeboat over TLS in production either way.

# Azure OpenAI
from openai import AzureOpenAI
client = AzureOpenAI(azure_endpoint="https://lifeboat.example.com", api_key=KEY, api_version="2024-10-21")
# Claude on Vertex AI
from anthropic import AnthropicVertex
client = AnthropicVertex(region="us-east5", project_id="any", base_url="https://lifeboat.example.com/v1", access_token=KEY)
# Gemini on Vertex AI
from google import genai
from google.genai import types
from google.oauth2.credentials import Credentials
client = genai.Client(vertexai=True, project="any", location="us-central1",
credentials=Credentials(token=KEY),
http_options=types.HttpOptions(base_url="https://lifeboat.example.com"))
# Bedrock (InvokeModel and Converse)
import boto3
client = boto3.client("bedrock-runtime", endpoint_url="https://lifeboat.example.com",
region_name="us-east-1", aws_access_key_id=KEY, aws_secret_access_key="unused")

Claude Code’s own Vertex and Bedrock modes work against these paths:

Terminal window
# Vertex mode
export CLAUDE_CODE_USE_VERTEX=1 CLAUDE_CODE_SKIP_VERTEX_AUTH=1
export ANTHROPIC_VERTEX_BASE_URL=https://lifeboat.example.com/v1
export ANTHROPIC_VERTEX_PROJECT_ID=any CLOUD_ML_REGION=us-east5
export ANTHROPIC_CUSTOM_HEADERS="x-api-key: $KEY"
# Bedrock mode
export CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-east-1
export ANTHROPIC_BEDROCK_BASE_URL=https://lifeboat.example.com
export AWS_ACCESS_KEY_ID=$KEY AWS_SECRET_ACCESS_KEY=unused
export ANTHROPIC_MODEL=<lifeboat alias>

The direct Anthropic mode (ANTHROPIC_BASE_URL) is simpler and is covered on the Anthropic-compatible API page.

Azure, Vertex and Bedrock InvokeModel carry a body Lifeboat already serves, so only the model (moved from the path into the body) and the cloud’s version fields (anthropic_version, anthropic_beta) change. Converse is Amazon’s own schema and is translated:

  • Text, images, tool use, tool results (text and JSON) and reasoning content map to their Anthropic blocks.
  • system, inferenceConfig and toolConfig (including toolChoice) map to their Anthropic fields.
  • additionalModelRequestFields is merged into the request, without overriding the Converse fields, so model-specific options reach the model.
  • Streaming emits messageStart, contentBlockStart (tool use only), contentBlockDelta, contentBlockStop, messageStop, and metadata with usage, in that order.

Not provided: guardrails, prompt caching points (cachePoint is accepted and ignored), documents and video in Converse, and the Bedrock and Vertex management APIs.