Skip to main content

What This Guide Covers

  • Why one-size-fits-all model selection is the wrong default for any production swarm
  • Four concrete cost patterns you can drop into existing pipelines without re-architecting
  • The 50% night-mode discount window on swarm completions and how to claim it
  • A reproducible cost table comparing naive (all-flagship) to a tiered + batch + night-mode setup
  • The two configuration levers (max_tokens and max_loops) that quietly drive most of your spend
The goal of this guide is not to make your agents cheaper at the expense of quality. It is to put your most expensive model only where it changes the answer — and to use cheaper models, batch endpoints, and the night-mode window everywhere else.

Why This Matters

Most production Swarms bills look the same when you trace them: one or two agents do work that genuinely requires a flagship model (synthesis, hard reasoning, final write-up) and three or four agents do work a cheaper model would handle identically (classification, extraction, formatting, routing). Running every agent on the flagship is the default — and the default is wrong. The job to be done is not “use the best model.” It is “produce a defensible artifact at the lowest cost-per-unit-of-quality.” The patterns below are the levers that move that ratio, in priority order.

The Cost-Capability Trade-Off

Anthropic and OpenAI both publish three rough tiers, and the ratios are roughly the same across providers: As a rule of thumb across providers, cheap-tier input is roughly an order of magnitude cheaper than flagship input, and cheap-tier output is several times cheaper than flagship output. Exact ratios shift with each release — but the gap is always wide enough that misallocating tiers is the single biggest unforced error in production swarms. The mental model: default to mid-tier for workers, drop to cheap-tier for anything that classifies or extracts, promote to flagship only where the answer changes.

Pattern 1: Tiered Models in a Single Swarm

In a HierarchicalSwarm, the director synthesizes — that’s the agent that benefits from a flagship model. The workers each own a narrow lane and rarely need the same horsepower. Mix tiers in one swarm config:
The workers do bounded, low-creativity research at cheap-tier prices. The director gets the flagship model where its synthesis ability actually matters. Three cheap workers + one flagship director usually beats four flagship agents on both cost and quality, because the cheap workers are forced to stay narrow.
When the flagship in the config is anthropic/claude-opus-4-8, do not set temperature. See Claude Opus 4.8 for the full rationale — Anthropic’s API will reject the request if temperature is supplied.

Pattern 2: Two-Pass Filtering

Most production workloads are heavily skewed: 70-90% of incoming items don’t need the expensive analyst. A cheap classifier agent decides whether the expensive one runs at all. This is the highest-ROI pattern in this guide for any high-volume queue (support tickets, claim triage, document review, lead scoring).
If 80% of items auto-resolve at cheap-tier prices and only 20% reach the flagship, your effective cost-per-item collapses by roughly 4x against a naive “everything goes to the flagship” setup — without sacrificing quality on the items that mattered.

Pattern 3: Batch Endpoints + Night Mode

The Swarms platform applies a 50% night-time discount on input and output token costs for swarm completions processed between 8 PM and 6 AM Pacific (America/Los_Angeles). The discount is implemented in calculate_swarm_cost — see api/swarm_completions.py — and applies to billed swarm token costs (the per-agent fixed component is unaffected; agent completions are not discounted). The platform decides the discount based on the server clock when the work is processed, so the way you capture it is to send the work during that window, typically via the batch endpoints. Two endpoints matter here:
  • /v1/agent/batch/completions — array of single-agent jobs in one request (batching only; the night discount does not apply to agent completions)
  • /v1/swarm/batch/completions — array of multi-agent swarm jobs in one request (night discount applies)
The shape is the same: each item is a full request body, identical to what you’d send to the non-batch endpoint.
To actually claim the discount, schedule the job. A simple cron entry on a Pacific-time host is enough; for cloud schedulers, anchor on America/Los_Angeles and fire any time between 8 PM and 6 AM:
Night-mode is a 50% discount on swarm-completion token costs, not on the per-agent base charge. For token-heavy swarms (long inputs, long outputs) it cuts the bill roughly in half. For very short calls dominated by the per-agent fixed cost, the effective savings is smaller. Larger jobs benefit more.

Pattern 4: Cap Tokens and Loops

max_tokens and max_loops are the most direct, least glamorous, most effective levers in your config. Most production swarms ship with both set carelessly high “just in case.” That’s where the silent spend hides. Conservative defaults that work in production: The two rules:
  1. Default max_loops to 1. Raise it only when you have evidence a single pass underperforms. Each additional loop multiplies cost roughly linearly and helps less than chaining a fresh agent.
  2. Set max_tokens close to what the agent should actually produce. A classifier with max_tokens=4096 is paying for headroom it will never use, plus the long-tail risk of the model going long. Bound it.

Real-World Numbers

Take a realistic production workload: an investment-research team running 500 single-agent summaries plus 50 multi-agent deep-dive swarms per day. The naive setup runs everything on a flagship model, in the middle of the business day, with generous max_tokens and max_loops. The optimized setup applies all four patterns above. Assume rough per-million-token costs of flagship ~$15 input / $75 output, mid-tier ~$3 input / $15 output, cheap ~$0.30 input / $1.20 output. (Use these for relative scale; check your provider’s published rates for current values.) The savings come from four stacked decisions: (1) the 80% of work that didn’t need a flagship model didn’t get one, (2) the workers in the swarm dropped from flagship to cheap-tier, (3) max_tokens was set close to the actual output length, and (4) the whole pipeline ran during the night-mode window. Any one of them in isolation saves money. Stacked, they consistently produce a 5-10x reduction on real workloads.
These numbers are illustrative. Your actual ratio depends on the cheap-tier hit rate of your classifier (Pattern 2), the input/output mix of your specific prompts, and current published provider rates. Treat the table as the right shape, not the right absolute number, and measure your own workload.

A Checklist Before You Ship

Run this list against any swarm config heading to production:
  • Does every agent need the model it’s currently using? Demote any worker whose job is classification, extraction, or formatting.
  • Is max_tokens bounded close to the expected output length on every agent?
  • Is max_loops set to 1 unless you have measured that more loops change the answer?
  • Could a cheap classifier filter the queue before the expensive agent runs (Pattern 2)?
  • Can the workload run overnight on /v1/swarm/completions or /v1/swarm/batch/completions for the 50% night discount (Pattern 3)?
  • Have you confirmed the flagship agent is reserved for the role that genuinely benefits — synthesis, final judgment, the agent whose output is the artifact?

Next Steps