Skip to Content

Configure a product

A product sets which provider accounts and models a customer can use, with usage limits and rate limits. Products are Modem records, separate from payment-processor prices.

The Free product

Creating a project also creates a Free product. The Free product:

  • Has no SKU.
  • Is the project’s initial default product.
  • Shows as Included in the dashboard.
  • Cannot be deleted while it is the default product.

Add a product

  • Open the project’s Products tab.
  • Select Add product.
  • Enter a display name.
  • Enter a SKU. A Stripe-backed paid product uses its Stripe Price ID as the SKU.
  • Select a billing interval: Daily, Weekly, Monthly, Yearly, or One-time purchase.
  • Select Add.

Product settings

Select the product’s name in the Products table, or choose Configure product from its actions menu. The dialog connects provider accounts and sets limits.

Limits save as you change them. Provider accounts need Save.

Connecting provider accounts

In Provider accounts, connect each account this product can use. See Configure a provider account.

Adding limits

The Limits section lists the product’s limits by Model, Limit, and Window. There are two kinds:

  • A usage limit caps each billing period. The gateway serves a request only when a usage limit applies to it: the limit covers the request’s model and measures a metric that the requested API supports.
  • A rate limit caps each minute, hour, or day. Rate limits are optional. Every rate limit that applies to a request is enforced. These use epoch-aligned minute/hour/day windows, not a continuous refill.

To set a usage limit or rate limit, select Add limit and fill in:

  • Model. A model from the list, which shows the models of the project’s provider accounts. Choose Custom model ID to type a model ID, or Match a pattern to enter a Pattern: a regex matched against the model ID. Modem rejects a pattern that could run too slowly.
  • Measure. What the limit counts. The list shows the measures the model supports. If you change the model and it does not support the measure, the measure resets to Requests.
  • Limit. The number, with its unit shown in the field. Requests, tokens, characters, and images take a whole number up to 2,147,483,647. Audio file size takes megabytes, up to 2,047 MB, and audio duration takes seconds, up to 2,147,483 seconds.
  • Window. Billing period makes a usage limit. It resets each billing period, and never for a one-time purchase. Per minute, Per hour, or Per day makes a rate limit.

Under the fields, the dialog reads the limit back, for example “Up to 500 requests per month on gpt-4o-mini”.

A saved limit keeps its measure and its kind. To change either, delete the limit and add a new one.

See protocols and measures for the current source-derived list. Every API counts requests; additional measures depend on the protocol and model.

Usage limits on provider-reported usage, such as tokens, are soft caps. When recorded usage reaches the limit, new requests are refused. Requests already running can finish above the limit. Modem does not add a separate allowance-overage charge; upstream API charges or subscription quota use can still apply.

Usage known before the provider call, such as the request count, is reserved first. Definitively not-run or rejected work releases its reservation. Failed or interrupted work can settle admitted and measured usage, so an error after dispatch or partial service does not guarantee a refund. See Usage and logs.

When a limit refuses a request

The gateway answers 402 when no usage limit applies, and 429 when a usage limit is used up or a rate limit is full. A rate-limit 429 includes Retry-After when waiting for a window reset could let the request fit. If the request exceeds a blocking rule’s entire allowance, waiting cannot fix it: the delay is omitted and x-should-retry is false. See Gateway errors and Limits.

Delete a product

Choose Delete product from the product’s actions menu. Modem refuses to delete the default product, a product with active product grants, or a product with a purchase that has not settled or expired.

Deleting a product removes its provider account connections, usage limits, rate limits, and ended customer grants. Provider accounts and purchase history stay.

Customers and products

  • A customer can hold more than one product. To allow only one at a time, enforce it in your application.
  • A customer with no other active product grant gets the project’s default product, which is initially the Free product.
  • Paid access comes from verified purchases and product grants. The Client SDK starts purchases.

API reference