multi-router.aidocs

Providers & Models

Google Vertex

Connect a Google Cloud project to Multi-Router and route requests to Anthropic's Claude models on Vertex AI.

Google Vertex AI is Google Cloud's managed model platform, and Multi-Router uses it to serve Anthropic's Claude models from your Google Cloud project. A Vertex provider key holds a service account, its project and a location, and Multi-Router calls Vertex as that service account. Usage is billed by Google to the project, and Vertex quotas apply per project, model and location. Google's Gemini models are served through the Gemini provider; see Supported Providers.

Preparing your Google Cloud project

The Google Cloud project that serves requests needs the Vertex AI API, access to the Claude models, and a service account Multi-Router can use:

  1. Enable the Vertex AI API in the project.
  2. In Vertex AI Model Garden, enable each Claude model you will use.
  3. Create a service account in the project. Its email ends in @<project-id>.iam.gserviceaccount.com; Google-managed accounts, such as the Compute Engine default service account, are not accepted.
  4. Grant the service account the Vertex AI User role (roles/aiplatform.user), which allows Vertex AI predictions.
  5. Create a JSON key for the service account and download it. If your organization enforces the iam.disableServiceAccountKeyCreation policy, an organization policy administrator must allow key creation for the project first.

Adding a Vertex provider key

A Vertex provider key holds one service account and the location requests run in. To add one, open LLM Provider Keys in the dashboard, add a key, and select Google Vertex:

FieldDescription
Google Cloud project IDThe project id, such as my-production-project: 6 to 30 lowercase letters, digits and hyphens, starting with a letter and ending with a letter or digit. It must match the project_id in the service account JSON.
Google Cloud locationThe location requests run in: global, us, eu or a Google Cloud region such as us-east5. The models you route must be offered in this location.
Service-account JSONThe complete JSON key file of the service account, up to 64 KB.

LLM Provider Keys

Upstream credentials used to call providers. The default key for each provider is what gets used when a request reaches that provider without a router preset overriding it. Secrets are encrypted at rest; the value can’t be retrieved after creation.

V
Google Vertex
0 keys · no default
Add Google Vertex key

New Google Vertex key

CancelSave key
Name
vertex-us

Short dashboard handle. Lowercase, hyphens.

Google Cloud project ID
acme-ml-prod

Must match the service account JSON. Multi Router overrides client project paths with this value.

Google Cloud location
us

Model availability and pricing must have an exact catalog row for this location.

Service-account JSON
{ "type": "service_account", "project_id": "acme-ml-prod", "private_key_id": "8c1f2e9a7b…", "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASC…", "client_email": "multi-router@acme-ml-prod.iam.gserviceaccount.com", … }

Encrypted at rest. Can’t be retrieved later.

Description
Why this key exists. Owner. Rotation schedule. Cost center. Anything an operator should know in 6 months.
Make this the default Google Vertex key(forced — first key for this provider)
The New Google Vertex key form with the project, location and service account JSON. Select to enlarge.

The service account JSON must be the unmodified key file Google issues: its type is service_account, its token_uri is https://oauth2.googleapis.com/token, and it contains the project_id, the client_email of a service account in that project, a private_key_id and an RSA private_key. A file that breaks these rules is rejected with a message beginning Vertex service-account or metadata validation failed.

Multi-Router verifies the service account with Google when the key is saved and when its location is edited, and when it is enabled or made the default unless Multi-Router already holds a valid access token for it. A failed verification shows Google's response, such as Google OAuth token endpoint returned HTTP 400 (invalid_grant). Verification confirms that Google accepts the key file; the service account's role and model access are checked by the first request. A saved key's name, description and location can be edited, and later requests use the new location. The service account JSON is fixed, so rotating it means adding a new key and moving routers to it; see Provider Key.

Locations

The location is the Google Cloud location that runs each request, and for static routers it is always the location set on the provider key. Current Claude models are offered in the global, us and eu locations, and Claude Sonnet 4.6, Claude Opus 4.6 and earlier models are also offered in single regions such as us-east5, europe-west1 and asia-southeast1. A request for a model not offered in the key's location returns region_not_served with the locations where it is available.

To serve requests from several locations, add one provider key per location, using the same service account JSON in each, and set each router to the key for its location. Claude Proxies set the location on the Claude Proxy instead, so one key serves every location. See Regions & Variants for what each location type means.

Models and features

Multi-Router serves Anthropic's Claude models on Vertex, and a request for another publisher's model on Vertex returns publisher_not_supported. Claude models on Vertex support the following features:

FeatureSupport
StreamingYes.
ToolsYes.
ImagesYes, sent as base64 data. Vertex does not accept images by URL.
ReasoningYes, with thinking and budget_tokens on the Messages API.
Prompt cachingYes, with cache_control on the Messages API.
Structured outputClaude 4.5 and later models, with a json_schema response format on the Chat Completions API. A json_object response format is rejected.
PDF inputThrough a Claude Proxy.
Token countingThrough a Claude Proxy, for Claude Code.

Access tokens

An access token is the short-lived credential Multi-Router obtains from the service account to call Vertex, and Multi-Router renews it automatically before it expires. When the service account key is deleted in Google Cloud, requests continue until the current access token expires, within an hour, and then fail with a 503. To stop access immediately, disable the service account in Google Cloud or disable the provider key in Multi-Router.

Errors and retries

Vertex errors reach the caller as Multi-Router errors with Google's status in the response's upstream object. Multi-Router retries rate limits, server errors, timeouts and connection failures with exponential backoff, honoring any retry delay Google sends, for up to five attempts within five minutes.

ErrorCause
503, Google Vertex OAuth token is not ready; retry shortlyMulti-Router has no valid access token for the key at that moment. Retry the request.
401 upstream_invalid_credentials, the Google Vertex provider key's credentials are not usable: …Google rejected the service account (for example, the key was revoked or deleted), or the provider key is disabled or deleted. The message gives the reason. Multi-Router tries the key again every five minutes, and at once after the key is edited.
502 upstream_invalid_credentialsGoogle rejected the service account credentials.
403 upstream_other, upstream status PERMISSION_DENIEDThe service account lacks the Vertex AI User role, or the Vertex AI API is not enabled.
400 upstream_model_not_foundThe model is not enabled in Model Garden, or is not available in the project and location.
429 upstream_rate_limitRate limits or timeouts continued after retries. Request quota increases in the Google Cloud console.
502 upstream_server_errorVertex AI server errors continued after retries.
400 publisher_not_supportedThe model is not an Anthropic model.
400 region_not_servedThe model is not offered in the key's location.

Pricing

Vertex prices differ by location: for Claude Sonnet 4.5 and later models, the us, eu and single-region locations cost more than global, and earlier models cost the same in every location. Multi-Router bills each request at the price of the location that served it, including prompt cache reads, 5-minute and 1-hour cache writes, and long-context rates for prompts above the model's long-context threshold. See Model Catalog.

Claude Code on Vertex

A Claude Proxy on the Vertex AI route serves Claude Code in its Vertex mode. Multi-Router forwards the request body unchanged and sends it with the organization's Vertex key, the key's project, the location set on the Claude Proxy and the model id of the routed model; Claude Code's project and region settings are required by Claude Code and do not select the project or location. Claude Proxy requests are sent to Vertex once, without retries, and errors use Google's error format. The dashboard generates the environment for each developer:

Claude Code environmentbash
export CLAUDE_CODE_USE_VERTEX=1
export CLAUDE_CODE_SKIP_VERTEX_AUTH=1
export ANTHROPIC_VERTEX_BASE_URL='https://api.multi-router.ai/vertex'
export ANTHROPIC_VERTEX_PROJECT_ID='<project id>'
export CLOUD_ML_REGION='<location>'
export ANTHROPIC_AUTH_TOKEN='<Multi-Router API key>'
export ANTHROPIC_CUSTOM_HEADERS='X-MR-Router: <router id>'

See Agents & Editors.

AWS BedrockModel Catalog
Was this helpful?