Deploying and Configuring an Agent on Railway
Updated May 22, 2026 · 1 min read
Deploy a self-hosted agent from the official Railway template: required keys, environment variables, and picking an AI model.
Go to senpi.ai/quickstart for the official setup guide. Deploy using the official Senpi Railway template - it auto-configures all MCP tools and bundles common skills (article 26). Deployment takes 3-5 minutes.
What you need
- 1
Senpi token
generated on senpi.ai; full access
- 2
Railway paid plan
$5/mo; free tier insufficient
- 3
Paid AI key
Anthropic recommended; OpenAI/Gemini/OpenRouter OK
- 4
Telegram setup
bot via @BotFather + your user ID
- 5
$100+ USDC
deposited; see article 2
Railway environment variables
Railway env varsThe Railway environment variables that configure your agent's AI provider, Telegram, and Senpi auth token.
- AI_API_KEY
- Your AI provider key.
- AI_PROVIDER
- One of
openai,anthropic,gemini,openrouter. Lowercase. - SETUP_PASSWORD
- For the OpenClaw dashboard.
- TELEGRAM_BOT_TOKEN
- From @BotFather.
- TELEGRAM_USERID
- Your personal Telegram user ID, numeric, from @userinfobot. Not your bot's ID.
- SENPI_AUTH_TOKEN
- Generated on senpi.ai after login. Raw value, no
Bearerprefix, no extra spaces.
Total cost
~$5-15/month Railway + AI API usage. Agents are self-hosted on your Railway instance - Senpi does not host or manage them.
AI model selection
- Best results: Claude Opus (what the Senpi team uses).
- Also works: Claude Sonnet (cheaper), OpenAI, Gemini, OpenRouter.
- To change model: ask the agent to change it, or type
/modeland select manually. Opus is most capable but expensive; Sonnet is a good balance.
Changing the AI model when using OpenRouter. Do not change any Railway environment variables - you are staying on OpenRouter. Go to your OpenRouter dashboard under Settings → Routing → Allowed Models and configure which models your agent can use there.
Before you deploy, make sure you've signed up and gotten started on Senpi. For per-error troubleshooting, see article 19. For the @senpi-ai/runtime plugin (recommended for new strategies), see article 20.
Quickstart guide
Step-by-step Railway deployment with Senpi + OpenClaw.
Related articles
AI Agents Overview: OpenClaw, MCP, and Authentication
How OpenClaw handles agent reasoning and the Senpi MCP handles Hyperliquid trades, plus auth-token setup for the one MCP endpoint.
Agent Troubleshooting
Fix common agent failures: API key and auth token errors, context limits, connectivity drops, and Telegram setup issues.
