Switchyard for agencies: separate keys, limits and logs per client project
Agencies building AI features for several clients can give each project its own gateway key, rate limit, usage figures and log export.
Agencies and consultancies that build AI features for clients juggle several projects, several provider accounts and the question every client eventually asks: how much did my feature use last month? Switchyard gives each project its own gateway key, its own limits and its own usage numbers, behind one OpenAI-compatible endpoint.
One workspace per client, or one key per project
There are two clean ways to organise it:
- One workspace per client. Connect the client's own provider keys, so their provider bills them directly. Invite the client's developers as members if they should see logs. Each workspace has its own plan, export and deletion.
- One workspace for your agency, one gateway key per project. Useful for prototypes running on your provider account. Usage per key shows what each project consumed.
Either way, provider keys stay encrypted at rest and are never shown again, which matters when several people work on a client's account.
Limits that protect budgets
Each gateway key has a requests-per-minute limit: the workspace default of 60, or an override per key. Over the limit, requests get HTTP 429 with a retry-after header until the minute window resets. This is the simplest guard against a runaway loop in a staging environment spending a client's budget. Details are in rate limits and content logging.
Monthly plan limits apply per workspace (requests and tokens). Only successful requests count, and at the limit the gateway answers HTTP 402 with a clear error code rather than charging overage.
Reporting usage to a client
Usage shows monthly requests and tokens per key and model. For a detailed report, filter the logs (by key, model, status or time) and download the view as CSV. Logs record time, key, requested model, provider, upstream model, status, attempts, latency and tokens. Prompt and response content is not stored unless an admin turns content logging on, which keeps client data out of your gateway logs by default.
Token counts come from the provider's own usage figures. If a provider sends none in a stream, tokens are estimated (about 4 characters per token) and the log entry says so. For billing a client, use the provider's invoice as the source of truth and the gateway's numbers for the breakdown.
Moving a client between models
Clients change their minds about models. With aliases, your code calls fast or summarise; switching the provider or model is a dashboard change, not a redeploy. You can also call a specific target directly as provider-name/model, for example openai-main/gpt-4o-mini, when a feature must use one exact model. The routing and fallback article explains how targets are tried.
Handing over a project
At the end of an engagement:
- Export the workspace as JSON. It contains providers (without keys), aliases, settings, per-key limits and request logs.
- If the client takes over the workspace, invite their owner and change roles; if not, the client creates their own and you recreate the aliases from the export.
- Revoke your agency's gateway keys.
- Delete the workspace if it is no longer needed: stored provider keys are deleted immediately.
Fit and limits
Switchyard covers chat completions with streaming. Tool calls, images and n greater than 1 are not supported yet, so features that depend on them should call the provider directly for now. Request logs are kept for 7 days on Free and 30 days on Pro; download CSVs monthly if a client needs longer records.
Pro is $49 a month excluding VAT per workspace, with 200,000 requests and 200M tokens a month. Provider costs are always billed by the provider, with no markup from us.
A practical setup for a new client
- Create a workspace named after the client and connect their provider account with Check connection.
- Create the aliases the feature needs, for example
draftandclassify, each with a fallback target from a second provider. - Create one gateway key for staging (low per-minute limit) and one for production.
- Share the base URL and the production key with whoever deploys the app, through your usual secrets manager; the key is shown only once.
- Put a monthly reminder in your calendar to download the usage CSV for the client report.
Try Switchyard free
One OpenAI-compatible endpoint in front of your own model provider keys: routing, fallback, rate limits, usage and logs. The Free plan needs no card; you can export or delete your data any time.