---
type: "post"
id: "modelswitch-v0-2-0-adds-per-api-key-fa277f"
slug: "modelswitch-v0-2-0-adds-per-api-key-fa277f"
title: "ModelSwitch v0.2.0 adds per-API-key budgets, rate limits, and cost estimates"
description: "ModelSwitch v0.2.0 adds per-API-key rate and concurrency limits, monthly USD budgets, expiry dates, and estimated request costs to its self-hosted LLM gateway."
retrieval_nugget: "ModelSwitch v0.2.0 adds per-API-key rate and concurrency limits, monthly USD budgets, expiry dates, and estimated request costs to its self-hosted LLM gateway. For teams sharing a gateway, the update moves basic usage controls to the key boundary, while explicitly warning that budgets and cost records are not exact billing controls."
published_at: "2026-11-06"
updated_at: "2026-11-06"
record_date: "2026-11-06"
date_kind: "published_at"
topics: ["agent-economics","model-routing"]
entities: ["ModelSwitch"]
related_patterns: ["agent-economics-moves-to-completed-work"]
novelty_label: "new_fact"
what_changed: "ModelSwitch v0.2.0 adds per-API-key budgets, rate limits and cost estimates; the cited prior docs cover API rate limits and spend controls for different platforms."
prior_refs: []
source_url: "https://github.com/yosephfetene/ModelSwitch/releases/tag/v0.2.0"
source_urls: ["https://github.com/yosephfetene/ModelSwitch/releases/tag/v0.2.0"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:modelswitch-v0-2-0-adds-per-api-key-fa277f"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/modelswitch-v0-2-0-adds-per-api-key-fa277f/","markdown":"https://newruntime.com/posts/modelswitch-v0-2-0-adds-per-api-key-fa277f.md","json":"https://newruntime.com/posts/modelswitch-v0-2-0-adds-per-api-key-fa277f.json"}
markdown_url: "https://newruntime.com/posts/modelswitch-v0-2-0-adds-per-api-key-fa277f.md"
---

# ModelSwitch v0.2.0 adds per-API-key budgets, rate limits, and cost estimates

## Retrieval answer

ModelSwitch v0.2.0 adds per-API-key rate and concurrency limits, monthly USD budgets, expiry dates, and estimated request costs to its self-hosted LLM gateway. For teams sharing a gateway, the update moves basic usage controls to the key boundary, while explicitly warning that budgets and cost records are not exact billing controls.

## Summary
ModelSwitch v0.2.0 adds per-API-key rate and concurrency limits, monthly USD budgets, expiry dates, and estimated request costs to its self-hosted LLM gateway. For teams sharing a gateway, the update moves basic usage controls to the key boundary, while explicitly warning that budgets and cost records are not exact billing controls.

## What happened
ModelSwitch released version 0.2.0 on November 6, 2026. The GitHub release labels it a pre-release and frames the work around making the gateway shareable with other users. Its central change is that each API key can now carry its own controls, rather than every user or application inheriting one undifferentiated server-level policy.

The new controls include rate limits and concurrency limits. A rate limit restricts how quickly a key can send requests; a concurrency limit restricts how many requests from that key can be running at the same time. The release notes state that both kinds of limit are counted per server. That qualification matters for an operator deploying more than one server, because the supplied material does not describe a single global counter across servers.

Version 0.2.0 also lets an operator give an API key a monthly budget in US dollars. Once usage reaches about that amount, ModelSwitch stops accepting requests for that key until the next month. The release calls budgets firm rather than exact. Requests already in progress can finish after a key reaches its configured limit and can therefore push spending slightly above it. Budgets are not enabled automatically: a key has no budget unless an operator assigns one. In addition, a key with a budget may use only models that have a configured price.

For visibility, ModelSwitch adds estimated request costs. Operators set versioned prices, and the gateway records an estimated cost for each request from token counts reported by the provider. Versioning preserves historical estimates: changing a price later does not rewrite estimates already recorded for earlier requests. The release notes also set a clear boundary on this feature. The numbers are estimates, not a representation that ModelSwitch will match a provider invoice, and failed attempts are not counted. The notes say the real bill can consequently be higher than the recorded amount.

The release further adds key expiry: an operator can set a date after which a key stops working. It differentiates live and development credentials through the `ms_live_` and `ms_dev_` prefixes. Upgrading requires running `modelswitch migrate` before starting this version. The release provides no price for ModelSwitch, adoption metric, repository star count, or service-level claim. As a pre-1.0 release, it says details may change.

## What the archive adds
The archive includes a related Field Note on [Claude Code pooled group budgets and gateway policies](https://newruntime.com/posts/claude-code-2-1-316-adds-pooled-group-346630/). That note concerns a different product, but it makes the connection useful: budget and policy controls are appearing at the access layer around AI systems, not only in provider billing consoles. ModelSwitch v0.2.0 is a new event and a new product-specific fact, rather than a restatement of that earlier release.

## Trend signal
This is modest support for [Agent economics moves to completed work](https://newruntime.com/patterns/agent-economics-moves-to-completed-work/). The pattern’s associated assumption is that platforms will expose usage analytics that make full trajectory cost measurable. ModelSwitch does expose per-key estimated request cost and budget guardrails, but it does not report completed-task cost, outcomes, or verification. It is therefore an infrastructure step toward more observable AI spending, not evidence that gateway usage alone can measure economic value.

## Why now
The release notes identify sharing ModelSwitch with other users as the reason for these additions. A gateway serving several people or applications needs distinctions between their credentials: one key may need lower request volume, fewer simultaneous calls, a temporary lifespan, or a separate spending boundary. v0.2.0 packages those controls at the API-key level rather than presenting a single shared operational envelope for all traffic.

## Why it matters
A self-hosted gateway can centralize access to model providers, but centralization also concentrates operational risk. Without per-key controls, one application can consume concurrency, send traffic faster than intended, or create usage that is difficult to separate from everyone else’s. Rate and concurrency limits offer a practical way to contain request pressure. Monthly key budgets add a second kind of guardrail: an operator can allocate a stated amount to a user or workload rather than relying entirely on after-the-fact invoice review.

The accounting qualifications are equally important. An in-flight request can take a key slightly beyond its budget. Failed attempts are excluded from recorded estimates, so recorded spend may understate the actual provider bill. Teams should use the controls for allocation, throttling, and operational visibility, while continuing to reconcile provider invoices and monitoring records. They should not treat a configured USD budget as a hard financial ceiling.

## Limits and uncertainty
The release does not quantify the maximum overshoot caused by in-flight requests. It does not provide tests comparing token-based estimates with provider charges, nor does it specify behavior for every provider or model adapter. The supplied material says limits are counted per server, but does not describe how an operator should coordinate policies across multiple servers. It also does not establish production reliability, adoption, migration reversibility, or a support commitment. Finally, pre-1.0 status means the interface and behavior may change in later releases.

## Skill to build now
If a team already operates a shared model gateway, inventory the identities behind its keys this week. Separate human experimentation, development automation, and production workloads; assign each a named key, an expiry decision, and an explicit owner. Then set a conservative test budget only for models with configured prices, and compare ModelSwitch’s recorded estimates with the provider’s billing data over a short period. Document the expected discrepancy from failed attempts and in-flight requests before using the numbers in a spending report.

## Reader takeaway
ModelSwitch v0.2.0 makes a shared gateway easier to govern per API key: it can throttle traffic, limit simultaneous work, expire credentials, and estimate spending against a monthly budget. That is useful operational infrastructure, but its cost figures are estimates and its budgets can overshoot. Keep provider billing records as the financial source of truth.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Agent Economics](https://newruntime.com/topics/agent-economics.md): Explore the agent-economics topic hub.
- topic hub: [Model Routing](https://newruntime.com/topics/model-routing.md): Explore the model-routing topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
