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.
Endpoints
Section titled “Endpoints”| 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.
Authentication
Section titled “Authentication”| 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.
Connecting a client
Section titled “Connecting a client”# Azure OpenAIfrom openai import AzureOpenAIclient = AzureOpenAI(azure_endpoint="https://lifeboat.example.com", api_key=KEY, api_version="2024-10-21")
# Claude on Vertex AIfrom anthropic import AnthropicVertexclient = AnthropicVertex(region="us-east5", project_id="any", base_url="https://lifeboat.example.com/v1", access_token=KEY)
# Gemini on Vertex AIfrom google import genaifrom google.genai import typesfrom google.oauth2.credentials import Credentialsclient = 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 boto3client = 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 through Vertex or Bedrock
Section titled “Claude Code through Vertex or Bedrock”Claude Code’s own Vertex and Bedrock modes work against these paths:
# Vertex modeexport CLAUDE_CODE_USE_VERTEX=1 CLAUDE_CODE_SKIP_VERTEX_AUTH=1export ANTHROPIC_VERTEX_BASE_URL=https://lifeboat.example.com/v1export ANTHROPIC_VERTEX_PROJECT_ID=any CLOUD_ML_REGION=us-east5export ANTHROPIC_CUSTOM_HEADERS="x-api-key: $KEY"
# Bedrock modeexport CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-east-1export ANTHROPIC_BEDROCK_BASE_URL=https://lifeboat.example.comexport 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.
What is translated
Section titled “What is translated”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,inferenceConfigandtoolConfig(includingtoolChoice) map to their Anthropic fields.additionalModelRequestFieldsis 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, andmetadatawith 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.
Sources and references
Section titled “Sources and references”- The other surfaces: OpenAI-compatible API, Anthropic-compatible API, Gemini-compatible API
- Keys: API authentication