Deploy Agentgateway
AI gateway for LLM and MCP traffic: one locked endpoint, UI, logs, keys
Agentgateway
Just deployed
/data
Deploy and Host Agentgateway on Railway
Agentgateway is an open-source proxy for AI agents, hosted by the Linux Foundation. It puts one OpenAI-compatible endpoint in front of your LLM providers and one MCP endpoint in front of your MCP servers, with API keys, budgets, request logs, analytics and a web UI to manage it all.
About Hosting Agentgateway
This template runs the official Agentgateway v1.7.0 image as one service, built from a public GitHub repo. A small start script writes the configuration from Railway variables. The web UI at /ui needs a generated admin password. The LLM API (/v1/...) and the MCP endpoint (/mcp) need a generated gateway key. You only enter your LLM provider's API key. Models, MCP servers, routes and virtual keys you add in the UI, plus request logs and analytics, are stored in SQLite on a Railway volume at /data, so they survive restarts and redeploys. It uses about 30–60 MB of RAM.
Common Use Cases
- One OpenAI-compatible endpoint with per-app virtual keys, budgets and request logs in front of OpenAI, OpenRouter or any compatible provider
- One authenticated MCP endpoint that merges several remote MCP servers for Claude Code, Cursor or VS Code
- Watching what your agents send to LLMs and tools: logs, token usage and costs in one place
Dependencies for Agentgateway Hosting
- An API key for OpenAI or any OpenAI-compatible LLM provider
- A Railway volume (included) for the SQLite database
Deployment Dependencies
- Agentgateway v1.7.0 release and documentation
- Template repository (Dockerfile, start script, changelog)
Implementation Details
The service is Agentgateway (public, port 8080, health check /healthz, volume /data). After deploy:
- Open
https://YOUR-DOMAIN/uiand log in withADMIN_USERNAME/ADMIN_PASSWORDfrom the service's Variables tab. - Call the LLM gateway with
AGENTGATEWAY_API_KEY. Any model name is forwarded toLLM_BASE_URL:
curl https://YOUR-DOMAIN/v1/chat/completions \
-H "Authorization: Bearer YOUR-AGENTGATEWAY-API-KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5.4-mini","messages":[{"role":"user","content":"Hello"}]}'
- Connect an MCP client to
https://YOUR-DOMAIN/mcp. An example server (DeepWiki, free, public) is included:
{
"mcpServers": {
"agentgateway": {
"type": "http",
"url": "https://YOUR-DOMAIN/mcp",
"headers": { "Authorization": "Bearer YOUR-AGENTGATEWAY-API-KEY" }
}
}
}
- Add your own MCP servers (Streamable HTTP or SSE), models and virtual keys in the UI. Stdio MCP servers (
npx,uvx) aren't supported in this image. SetMCP_EXAMPLE=offto remove the example server.
Updates: when we bump the pinned Agentgateway version in the repo, Railway shows an "update available" notice on your project. The changelog in the repo lists breaking changes first, and your data stays on the volume.
Why Deploy Agentgateway 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 Agentgateway 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.
Template Content
Agentgateway
aalfath/agentgateway-railway-templateLLM_API_KEY
Your LLM provider's API key, e.g. an OpenAI key from https://platform.openai.com/api-keys. Stays on the server; clients use AGENTGATEWAY_API_KEY instead.

