Skip to main content
You can route traffic through Caveman Cloud using the Google Gen AI SDK or raw HTTP requests. The gateway speaks each provider’s native protocol on its native path, so you send the provider’s own request shape and headers.

Google GenAI SDK

The Google Gen AI SDK accepts an HttpOptions base URL. Point it at the gateway and the SDK’s generateContent calls route through it unchanged.
The SDK appends /v1beta/... itself, so the base URL is just the gateway plus /w/{{app}}.

Prerequisites

  • A Caveman Cloud account with a gateway URL (CAVE_GATEWAY_URL)
  • Your Cave API key (CAVE_API_KEY)
  • Your Gemini provider key (GEMINI_API_KEY)

Example

When your provider key is stored in Caveman Cloud, you can drop the x-cave-upstream-key header and pass CAVE_API_KEY in its place.

Raw HTTP / curl

No SDK is required. The gateway speaks each provider’s native protocol on its native path, bare or /w/-prefixed. Send the provider’s own request shape and headers.

OpenAI protocol (Chat Completions, Responses, embeddings)

Anthropic protocol

Labeling traffic with headers

Add x-cave-agent or x-cave-workflow headers to identify different parts of your system in Traces. These labels do not grant access; they only tag requests for filtering and analysis.

Next steps