Skip to content

Blog

Claude usage limit reached? How to auto-resume Claude Code

It’s 11pm. Claude Code is 40 minutes into a refactor, tests are half-green, and then the terminal prints:

5-hour limit reached ∙ resets 3am

The agent stops. The session sits there. If you go to bed, nothing happens at 3am — the limit resets, but nobody is around to type “continue”. You lose the hours between the reset and whenever you come back.

We got tired of this, so we built claude-auto-retry: a small open-source tool that watches your Claude Code session, parses the reset time out of the limit message, waits for it, and resumes the session automatically. You run claude exactly like before. That’s the whole pitch.


The problem: limits don’t care where your task is

Section titled “The problem: limits don’t care where your task is”

Claude subscriptions meter usage in rolling windows. Heavy Claude Code use — long agent runs, big contexts, lots of tool calls — burns through a window fast, and when it’s gone you get a variant of:

  • 5-hour limit reached ∙ resets 3pm
  • You've hit your limit · resets 3pm
  • Claude usage limit reached. Resets at 2pm

The limit itself is fine — it’s how a fixed-price subscription stays fixed-price. The annoying part is what happens after: Claude Code doesn’t queue your work and resume at the reset. It just stops, mid-task, holding all the context of whatever it was doing. Resuming costs one word — “continue” — but only if a human is there to type it.

For interactive use that’s a coffee break. For the way people increasingly use Claude Code — overnight runs, long autonomous tasks, claude -p in scripts — it’s a silent halt that wastes every hour between the reset and your return.

Workarounds people try (and why they’re fragile)

Section titled “Workarounds people try (and why they’re fragile)”

Sitting there. Works, wastes an evening.

A cron job that types “continue” at a fixed time. Blind. The reset time moves with your usage, so you either fire too early (message goes nowhere, session still limited) or too late (hours lost anyway). And if Claude exited, you’re injecting keystrokes into a bare shell.

Wrapper scripts around the CLI. Most break something: interactive mode, claude -p piping, or they lose the session when your terminal disconnects.

The failure modes all reduce to the same two hard parts: knowing when the limit actually resets, and injecting “continue” safely into a live session — including after you’ve closed your laptop.

The tool leans on tmux for session persistence, but hides it completely:

  1. Transparent wrapping. The installer adds a shell function so claude transparently runs inside a tmux session. If you’re already in tmux, it uses your pane. You won’t notice the difference — interactive use, flags, and claude -p "prompt" | jq all work as before.

  2. Background monitoring. A separate process polls the pane every 5 seconds looking for the known limit-message patterns (customizable if Anthropic changes the wording).

  3. Real reset-time parsing. When a limit hits, it parses the actual reset time from the message — timezone-aware and DST-safe — computes the wait, and sleeps until reset plus a small safety margin. No guessed schedules.

  4. Safe injection. Before sending “continue”, it verifies Claude is still the foreground process in the pane. If Claude exited, nothing gets typed into your shell.

  5. Survives disconnects. Because the session lives in tmux, you can close the terminal, drop SSH, or shut the laptop lid. The monitor keeps waiting server-side; reattach whenever and the run has continued without you.

Separately from usage limits, it also catches transient API errors (429, 5xx, 529 overloaded) and retries those with exponential backoff — a different failure with a different fix, handled by the same monitor.

It’s pure Node.js with zero npm dependencies, MIT-licensed, and logs everything it does to ~/.claude-auto-retry/logs/.

Terminal window
npm i -g claude-auto-retry
claude-auto-retry install

The installer adds the shell function to ~/.bashrc or ~/.zshrc and installs tmux if it’s missing (apt, dnf, brew, pacman, apk). Then use Claude Code exactly as always:

Terminal window
claude

When a limit hits, you’ll see the monitor take over. Check on it with:

Terminal window
claude-auto-retry status # what it's waiting for, and until when
claude-auto-retry logs # what it has done

Retry counts, the wait margin, and custom detection patterns live in ~/.claude-auto-retry.json if you want to tune them. Needs Node.js ≥ 18; tested on Ubuntu, CentOS, macOS, Arch, and Alpine.

We first shared the tool on r/ClaudeAI — the discussion there is a decent picture of how many people hit this exact wall.

How do I resume Claude Code after hitting the usage limit? Wait for the reset time shown in the limit message, then type continue in the same session — Claude Code keeps all its context. To do it automatically, claude-auto-retry parses the reset time from the message, waits, and types continue for you.

Can Claude Code auto-continue after the limit resets? Not on its own — Claude Code stops mid-task and waits for a human. That’s exactly the gap claude-auto-retry fills: one npm i -g claude-auto-retry, and sessions resume at the reset without anyone at the keyboard.

Does Claude Code have a 5-hour limit? The limit belongs to your Claude subscription, not to Claude Code itself: usage is metered in rolling windows shared across everything on the account, and heavy agent runs simply burn the window faster. When it’s exhausted, every surface — Claude Code included — waits for the reset.

Can Claude Code resume overnight, with my laptop closed? Yes, if the session survives your terminal: claude-auto-retry runs Claude Code inside tmux transparently, so you can drop SSH or close the lid and the monitor still types continue at the reset, server-side. Reattach in the morning to a run that kept going.

Can I avoid the usage limit entirely for unattended runs? Not on a metered subscription — but you can route the unattended work to an endpoint without rolling caps. See the next section.


claude-auto-retry makes limits painless when the work can wait a few hours. Some workloads can’t — always-on agents, batch jobs, anything that has to keep moving at 4am.

Claude Code speaks the Anthropic Messages API, which means it can point at any compatible endpoint — including ours. CheapestInference serves open-weight models across three pools (Kimi K3 in the Flagship pool; Kimi K2.7, GLM 5.2, and MiniMax M3 in the Frontier pool; DeepSeek V4 Flash and MiMo v2.5 in the budget Core pool) through an Anthropic-compatible endpoint, with a different limits model: you reserve daily 8-hour time blocks, and during your reserved hours inference is unlimited — there is no usage-limit message to parse, because there is no rolling cap to hit.

Terminal window
export ANTHROPIC_BASE_URL="https://api.cheapestinference.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="your-api-key"
export ANTHROPIC_MODEL="kimi-k2.7"
claude

The two approaches compose. Plenty of people keep their Claude subscription for interactive work and run the long unattended stuff — the runs that would otherwise die at 11pm — on an open-weight model during a reserved block. Open-weight coding models are closer to frontier than most people assume; here’s the current evidence.

Either way: stop typing “continue”.

OpenRouter alternatives in 2026: unified LLM APIs compared

OpenRouter solved a real problem: one API key, hundreds of models, no separate accounts per provider. You point your code at openrouter.ai/api/v1 and pick any model from any provider.

But OpenRouter isn’t the only unified API anymore. And depending on your workload, it might not be the cheapest or fastest option. Here’s how the alternatives compare.


Credit where it’s due:

  • Model coverage: 200+ models from dozens of providers. If a model exists, OpenRouter probably has it.
  • Automatic routing: openrouter/auto picks a model for you based on your prompt. Useful for prototyping.
  • Fallback: If one provider is down, OpenRouter routes to another. You don’t handle failover yourself.
  • Single billing: One account, one API key, one invoice. No managing 8 provider accounts.

For developers who want access to everything and don’t want to manage multiple integrations, OpenRouter is a good default.


OpenRouter adds a margin on top of each provider’s per-token price. This is how they make money — they’re a reseller. The markup varies by model but is typically 5–20% above the direct provider price.

For low-volume usage, the convenience premium is negligible. For high-volume or agent workloads, it compounds:

Model Direct price (input) OpenRouter price Markup
Claude Sonnet 4.6 $3.00/M $3.00/M 0%
DeepSeek V3.2 $0.27/M $0.30/M +11%
Llama 3.1 70B $0.13/M $0.16/M +23%
Qwen 3.5 397B $0.40/M $0.48/M +20%

The markup is smallest on premium models (where the provider’s price already includes healthy margin) and largest on cheap open-source models (where OpenRouter’s fixed costs are a bigger percentage).

For an agent consuming 10M tokens/day on DeepSeek V3.2, the markup adds $9/month. Not a lot. But on a team of 10 with multiple agents each, it adds up — and the per-token model itself is the real problem for agent workloads.


Best for: Fastest open-source model inference.

Together runs their own GPU clusters optimized for open-source models. No reselling — they serve the models directly. This means lower latency and often lower prices than OpenRouter for the same model.

  • 100+ models
  • Own infrastructure (not reselling)
  • Competitive pricing on open-source models
  • Dedicated endpoints for production workloads
  • Per-token pricing only

Together doesn’t carry proprietary models (no Claude, no GPT). If you need Anthropic or OpenAI alongside open-source, you need a second integration.

Best for: Low-latency inference with custom model support.

Fireworks focuses on speed. Their custom serving infrastructure delivers lower latency than most providers, especially for open-source models. They also support fine-tuned model deployment.

  • 50+ models
  • Very low latency
  • Fine-tuned model hosting
  • Serverless and dedicated options
  • Per-token pricing only

Like Together, Fireworks doesn’t carry proprietary models natively.

Best for: Absolute lowest latency.

Groq’s custom LPU hardware delivers the fastest inference in the market for supported models. If your use case is latency-sensitive (real-time chat, voice agents), Groq is hard to beat.

  • 15+ models (smaller catalog)
  • Sub-second TTFT on most models
  • Free tier available
  • Per-token pricing

Limited model selection. No Claude, no GPT. But what they have is fast.

Best for: Agent workloads and cost certainty.

Full disclosure — this is us. Here’s what we do differently:

  • Time-block subscriptions: Subscribe to a model pool and reserve one or more daily 8-hour blocks (Asia-Pacific, Europe, or Americas — all three for full 24/7 coverage). The Frontier pool ($57–$61/mo per block, from $48.45/mo billed annually) carries Kimi K2.7, GLM 5.2, and MiniMax M3. The Core pool ($14.99/mo per block, from $12.74/mo annually) carries DeepSeek V4 Flash and MiMo v2.5. No per-token billing.
  • Unlimited during your hours: During your reserved block, usage of every model in your pool is unlimited with no budget cap — fair use is one request at a time per key. Pay by card (Stripe) or USDC on Base.
  • A focused lineup: six curated open-weight models through one OpenAI- and Anthropic-compatible endpoint.
  • x402 pay-per-request: No account needed — agents pay with USDC on Base L2 per request.

The trade-off: a small, curated model catalog instead of OpenRouter’s breadth, no proprietary models, and no automatic routing between providers.


OpenRouter Together Fireworks Groq CheapestInf.
Models 200+ 100+ 50+ 15+ 6 (curated)
Proprietary models Yes No No No No
Pricing model Per-token Per-token Per-token Per-token Time-block flat-rate
Unlimited in reserved hours No No No No Yes
Auto routing Yes No No No No
API format OpenAI OpenAI OpenAI OpenAI OpenAI

Every provider on this list is OpenAI-compatible. Switching between them is a base_url change.


OpenRouter
$4.20/mo
Together AI
$3.60/mo
CheapestInference
from $12.74/mo (Core)

At very low volume, per-token is genuinely cheaper — the Core pool ($14.99/mo month-to-month, unlimited DeepSeek V4 Flash and MiMo v2.5 during your block) costs roughly ten dollars more at this size. What it buys is a flat bill: past roughly 10M tokens/month the per-token lines cross it, and it stays flat no matter how far the chatbot grows.

OpenRouter
$420/mo
Together AI
$360/mo
CheapestInference
from $48.45/mo

At agent-scale volume, a time-block subscription is dramatically cheaper. The gap grows with usage because per-token scales linearly and a reserved block is unlimited — it doesn’t scale at all.


Stay on OpenRouter if: You need access to 200+ models, use auto-routing, and your monthly spend is under $50. The convenience premium is worth it at this scale.

Switch to Together/Fireworks if: You only use open-source models, care about latency, and want to avoid the reseller markup. Together and Fireworks serve models directly.

Switch to CheapestInference if: You run agents during predictable hours, want cost certainty, and the curated open-weight lineup covers your needs — Kimi K2.7, GLM 5.2, and MiniMax M3 in the Frontier pool, or DeepSeek V4 Flash and MiMo v2.5 in the budget Core pool. Unlimited inference during a reserved time block beats per-token billing once your usage in those hours is heavy.

Use Groq if: Latency is your primary constraint and your model is in their catalog.

All five are OpenAI-compatible. Try each one with a base_url swap and see which fits.


CheapestInference serves a curated open-weight lineup across two pools — Kimi K2.7, GLM 5.2, and MiniMax M3 (Frontier); DeepSeek V4 Flash and MiMo v2.5 (Core) — through one OpenAI- and Anthropic-compatible API. Unlimited time-block subscriptions from $12.74/mo (Core) or $48.45/mo (Frontier), billed annually. See the pools or get started.

Self-hosted vs. API inference: the real cost comparison

“Why pay for an API when I can run the model myself?”

It’s a reasonable question. Open-source models are free. GPUs are available on every cloud. vLLM and Ollama make serving straightforward. The math should be simple: GPU cost per hour × hours = total cost. Done.

Except it’s not. The GPU is the minority of the cost. Here’s the full picture.


Running DeepSeek V3.2 (671B MoE, ~130B active parameters) requires at least 4× A100 80GB or 2× H100 80GB in FP8. Qwen 3.5 397B has similar requirements.

Setup Hourly Monthly (24/7) Monthly (8h/day)
4× A100 80GB (cloud) $12.80 $9,216 $2,816
2× H100 80GB (cloud) $8.40 $6,048 $1,848
1× A100 80GB (Llama 70B) $3.20 $2,304 $704
1× L40S (Llama 8B) $1.10 $792 $242

These are cloud GPU rental prices (AWS, GCP, Lambda Labs — varies by provider and availability). If you buy hardware, the upfront cost is $15K–$40K per GPU, amortized over 3–4 years, plus electricity, cooling, and data center costs.

Smaller models are cheaper — but limited

Section titled “Smaller models are cheaper — but limited”

Running Llama 3.1 8B on a single L40S costs $242/month (8h/day). That’s competitive with API pricing. But 8B models can’t handle complex coding, multi-step reasoning, or nuanced analysis — the tasks where AI provides the most value.

The models worth self-hosting (70B+, MoE) require multi-GPU setups where the economics change dramatically.


GPU rental is just the beginning.

Someone has to:

  • Set up vLLM/TGI with optimal batch sizes, quantization, and memory allocation
  • Monitor GPU utilization and restart crashed processes
  • Update model weights when new versions release
  • Handle OOM errors, NCCL failures, and driver issues
  • Manage the serving infrastructure (load balancer, health checks, auto-scaling)

If this is a full-time DevOps engineer at $150K/year, that’s $12,500/month in labor. If it’s 20% of a senior engineer’s time, it’s $2,500/month. Either way, it’s more than the GPU.

GPUs cost money whether they’re inferring or not. If your usage pattern is 8 hours of heavy use (work hours) and 16 hours of near-zero traffic, you’re paying for 24 hours and using 8.

Cloud spot instances help but introduce availability risk. Auto-scaling GPU clusters is possible but complex — model loading takes minutes, not seconds.

API pricing is purely usage-based. Zero requests = zero cost.

Self-hosting one model is manageable. Self-hosting five models for different tasks — a coding model, a reasoning model, a fast classification model, an embedding model, and a vision model — requires either:

  • 5 separate GPU instances (expensive)
  • Shared GPU with model swapping (slow — loading a 70B model takes 2–5 minutes)
  • A serving framework that handles multi-model routing (complex)

An API gives you access to many models through the same endpoint. No model loading, no GPU allocation, no routing logic.

Every hour your team spends on inference infrastructure is an hour not spent on your actual product. For startups, this is the most expensive cost of all — it doesn’t show up on any invoice.


For a team of 5 developers running AI-assisted coding with a mix of DeepSeek V3.2 and smaller models:

Cost Self-hosted API (per-token) API (time-block sub)
Compute/inference $2,800 $265 $250
Ops/maintenance $2,500 $0 $0
Idle waste (~60%) $1,680 $0 $0
Total monthly $6,980 $265 $250

Self-hosting costs 26x more for the same workload. The GPU is only 40% of the self-hosted cost — ops and idle waste are the majority.


Self-hosting wins in specific scenarios:

Data sovereignty: If your data cannot leave your network — regulated industries, government, healthcare with strict compliance — self-hosting is the only option. No API provider can guarantee the data isolation you need.

Extreme scale: If you’re processing millions of requests per day and your GPUs are consistently at 80%+ utilization, the per-token math eventually favors owned hardware. This threshold is higher than most teams expect — typically $20K+/month in API spend before self-hosting breaks even.

Custom models: If you’ve fine-tuned a model and need to serve it, self-hosting or a dedicated inference provider (Fireworks, Together) is required. Most unified APIs don’t serve custom model weights.

Latency control: If you need guaranteed sub-100ms TTFT and your data center is co-located with your GPUs, self-hosting eliminates network hops.

For everyone else — startups, small teams, companies with variable usage patterns — the API is cheaper, faster to set up, and easier to maintain.


Most teams don’t need to choose one forever. A practical approach:

  1. Start with an API: Get your product working, validate demand, understand your usage patterns.
  2. Optimize model selection: Use cheaper models for simple tasks, frontier models for hard tasks. Full guide: Multi-model architecture.
  3. Evaluate self-hosting when: Your monthly API spend exceeds $10K, your GPU utilization would be >70%, and you have DevOps capacity to maintain it.
  4. Hybrid: Self-host your high-volume models, use an API for long-tail models and overflow capacity.

The worst outcome is spending 3 months setting up GPU infrastructure before you’ve validated that anyone wants your product.


CheapestInference serves five open-weight models across two pools — Kimi K2.7, GLM 5.2, and MiniMax M3 (Frontier); DeepSeek V4 Flash and MiMo v2.5 (Core) — through a single API. No GPUs to manage, no idle costs, no ops burden. Reserve a daily 8-hour time block for unlimited usage from $12.74/mo (Core) or $48.45/mo (Frontier), billed annually — reserve all three blocks for full 24/7. Get started or see the pools.

The real cost of running AI agents in production

Chatbots are cheap. Agents are not.

A chatbot sends a user message, gets a response, displays it. Maybe 2,000 tokens per exchange. An agent reads files, calls tools, retries on errors, re-sends the entire conversation every step, and does this 20–60 times per task. Same API, completely different economics.

If you’re budgeting for AI agents the same way you budget for a chatbot, you’re underestimating by 10–50x.


We measured token consumption across three workload types, each running for one hour:

Coding agent (OpenClaw)
~2.1M tokens
Research agent (CrewAI)
~1.2M tokens
RAG chatbot
~200K tokens
Simple chatbot
~40K tokens

The coding agent consumed 52x more tokens than a simple chatbot in the same time period. And this is normal — the agent was doing useful work the entire time.


Three architectural properties of agents make them expensive:

Every agent step appends tool outputs to the conversation. The LLM re-processes the entire conversation on each step. If the agent reads a 3,000-token file at step 5, that file gets re-sent at steps 6, 7, 8… all the way to the end.

For a 40-step task, one file read costs: 3,000 tokens × 35 remaining steps = 105,000 tokens in re-transmission.

This is why agent token consumption grows quadratically, not linearly.

Agent frameworks use large system prompts — OpenClaw’s is ~9,600 tokens, CrewAI’s varies by agent configuration. This prompt is sent with every request. Over 40 steps, the system prompt alone costs 384,000 tokens.

When a tool call fails, the agent retries. Each retry sends the full context plus the error message. Three retries on a 30K-token context wastes 90K tokens with no productive output.

Without a retry cap, this can run indefinitely — always bound agents with a retry cap and a maximum iteration count.


Assuming one developer running 15 agent tasks per day, 22 working days per month, ~500K tokens per task (80% input / 20% output, at each vendor’s list price — live prices here):

Model Cost/task Daily (×15) Monthly
Claude Fable 5 $9.00 $135.00 $2,970
GPT-5.5 $5.00 $75.00 $1,650
Claude Opus 4.8 $4.50 $67.50 $1,485
GLM 5.2 (open) $1.00 $15.00 $330
DeepSeek V4 Flash (open) $0.08 $1.26 $28
CheapestInference (full day) from $48.45/mo flat

A team of 5 developers each running 15 tasks/day on Claude Fable 5 spends $14,850/month. The same team on flat-rate via CheapestInference pays a fixed monthly subscription per seat (from $48.45/mo for a reserved daily time block) — no matter how many tokens those agents burn. That’s an order-of-magnitude reduction.


Four strategies to cut agent inference costs

Section titled “Four strategies to cut agent inference costs”

Open-weight models like Kimi K2.6 and MiniMax M3 now sit at parity with Gemini 3.1 Pro on SWE-bench Verified, and GLM 5.2 outscores GPT-5.5 on SWE-bench Pro — at a half to a sixth of the per-token price. Full data: the Which-LLM guide and the State of Open Weights report.

Not every agent step needs a frontier model. File reads, simple classifications, and formatting don’t need 685B parameters. Use a small model for easy steps and a large model for hard ones. Full guide: Building a multi-model architecture.

Give each agent its own API key so one runaway agent can’t starve the others. On a time-block subscription each key gets unlimited usage during its reserved hours, so you isolate workloads without juggling per-token allocations.

Per-token pricing penalizes the exact patterns agents use: large contexts, many steps, retries. Flat-rate pricing makes all of that free. During your reserved time blocks your agent can use the full context window and retry freely without increasing the bill — reserve all three blocks for 24/7 coverage.


Here’s the equation most teams miss:

Agent cost = tokens_per_step × steps × cost_per_token

Most optimization focuses on cost_per_token — switching to a cheaper model. But tokens_per_step grows with context (quadratic), and steps is unpredictable. Optimizing only one variable leaves the other two working against you.

Flat-rate pricing eliminates all three variables from your bill. The cost is the subscription. Period.


We serve five open-weight models across two flat-rate pools — Kimi K2.7, GLM 5.2, and MiniMax M3 in the Frontier pool (from $48.45/mo), DeepSeek V4 Flash and MiMo v2.5 in the Core pool (from $12.74/mo) — with unlimited time-block subscriptions: no token counting, no budget caps during your reserved hours. Reserve 1–3 daily 8-hour blocks and your agent’s token consumption never becomes your problem. Get started or see plans.

OpenClaw is free. Running it is not.

OpenClaw has 247,000 GitHub stars. It’s free, open-source, and runs locally. You install it, point it at an LLM, and it writes code, browses the web, queries databases, and executes files on your behalf.

The agent is free. The inference is not.

Every time OpenClaw calls a model, it re-sends the entire conversation history — every tool output, every file it read, every intermediate result. By iteration 20 of a typical task, the input context is 30,000+ tokens. By iteration 40, it’s past 100,000. And it sends this every single request.

This is not a bug. It’s how agents work. And it’s why running OpenClaw on pay-per-token APIs costs $300–600/month for active users — sometimes more.


We broke down token consumption for a typical OpenClaw coding task: “add authentication to an Express API.” The agent completed it in 38 tool calls.

Context accumulation
~280K tokens
System prompt (×38)
~156K tokens
Tool outputs (files, etc.)
~70K tokens
Agent output
~19K tokens

Total: ~525,000 tokens for a single task. The agent’s actual output — the code it wrote — was 19K tokens. The other 96% is overhead.

On Claude Opus at $15/M input + $75/M output, that single task costs $9.18. Run five tasks a day and you’re at $1,377/month.

On DeepSeek V3.2 via a pay-per-token provider at $0.27/M input + $1.10/M output, the same task costs $0.16. Better — but 20 tasks a day is still $96/month, and that’s one agent.


Here’s the OpenClaw-specific version:

OpenClaw reads files into context. If it reads a 2,000-token file at step 5, that file gets re-sent at steps 6, 7, 8… all the way to 38. That single file read costs 2,000 × 33 remaining steps = 66,000 tokens in re-transmission alone.

Users report session contexts at 56–58% of the 400K context window during normal use. This isn’t a failure mode — it’s the architecture working as designed.

OpenClaw’s system prompt is ~9,600 tokens. It gets sent with every request. Over 38 tool calls, that’s 365K tokens just in system prompts. You pay this whether the agent does useful work or not.

OpenClaw defaults to a single model for everything. But not every tool call needs the same intelligence:

  • Reading a file and deciding what to edit? Llama 3.1 8B handles this at 200 tokens/sec.
  • Writing complex authentication logic? A frontier open-weight model like Kimi K2.7 is the right call.
  • Formatting a config file? Any 8B model is overkill but still cheaper than Opus.

We wrote a full guide on this pattern: Building a multi-model architecture. Routing agent requests to the right model can cut costs by 60–80% without reducing output quality.


Here’s the comparison for an OpenClaw user running ~20 tasks/day:

Provider Cost/task 20 tasks/day Monthly
Claude Opus (direct) $9.18 $183.60 $5,508
GPT-5.4 (direct) $4.73 $94.60 $2,838
DeepSeek V3.2 (per-token) $0.16 $3.20 $96
CheapestInference (flat-rate) from $12.74/mo (Core) · $48.45/mo (Frontier)

Flat-rate means you don’t care about context accumulation. The 280K tokens of context overhead that makes pay-per-token expensive? Irrelevant. The system prompt tax? Doesn’t matter. Your agent can call models 24/7 and the bill is the same.


If you’re running OpenClaw, here’s the setup we see working best:

1. Use open-weight models. Frontier open-weight models like Kimi K2.7 and GLM 5.2 score within a few points of proprietary models on coding benchmarks (the data). The gap doesn’t justify a 50x cost difference.

2. Route by complexity. Don’t send file reads and simple decisions to the same model as complex code generation. A router model costs fractions of a cent per classification. Full guide: Multi-model architecture.

3. Reserve the hours you work. On CheapestInference you subscribe to a pool and reserve one or more daily 8-hour time blocks (Asia-Pacific, Europe, Americas — pick 1–3, all three is full 24/7). The Frontier pool (from $48.45/mo billed annually) carries Kimi K2.7, GLM 5.2, and MiniMax M3; the Core pool (from $12.74/mo) carries DeepSeek V4 Flash and MiMo v2.5 — both 1M-context models that handle everyday OpenClaw tasks for the price of a couple of coffees. During your reserved hours inference is unlimited with no budget cap. One API key per agent, one request at a time per key. Outside your window, requests return 429 until your block opens again.

4. Handle rate limits automatically. Time blocks mean your agent will hit 429s outside your reserved window — that’s expected. But OpenClaw kills the conversation when it gets a 429. The agent stops, and if you close the dashboard, that conversation is gone.

We built an OpenClaw plugin that fixes this: openclaw-ratelimit-retry. It hooks into agent_end, detects retriable 429s, parks the session on disk, and waits for the budget window to reset. Then it sends chat.send to the original session — resuming the conversation with its full transcript, as if you had typed a message.

Terminal window
openclaw plugins install @cheapestinference/openclaw-ratelimit-retry
~/.openclaw/config.yaml
plugins:
ratelimit-retry:
budgetWindowHours: 8 # matches your CheapestInference 8-hour time block
maxRetryAttempts: 3 # give up after 3 consecutive 429s
checkIntervalMinutes: 5 # check every 5 min for ready retries

The plugin is zero-dependency, persists across server restarts, deduplicates by session, and handles edge cases like sub-agents, queue overflow, and corrupted state files. If the retry itself hits a 429, it re-queues automatically. No tokens wasted on re-sending from scratch — the agent picks up exactly where it left off.

This turns budget caps from “your agent crashes” into “your agent naps and wakes up.” Set it up once and forget about it.

5. Consider unlimited time blocks. If your agent runs more than a few tasks per day, per-token pricing works against you. Every token of context overhead is money. With an unlimited time-block subscription, context overhead is free during your reserved hours — re-send the full window, let the agent work without a budget cap.


OpenClaw is free because the code runs on your machine. But the valuable part — the intelligence — runs on someone else’s GPUs. The agent framework is the cheap part. Inference is the expensive part.

Open-source models on flat-rate infrastructure flip this equation. The models are free. The inference is flat. The only variable cost left is your time.

Point your OpenClaw base_url at https://api.cheapestinference.com/v1 and find out what unconstrained agents actually cost: nothing more than you already budgeted.