Skip to main content

Endpoint

Every path under /v1beta is forwarded to Google as written: method, path, query string and body. The gateway does not translate the body and returns Google’s answer, headers included. It removes your client credential and the hop-by-hop headers, sends Google’s own credential in their place, and adds its own response headers. Authorization: Bearer <key> works in place of x-goog-api-key. This is the route for gemini-cli and the @google/genai SDK. Set GOOGLE_GEMINI_BASE_URL=https://gateway.langwatch.ai and use the virtual key as the Gemini API key; see Gemini CLI.

Request

Response

Which credentials serve it

Only a Gemini or a Vertex credential. The body and the path are Google’s own, so no other provider can read them. A key with neither answers 400 model_provider_not_bound and no provider is called. A Vertex credential serves the request through Google’s Vertex path form.

What the gateway reads and changes

The X-LangWatch-End-User-Id, X-LangWatch-Metadata and Traceparent request headers work as on Chat Completions.

Response headers

Google’s own response headers, including its Content-Type, plus the gateway set from Chat Completions: X-LangWatch-Gateway-Version, X-LangWatch-Gateway-Request-Id, X-LangWatch-Fallback-Count, X-LangWatch-Budget-Warning, Traceparent, X-LangWatch-Heartbeat-Active, and X-LangWatch-Provider on a forwarded provider error. X-LangWatch-Handled-Error carries the error.code when the gateway wrote the error itself, and is removed from a forwarded provider response.

Streaming

A path ending in :streamGenerateContent or :streamGenerateAnswer streams. Google’s own SSE frames reach the client exactly as Google framed them, with no data: [DONE] trailer and no re-wrapping. A failure after the stream opens adds one terminal event: error frame that the gateway writes itself. Pass the query string Google expects for SSE, for example ?alt=sse, as you would against Google directly.
A failure after the stream opened ends it with an event: error frame; see Errors.

Errors

Google’s own errors are forwarded with Google’s status, body and headers, under X-LangWatch-Provider. The full table is on Errors. Also check: Gemini, Vertex AI.
Last modified on September 6, 2026