Model and provider allowlists
A Meadow API key can carry three lists: the models it may call (allowed_models), the model providers its calls may go to (allowed_providers), and the sandbox providers it may create sandboxes on (allowed_sandbox_providers). Meadow checks them before it calls any provider or holds any spend. A key created from another key is held by its own lists and by those of every key above it.
Next step: give a key handed to a job or a customer the lists it needs, and check the result with GET /v1/models.
Not on the hosted beta yet. allowed_providers, allowed_sandbox_providers, the two new error codes and changing a list with PATCH /v1/keys/{key_id} arrive with its next update. Nothing on this page was run against the hosted beta: the behavior is read from the server’s code and its tests, so no output is shown.
Set the lists
Set them when you create a key, or later with PATCH /v1/keys/{key_id}. Both need an admin key.
Things to know before you rely on them:
- An empty list returns 400. Leave the field out to allow everything. On
PATCH,nullremoves a list. - An unknown provider, a sandbox provider in
allowed_providersor a model provider inallowed_sandbox_providersreturns 400 with the field inerror.param. - A key object shows its own lists, and leaves out a list it does not have. The lists of the keys above it can narrow it further.
GET /v1/modelsshows the result. allowed_modelsandallowed_providersare the names OpenRouter uses on its guardrails.
How model IDs match
Matching is exact and case-sensitive, after Meadow reads the ID the way it reads a request’s model:
- A plain ID such as
claude-haiku-5-5allows that model on every provider that serves it, including a pinned request such asbedrock/claude-haiku-5-5. - A prefixed ID such as
anthropic/claude-haiku-5-5allows the model on that provider only. - A provider alias counts as the model it names:
claude-haiku-4-5andclaude-haiku-4-5-20251001are one model. Another version of the same family is another model. - A leading
meadow/is dropped. OpenRouter, LiteLLM and Vercel spellings such asopenrouter/anthropic/claude-haiku-4.5resolve as they do in a request. See Models. - An ID Meadow does not list, such as a new
claude-ID, matches only the same plain ID or that ID pinned to its own provider. - A prefix Meadow does not know, such as
acme/model-1, returns 400 when you set the list.
The list is checked against the model your request names, before any provider is called. When the provider answers with another snapshot, or reroutes the model to a newer one, the call is served. The usage record’s served_model shows what answered. See Usage and cost.
openrouter/openrouter/auto on the list lets OpenRouter pick any model. On a key with an allowed_models list, Meadow removes preset and route from requests sent to OpenRouter.
How provider lists apply
allowed_providers applies to every attempt of a model call: the default route, provider.order, provider.only, a pinned model ID, each model in models and each fallback to the next provider. A fallback never goes to a provider off the list. When the route keeps no provider on the list, the call returns 403 before any provider is called.
The provider is the Meadow provider whose stored key pays for the call. With openrouter on the list, OpenRouter still picks its own upstream for the model.
A key with a dollar limit can only call providers Meadow has prices for. allowed_providers keeps the route to those, so such a key can use a project whose default route includes openrouter. See Spend limits.
allowed_sandbox_providers applies to POST /v1/sandboxes, to its fallback to the next provider, and to POST /v1/images and its build_on. A sandbox already running stays reachable after its provider leaves the list.
What a rejected call looks like
On the model routes the body is in the format’s own envelope, with the status the providers use for a model a key may not use: 403. OpenAI’s SDK raises PermissionDeniedError and Anthropic’s raises PermissionDeniedError.
See Errors for every code.
Child keys
A key created by a key with a list must name a list inside it. Leaving the field out, or naming a model or provider the parent key may not use, returns 403 key_grant_exceeds_parent.
A change applies to every key below at once. When you narrow a parent’s list, each child is held by the narrower list from its next call, though the child’s own list stays as it was. A PATCH must also stay inside the lists of the keys above the changed key, and inside the calling key’s own lists, so a key cannot widen itself or any other key past what it holds.
A key Meadow makes for a sandbox with model_access or sandbox_access gets the three lists of the key that created the sandbox.
Changes and calls in flight
Meadow reads the lists once, when it authenticates a request, and plans the route from them. A call that is already running when you change a list keeps that route, fallbacks included. Every call authenticated after the PATCH returns uses the new list.
API reference
Operations on this page: createKey, updateKey, listModels, createChatCompletion, createMessage, createResponse, createSandbox, createImage.