SCHEDULED ROUTING

Fast when it counts.
Cheaper when it doesn’t.

A scheduled virtual model sends requests to different targets during peak and off-peak hours. Your app keeps calling one model name all day.

What it is

Scheduled routing is a strategy for virtual models. You set a daily peak window in a timezone, then choose which targets serve requests during peak hours and which serve them off-peak. ZRouter checks the clock on every request and picks the matching target.

Why it matters

  • Performance when users are waiting. During business hours, send requests to your fastest or most capable model, where response time and quality matter most.
  • Lower cost the rest of the day. At night, and for batch jobs, evals, and background agents, send the same requests to a lower-priced model. You are charged at the rate of the model that served the request, so off-peak traffic costs less.
  • Avoid busy hours. If a provider is slow or rate limited at certain times, move traffic off it for those hours only.
  • No code changes. Change the schedule or the targets in your dashboard. Your app never changes its model name or redeploys.

Set it up

  1. Open Virtual models in your dashboard and create a virtual model.
  2. Add the targets you want to use, for example a premium model and a budget model.
  3. Choose the Schedule strategy, if your workspace offers it.
  4. Pick a timezone from the list. Choose where your users are, not where the server runs.
  5. Set Peak starts and Peak ends. The defaults are 09:00 to 17:00.
  6. Select peak targets and off-peak targets from the targets you added. Order is priority: the first available target serves the request.

Then send requests to the virtual model’s selector, such as accounts/<account-id>/my-assistant, in the model field.

How targets are chosen

SettingDefaultMeaning
TimezoneUTCTimezone the peak window is evaluated in.
Peak starts09:00Start of the peak window, inclusive.
Peak ends17:00End of the peak window, exclusive.
Peak targetsNoneTargets used during the window, in priority order.
Off-peak targetsNoneTargets used outside the window, in priority order.

At least one of the two target lists is required. A window can cross midnight: 22:00 to 06:00 treats the night as peak. If none of a period’s targets is available, the request goes to the first available target of the virtual model, and fallback retries still apply.

Example

Peak 08:00 to 18:00 in America/New_York, peak targets a premium model then a budget model, off-peak target the budget model. Daytime users get the premium model, with the budget model as backup. Overnight traffic is billed at the budget rate.