---
title: "Run parallel coding agents on a flat-rate LLM API | BroadRouter"
description: "Sub-agents, orchestrators and batch workers on unlimited DeepSeek V4.1 Flash. How many plan sessions you need, how to split them across keys, and how to cap overlap."
url: https://broadrouter.com/blog/run-parallel-coding-agents-flat-rate/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# How to run parallel coding agents on a flat-rate LLM API

By the BroadNet Inference team · 5 min read · Published 2026-11-14 · Updated 2026-11-16

Give each agent that works at the same time its own plan session. A session runs one request at a time with no token meter, so an orchestrator with three sub-agents needs four sessions. Cap requests in flight in your own code to match. One key can hold several sessions, and each session on Full Moon costs $60 a month.

## Key takeaways

-   One plan session equals one request in flight. Count agents that call the model at the same moment, not total agents.
-   An orchestrator plus three sub-agents running together needs four sessions.
-   Pay-as-you-go keys allow 4 requests in flight and 30 a minute, which suits bursts better than steady load.
-   Agents spend much of their time running tools, so measure real overlap before buying sessions.
-   Give each agent its own git worktree so parallel edits don't collide.
-   Test with a $1 Meteor hour per session before buying a month.

**On this page**

1.  What does a flat-rate session cover?
2.  How many sessions do parallel agents need?
3.  Which agent patterns need how many sessions?
4.  How do you keep parallel agents out of each other’s way?
5.  When is pay-as-you-go better for parallel agents?
6.  How do you wire agents to the plan?
7.  What goes wrong with parallel agents?
8.  How much context can each agent use?
9.  How do you test the setup cheaply?
10.  Where BroadNet Inference fits

Agent frameworks have moved from one assistant to many: an orchestrator that plans, sub-agents that write code, review it and run tests, and batch workers that process a backlog. On a per-token API each of those adds to the bill. On a [flat-rate API](https://broadrouter.com/glossary/flat-rate-llm-plan/) the question becomes: **how many things are calling the model at the same moment?**

## What does a flat-rate session cover?

BroadNet’s unlimited plans sell **sessions**. A session runs one request at a time, with unlimited [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) tokens and no rolling window or weekly cap. That matches how one agent works: it sends a request, reads the answer, runs a tool, and sends the next request.

| Setup | Requests in flight at peak | Sessions |
| --- | --- | --- |
| One coding agent in one terminal | 1 | 1 |
| Orchestrator + 3 sub-agents | 4 | 4 |
| 10 batch workers | 10 | 10 |
| 2 developers, 1 agent each | 2 | 2 (each on their own account) |

Each Full Moon session is $60 a month. One key can hold several sessions, or you can split a plan’s sessions across its keys, for example one key per server or per project, so a leaked or revoked key stops only the agents behind it. Keys and accounts are personal: you can build a plan into your own product, but you cannot share or resell the key. [Full session rules](https://broadrouter.com/guides/unlimited-llm-api-sessions/).

## How many sessions do parallel agents need?

Agents spend a lot of time **not** calling the model: running tests, reading files, waiting for a build. Four sub-agents that each call the model 40% of the time rarely all need it at once. Before buying four sessions:

1.  Log a start and end time for every model request your framework makes, per agent.
2.  Count the most requests that overlap in each minute.
3.  Buy sessions for the overlap you hit most of the time, not the absolute peak, and queue the rest in your own code (see the semaphore below). BroadNet’s pages don’t say whether a request over the limit waits or is refused, so don’t let agents send it blind.

For example, if your logs show two requests in flight most of the time and four only in short bursts, two sessions plus a client-side queue may be the cheaper setup.

A short script does the counting. Given a list of `(start, end)` times in seconds from your logs:

```python
from collections import Counter

def overlap_histogram(requests):
    events = sorted([(s, 1) for s, _ in requests] + [(e, -1) for _, e in requests])
    in_flight, last_t, seconds_at = 0, None, Counter()
    for t, delta in events:
        if last_t is not None:
            seconds_at[in_flight] += t - last_t
        in_flight += delta
        last_t = t
    return dict(sorted(seconds_at.items()))   # {requests in flight: seconds}
```

If the result shows most of the time at one or two requests in flight, buy two sessions. If it sits at four for hours, buy four.

## Which agent patterns need how many sessions?

| Pattern | How it calls the model | Sizing rule |
| --- | --- | --- |
| Orchestrator + workers | Planner calls, then fans out | Workers that run together, plus one for the planner if it keeps working |
| Pipeline (write → review → test) | One stage at a time per task | One session per task running in parallel |
| Batch backlog | Many identical jobs | One session per worker; more workers finish sooner |
| Several developers’ agents | Independent | One session per developer, each on their own account |

## How do you keep parallel agents out of each other’s way?

Model capacity is only half the problem. Two agents editing the same file will undo each other’s work. The usual fix is one [git worktree](https://git-scm.com/docs/git-worktree) per agent: each gets its own checkout and branch from the same repository.

```bash
git worktree add ../agent-auth -b agent/auth
git worktree add ../agent-billing -b agent/billing
```

Then split tasks by module, so agents rarely touch the same files, and merge through a review step. For running them unattended, see [overnight coding agent runs](https://broadrouter.com/blog/overnight-coding-agent-runs/); for what the extra agents cost in tokens, see [multi-agent cost](https://broadrouter.com/blog/multi-agent-cost/).

## When is pay-as-you-go better for parallel agents?

A [pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/) key allows 4 requests in flight and 30 requests a minute. That fits short, spiky fan-out: a review step that spawns four checkers for twenty seconds, then goes quiet. Steady load fits sessions, and spiky load fits per-token billing. Many setups use both: plan sessions for the long-running agents and a pay-as-you-go key for bursts and for other models such as [GLM 5.3](https://broadrouter.com/models/glm-5.3/).

When a pay-as-you-go key hits its [rate limit](https://broadrouter.com/glossary/rate-limit/) or [concurrency](https://broadrouter.com/glossary/concurrency/) limit it returns 429. Back off and retry; see [error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/). The [rate limit calculator](https://broadrouter.com/tools/llm-rate-limit-calculator/) shows how far a given limit stretches for your request pattern.

## How do you wire agents to the plan?

Most agent frameworks accept an OpenAI-compatible base URL. Point every agent at `https://inference.broadnet.ai/v1` with model `broadnet/deepseek-v4.1-flash` and give each a key:

```bash
export OPENAI_BASE_URL="https://inference.broadnet.ai/v1"
export OPENAI_API_KEY="$BROADNET_PLAN_KEY"
```

For one terminal coding agent, the [Aider guide](https://broadrouter.com/guides/aider-unlimited-deepseek/) has the exact settings; [Cline](https://broadrouter.com/guides/cline-openai-compatible/) and [OpenCode](https://broadrouter.com/guides/opencode-custom-provider/) have their own guides. For your own orchestrator, the [OpenAI Python SDK guide](https://broadrouter.com/guides/openai-python-sdk/) shows the client setup. In your own code, cap requests in flight to the number of sessions so they queue on your side, where you can see it:

```python
import asyncio
SESSIONS = 4
gate = asyncio.Semaphore(SESSIONS)

async def ask(client, messages):
    async with gate:
        return await client.chat.completions.create(
            model="broadnet/deepseek-v4.1-flash", messages=messages, max_tokens=4000)
```

## What goes wrong with parallel agents?

-   **Starting every agent at once.** A burst of simultaneous first calls exceeds your sessions at once. Stagger starts by a few seconds.
-   **Retry storms.** If every agent retries at the same moment, they collide again. Add jitter to backoff.
-   **Too little `max_tokens`.** DeepSeek V4.1 Flash reasons before answering; a small limit can return an empty reply. [Why](https://broadrouter.com/guides/reasoning-tokens-empty-response/).
-   **Sharing one key across people.** Keys are personal. Give each developer their own account.

## How much context can each agent use?

Every request can carry up to 1,048,576 tokens on DeepSeek V4.1 Flash. A sub-agent can read the whole module it is working on rather than a trimmed summary, and on a plan, a long prompt doesn’t cost extra. [When a 1M-token window helps](https://broadrouter.com/blog/million-token-context-window-guide/).

## How do you test the setup cheaply?

Buy one Meteor hour ($1) per session you think you need, and run your real agent workflow. If the agents wait on each other too often, add a session. If one sits idle, drop it. Then move to Full Moon or week-long Orbit sessions ($15 each).

## Where BroadNet Inference fits

Plan sessions suit steady, parallel agents on one model, because the bill depends on how many run at once, not on how much they read. If your agents need several different models, or call the model only in short bursts, a pay-as-you-go key or a router may cost less. Compare with the [break-even math](https://broadrouter.com/blog/flat-rate-vs-pay-per-token-llm-api/) first.

Free tools for this

-   [Agent run cost estimator](https://broadrouter.com/tools/agent-run-cost-estimator/) Context growth per step, total tokens and cost of one agent run, with a DeepSeek session comparison.
-   [LLM batch job planner](https://broadrouter.com/tools/llm-batch-job-planner/) Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.
-   [Flat-rate vs per-token LLM cost calculator](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/) Break-even between an unlimited plan and paying per token, per agent.
-   [LLM rate limit and concurrency calculator](https://broadrouter.com/tools/llm-rate-limit-calculator/) Which limit binds first: RPM, TPM or concurrency, with Little's law.

[All free tools](https://broadrouter.com/tools/)

## Terms in this article

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[Token](https://broadrouter.com/glossary/token/)

A token is the unit of text a language model reads and writes: a word, part of a word, a punctuation mark or a byte sequence produced by the model's tokenizer. LLM APIs count, limit and usually bill usage in tokens.

[Subagent](https://broadrouter.com/glossary/subagent/)

A subagent is a separate agent that a main agent starts to handle one focused task. It runs with its own context window, system prompt and tool access, does the work, and returns only a result or summary to the main agent, which keeps the main conversation small.

[AI coding agent](https://broadrouter.com/glossary/coding-agent/)

An AI coding agent is a software tool in which a language model works on a codebase in a loop: it reads files, edits them, runs commands such as tests, reads the output and decides the next step until the task is done or a limit is reached.

[Concurrency](https://broadrouter.com/glossary/concurrency/)

Concurrency is the number of requests a client has in flight at the same time. LLM APIs often cap it per key or plan, separately from requests per minute, because each open request holds GPU capacity until its response has finished.

[Rate limit](https://broadrouter.com/glossary/rate-limit/)

A rate limit is a cap an API places on how much a client can use it in a time window, such as requests per minute or tokens per minute. Requests over the limit are refused, usually with HTTP 429 Too Many Requests, until usage falls back under it.

[Base URL](https://broadrouter.com/glossary/base-url/)

A base URL is the fixed root address of an API, such as https://api.example.com/v1, that a client puts in front of every endpoint path, such as /chat/completions. In OpenAI-compatible SDKs, changing the base URL, together with the API key and model ID, points the same code at a different provider.

[Multi-agent system](https://broadrouter.com/glossary/multi-agent-system/)

A multi-agent system is an LLM application in which several agents, each with its own prompt, tools and context, work on parts of one task. A common design is orchestrator-worker: a lead agent plans, starts worker agents in parallel and combines their results.

## Questions

### What happens if two agents use one session at the same time?

A session runs one request at a time, and BroadNet's pages don't say whether a second request waits or is refused with a 429. Don't rely on either: cap requests in flight to your session count in your own code, retry 429s with backoff, and add a session if agents wait too long.

### How many coding agents can I run in parallel?

As many as you have sessions for requests that overlap. Each plan session runs one request at a time, so four agents calling the model at the same moment need four sessions. Agents that mostly run tools can share fewer sessions if your code queues their model calls.

### How do I stop parallel agents from editing the same files?

Give each agent its own git worktree and branch, and split work by file or module. Merge through normal pull requests or a final review step.

### Can I mix a plan and pay-as-you-go?

Yes. Plan keys and pay-as-you-go keys are separate. A common pattern is plan sessions for steady agents and a pay-as-you-go key for occasional bursts or other models.

### Do sessions have to be on separate keys?

No. One key can hold several sessions, or you can split them across keys, for example one key per server or per project.

### Do parallel agents cost more on a flat-rate plan?

Only by the number of sessions. Tokens are not metered on a plan, so the bill is sessions times the plan price, whatever each agent reads or writes.

## Keep reading

-   [What "unlimited" really means in an LLM API plan](https://broadrouter.com/blog/what-unlimited-llm-api-really-means/)
-   [Flat-rate vs pay-per-token LLM API: the break-even math](https://broadrouter.com/blog/flat-rate-vs-pay-per-token-llm-api/)
-   [When a 1M-token context window is worth it (and when not)](https://broadrouter.com/blog/million-token-context-window-guide/)
-   [Claude Code with open models: proxies, native endpoints and limits](https://broadrouter.com/blog/claude-code-with-openai-compatible-models/)
-   [OpenClaw and Hermes Agent on a cheap model: setup and token math](https://broadrouter.com/blog/openclaw-hermes-agent-cheap-model/)
-   [Guide: How the unlimited LLM API plans work for agents](https://broadrouter.com/guides/unlimited-llm-api-sessions/)
-   [Guide: Run Aider on unlimited DeepSeek V4.1 Flash](https://broadrouter.com/guides/aider-unlimited-deepseek/)
-   [Guide: BroadNet Inference error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/)
-   [Guide: Use Cline with BroadNet Inference (OpenAI Compatible provider)](https://broadrouter.com/guides/cline-openai-compatible/)
-   [Guide: Add BroadNet Inference to opencode as a custom provider](https://broadrouter.com/guides/opencode-custom-provider/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-run-parallel-coding-agents-flat-rate&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference plans and plan FAQ (checked 2026-11-16)](https://inference.broadnet.ai/plans?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-run-parallel-coding-agents-flat-rate&utm_content=sources)
-   [BroadNet Inference API reference, limits (checked 2026-11-16)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-run-parallel-coding-agents-flat-rate&utm_content=sources)
-   [Git documentation, git-worktree (checked 2026-11-16)](https://git-scm.com/docs/git-worktree)
