Deploy Agentgateway

AI gateway for LLM and MCP traffic: one locked endpoint, UI, logs, keys

Deploy 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

Implementation Details

The service is Agentgateway (public, port 8080, health check /healthz, volume /data). After deploy:

  1. Open https://YOUR-DOMAIN/ui and log in with ADMIN_USERNAME / ADMIN_PASSWORD from the service's Variables tab.
  2. Call the LLM gateway with AGENTGATEWAY_API_KEY. Any model name is forwarded to LLM_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"}]}'
  1. 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" }
    }
  }
}
  1. 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. Set MCP_EXAMPLE=off to 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

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
1