Gate Docs
Auth proxy. Add API key auth, session login, rate limiting, and access logs to any service.
Overview
Auth proxy. Add API key auth, session login, rate limiting, and access logs to any service. License: Apache 2.0. Default port: 8780.
Part of the Stockyard family of developer tools. See the product page →
Install
curl -fsSL https://stockyard.dev/gate/install.sh | sh
Or download a release binary from GitHub Releases.
Quickstart
# Install
curl -fsSL https://stockyard.dev/gate/install.sh | sh
# Run
GATE_UPSTREAM=http://localhost:3000 GATE_ADMIN_KEY=secret gate
# Create an API key
curl -s -X POST http://localhost:8780/gate/api/keys \
-H 'Authorization: Bearer secret' \
-H 'Content-Type: application/json' \
-d '{"name":"alice"}'
# Save the key — it's only shown once
# Access the upstream using the key
curl -H 'Authorization: Bearer sk-gate-...' http://localhost:8780/your/path
Environment Variables
| Variable | Description | Default |
|---|---|---|
| PORT | HTTP listen port | 8780 |
| DATA_DIR | SQLite data directory | ./data |
| GATE_UPSTREAM | Upstream service URL | http://localhost:3000 |
| GATE_ADMIN_KEY | Admin API key | required |
| GATE_RPM | Rate limit (requests per minute, 0 = off) | 60 |
| GATE_CORS_ORIGINS | Allowed CORS origins (comma-separated or *) |
API Reference
Authorization: Bearer <admin-key>. The admin key is set via the environment variable for this tool.
Deployment
Run the binary directly or use the provided Dockerfile. Set DATA_DIR to a persistent volume path. The binary is statically linked with no external dependencies.
docker build -t gate . docker run -e FENCE_ADMIN_KEY=secret -v /data:/data -p 8780:8780 gate
When to use Stockyard instead
If you're building LLM-powered applications and need request tracing, cost tracking across 16 providers, model routing, prompt management, and team collaboration tools — Stockyard is the full platform. It includes capabilities from across the focused tools family in one binary.