Railway usage limits
How do I set a hard usage limit on Railway?
You set a hard usage limit on Railway by opening the Workspace Usage page in your dashboard, clicking Set Usage Limits, and typing your dollar cap into the Hard limit field. When your compute usage hits that dollar figure, Railway immediately shuts down your running workloads to stop further billing, after sending you warning emails at 75% and 90% of your cap.
Railway tracks Compute Usage and Agent Usage separately, so you can cap your raw infrastructure spend without disabling your AI tooling, or cap the agent while keeping your production containers online. The Hobby plan comes with a $5 monthly subscription and $5 of included usage, while the Pro plan costs $20 a month with $20 of usage included, and any spending past those included credits gets billed as raw resource consumption.
Configuring your usage limits in Railway
To change these settings in the web UI, you must hold the workspace admin role. If you run multiple accounts or team setups, switch to the right target first by opening the account switcher in the top left corner of the Railway dashboard and clicking into your workspace.
Once you are in the workspace:
- Go to the Workspace Usage page.
- Click the Set Usage Limits button.
- In the modal that opens, look at the separate sections for Compute Usage and Agent Usage.
- Set a Custom email alert amount if you want an early warning. This acts as a soft limit; Railway emails you when your billing cycle spend reaches that dollar mark, but your containers keep running without interruption.
- Set your Hard limit amount. When total usage crosses this figure in your active billing period, Railway takes your workloads offline to halt billing.
- Save your changes.
If you spend your day in a terminal, you can manage these limits directly through the Railway CLI. To see what you currently have configured across your workspace, run:
railway usage limit statusTo update the compute spending caps for your entire workspace, pass your soft warning threshold and your hard shutdown threshold:
railway usage limit set --target workspace --soft 75 --hard 125Agent spending uses its own CLI target. To cap LLM consumption separately, run:
railway usage limit set --target agent --soft 7.50 --hard 20Both targets accept separate soft alerts and hard caps, giving you room to handle alerts before an automated shutdown triggers.
Compute limits vs Agent limits: how they behave
Railway does not pool your infrastructure spend and your AI agent spend into a single bucket. Compute Usage and Agent Usage are tracked and limited independently, and hitting a hard ceiling on one produces a completely different outcome than hitting a ceiling on the other.
Compute Usage covers your core container resources: CPU, memory, storage, and network egress across all services running in the workspace. If you hit your Compute hard limit, Railway takes all of your service workloads offline immediately, but the Railway Agent remains available. You can still use the agent to inspect configurations, troubleshoot your project, or adjust your settings.
Agent Usage covers Railway Agent LLM consumption. By default, Agent Usage has a hard limit of $5 on the Hobby plan and $20 on the Pro plan. You can raise or lower this agent limit at any time on the Workspace Usage page, but unlike the Compute limit, the Agent limit cannot be removed entirely. If your agent hits its hard ceiling, Railway disables the agent, but leaves your running services and container workloads completely untouched.
The base subscription plans determine your default resource ceilings, included credits, and baseline spending before usage overages kick in:
| Plan | Base price | Included monthly usage | Default per-service RAM | Default per-service vCPU | Agent default hard limit |
|---|---|---|---|---|---|
| Free | $0 / month | $1 free credit | 0.5 GB | 1 vCPU | , |
| Hobby | $5 / month | $5 usage included | 48 GB | 48 vCPU | $5 hard limit |
| Pro | $20 / month | $20 usage included | 1 TB | 1,000 vCPU | $20 hard limit |
| Enterprise | Custom | , | 2.4 TB | 2,400 vCPU | , |
Included usage resets at the end of every billing cycle and does not roll over. If your usage stays within your included balance, you only pay the base plan subscription fee. If your usage exceeds the included credit, you pay the difference on top of your plan price.
What happens when you hit the hard limit?
When you configure a hard limit on Compute, Railway sends three reminder notifications to make sure you are not caught off guard by an unexpected outage:
- An email when your billing cycle spend reaches 75% of your hard limit.
- A second email when your spend reaches 90% of your hard limit.
- A final email when usage reaches 100% of your limit, confirming that all workloads have been taken offline.
Workloads shut down fast. Taking workloads offline stops compute and memory billing immediately, which protects you from an unchecked bill, but it creates a hard production outage until you manually raise the limit or a new billing cycle resets your spend.
If you use credits as your payment method instead of a standard card, watch your balance closely. When an account using credits hits a zero balance, Railway cancels your subscription, disables all deployments, and stops every running workload in the account. For trial users, new accounts receive a one-time grant of $5 in free credit, and you cannot purchase additional credits without upgrading to the Hobby plan.
Fine-tuning costs without taking services offline
Hard limits are an emergency backstop, not a scaling strategy. If you want to keep costs predictable without dropping traffic, Railway provides three other built-in cost controls: resource limits, private networking, and serverless auto-sleeping.
Service replica limits
By default, container RAM costs $10 / GB / month ($0.000231 / GB / minute) and container CPU costs $20 / vCPU / month ($0.000463 / vCPU / minute). If a service runs runaway loops or memory leaks, it can scale up to the plan ceiling. To restrict this, navigate to your service settings > Deploy > Replica Limits. You can set the maximum CPU and memory each replica can consume. Be careful with this setting: setting replica limits too low will cause your service to crash if it exceeds the limit.
Route traffic over private networking
Network Egress costs $0.05 / GB ($0.000000047683716 / KB). If you run an application container that talks to a database inside the same project, routing queries over public hostnames charges egress fees on every single query. You can avoid network egress costs completely by using Private Networking for internal service communication. In your database connection configuration, point your application to the DATABASE_URL environment variable rather than DATABASE_PUBLIC_URL.
Turn on serverless auto-sleeping
For staging environments, internal tools, or low-traffic services, running containers 24/7 wastes money. You can enable Serverless to stop a service when it is inactive, which cuts the ongoing compute bill down to zero while idle. To enable this, go to your service settings > Deploy > Serverless, and toggle "Enable Serverless". Railway brings the service back up as soon as a new request arrives.
Monitoring spend and setting brakes with Costbrake
Railway's native hard limit is workspace-wide: when you hit it, every service goes down. If you need earlier visibility, granular alerts, or want to halt a single broken service without taking your entire database and API offline, you can pair Railway with Costbrake.
Costbrake monitors your spending across 23 cloud, AI and SaaS providers, checking your usage hourly on the Free plan and every 5 minutes on Pro and Team plans. If spend in an hour jumps higher than 3x your 7-day baseline and runs at least $5 above normal, you get a spike alert over Slack, Discord, email, webhooks, or PagerDuty. You also get forecast alerts when the last 72 hours of spending puts you on track to bust your monthly budget, and budget warnings at 50%, 80%, and 100%.
For Railway, Costbrake reads workspace usage every 5 minutes using a standard workspace API token. When something goes wrong, you can use two opt-in brakes from the Costbrake dashboard:
- Hard limit at current usage: Sets the workspace hard limit directly to your current usage rounded down to whole dollars (Railway's minimum limit is $10). Railway will immediately take workloads offline until you raise it. An undo button restores the old limit, and Railway redeploys your stopped services.
- Stop service: Stops the running deployment of one service in one environment. Nothing gets deleted; you stop the bleed on a single misconfigured worker while keeping your database and web frontend live.
Costbrake never triggers a brake automatically; an admin must click and confirm. You can review plan options on the Costbrake pricing page or follow the agent setup walkthrough to connect your workspace. For broader context on how platforms handle spending caps, check out our guides on How does Railway pricing work? and Which cloud and AI providers let you set a hard spending cap?.
Questions and answers
What is the minimum hard limit I can set on Railway?
Railway's minimum for a workspace hard limit is $10. For Agent Usage, the default hard limit is $5 on the Hobby plan and $20 on the Pro plan, and you can raise or lower it at any time from the Workspace Usage page.
Can I set a hard limit on a single service instead of the whole workspace?
No, Railway's native Usage Limits apply at the workspace level and will shut down all workloads in that workspace when reached. If you only want to constrain a single service, use per-service Replica Limits under service settings > Deploy > Replica Limits to restrict CPU and RAM.
Are build minutes charged against my usage limit?
No. Service builds on Railway are completely free, and Railway does not charge for build CPU, memory, base-image downloads, image exports, or image storage. Only active container runtimes, VM resources, volumes, egress, and agent usage count toward your bill.
What is the difference between a Custom email alert and a Hard limit?
A Custom email alert is a soft threshold that triggers an email notification when crossed without altering your infrastructure. A Hard limit is an absolute ceiling that takes your workloads offline the moment your billing cycle spend touches the configured number.
Can I remove the Agent Usage limit entirely?
No, the Agent Usage hard limit cannot be removed, though you can raise or lower it at any time on the Workspace Usage page. By default, it is set to $5 on the Hobby plan and $20 on the Pro plan.
Sources
Updated