---
title: "Deploy Caveman proxy"
description: "Caveman's token-saving proxy for AI apps and SDK agents, locked by a key."
category: "AI/ML"
url: https://railway.com/deploy/caveman-proxy-unofficial
---

# Deploy Caveman proxy

Caveman's token-saving proxy for AI apps and SDK agents, locked by a key.

**[Deploy Caveman proxy on Railway](https://railway.com/template/caveman-proxy-unofficial)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/caveman-proxy-unofficial/manifest.json

- **Creator:** AvgSoft
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

### caveman-proxy https://cdn.jsdelivr.net/gh/mikedepo/railway-template-assets@c0f0eff926e29bb1bb72eddca657edfbd9cd9bb2/service-icons/caveman-proxy.svg

- **Image:** ghcr.io/juliusbrussee/caveman-proxy:bin-v4.0.2
- **Health check:** /health/ready
- **Public domain:** Yes

## Documentation

# Deploy and Host Caveman proxy on Railway

Caveman's proxy shrinks tool output, logs and JSON in your AI API calls, so requests use fewer input tokens. This template runs it on your own URL, locked by a proxy token generated per deploy.

Not affiliated with or endorsed by Caveman.

![Caveman proxy on Railway](https://cdn.jsdelivr.net/gh/mikedepo/railway-template-assets@b6233a1/caveman/banner.png)

## About Hosting Caveman proxy

Official image pinned to bin-v4.0.2, with a volume and health check. Nothing to sign in to: the URL shows `cave_unauthorized` by design; `/health/ready` shows it's up. Only non-streaming requests get compressed, so Claude Code and Codex pass through unchanged.

### Call it from your code

1. On the canvas, click **caveman-proxy**. Copy its URL from **Settings**, **Networking**, and the value of `CAVEMAN_AUTH_TOKEN` from **Variables**: that is your proxy token.
2. Point your SDK at the proxy and send the token in the `x-cave-api-key` header, next to your own provider key. Anthropic in Python:

```python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://YOUR_PROXY_URL",
    api_key="YOUR_ANTHROPIC_KEY",
    default_headers={"x-cave-api-key": "YOUR_PROXY_TOKEN"},
)
```

3. For OpenAI use `base_url="https://YOUR_PROXY_URL/openai/v1"`; for Gemini call `https://YOUR_PROXY_URL/gemini/v1beta/models/MODEL:generateContent`. A response header `x-cave-optimization: caveman-compression` shows the request was compressed.
4. Set a provider key on the deploy form instead, and clients send only the proxy token.

## Common Use Cases

- Shrink tool output in SDK agents
- One AI API gateway for a team
- Caveman middleware for your app

## Dependencies for Caveman proxy Hosting

- caveman-proxy

### Deployment Dependencies

- [Team deploy guide](https://github.com/JuliusBrussee/caveman/blob/main/docs/technical/deploy.md)
- [Routes and providers](https://github.com/JuliusBrussee/caveman/blob/main/docs/technical/proxy-and-providers.md)

### Implementation Details

![Caveman proxy architecture](https://cdn.jsdelivr.net/gh/mikedepo/railway-template-assets@b6233a1/caveman/architecture.png)

Also serves Caveman's middleware API. Keep one replica (SQLite on the volume). Idles at about 30 MB, fitting Free; heavy use outgrows the 0.5 GB volume on Free and Trial.

## Why Deploy Caveman proxy on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Caveman proxy on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

**Updated 2026-11-06:** first release, caveman-proxy bin-v4.0.2.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/caveman-proxy-unofficial
