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. 1

    Senpi token

    generated on senpi.ai; full access

  2. 2

    Railway paid plan

    $5/mo; free tier insufficient

  3. 3

    Paid AI key

    Anthropic recommended; OpenAI/Gemini/OpenRouter OK

  4. 4

    Telegram setup

    bot via @BotFather + your user ID

  5. 5

    $100+ USDC

    deposited; see article 2

Railway environment variables

Railway env vars

The 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 Bearer prefix, 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 /model and 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.

Open quickstart
Share

Related articles