Skip to main content
Caveman Cloud integrates with popular AI frameworks by changing the base URL and adding authentication headers. Each framework example below shows the minimal configuration needed to route calls through the gateway.

Prerequisites

  • A Caveman Cloud account with a gateway URL (CAVE_GATEWAY_URL)
  • Your Cave API key (CAVE_API_KEY)
  • Your model provider key (e.g., OPENAI_API_KEY, ANTHROPIC_API_KEY)
Use @ai-sdk/openai-compatible for OpenAI-protocol models. The Anthropic provider takes a baseURL too. Either way, the gateway keeps each model on its native protocol.
For Anthropic models, keep the native protocol:
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.

Labeling traffic

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