Skip to main content
Docs · Controls

Assign a configuration to a key

Choose the configuration an API key runs with, list the virtual models it may call, and call one by name from a request.

Browse docs · Controls › Assign a configuration to a key
On this page
  1. When you create a key
  2. On an existing key
  3. From the API
  4. What the Configuration column tells you
  5. Call another configuration by name
  6. A request cannot add a configuration
  7. Related

An API key runs with one configuration, and may also call other configurations by their virtual model. Both are set on the key and can be changed at any time. Changing them does not change the key's secret, so applications keep working.

When you create a key

  1. Open Gateway › API keys and select Create key.
  2. Enter a name and choose the project.
  3. Under Configuration, choose from the project's configurations, then the organization's. Use default configuration leaves it unset, so the key runs with the project's default, else the organization's.
  4. Optionally, under Virtual models, tick other configurations the key may call.
  5. Select Create key and copy the secret.
The Create API key dialog
The Create API key dialog. Configuration shows what the default runs with, and Virtual models lists the other configurations the key can call. Select the image to enlarge.

On an existing key

  1. Open Gateway › API keys.
  2. On the key's row, open the actions menu and select Edit key.
  3. Change Configuration or Virtual models and save.

The change applies to the next request. Requests already in flight finish with the configuration they started with.

A configuration's own page can also assign it: open it under Controls › Configurations and select Assign keys. Its API keys tab lists the keys assigned to it.

From the API

Set config_id on POST /keys or PATCH /keys/{key_id}. Omit it to run with the defaults; on PATCH, config_id: null unassigns the configuration. virtual_model_ids lists the other configurations the key may call, at most 20; on PATCH it replaces the list. See Keys and usage.

What the Configuration column tells you

Each key's row names the configuration it runs with, and under it the virtual models it may also call. A key with no configuration of its own shows Defaults. A key created before policies existed, which still carries routing settings of its own, shows those until a configuration is assigned; those settings cannot be edited, only replaced.

A key row opened to its components
Gateway › API keys with one row opened. The key's request settings, routing policy and guardrail policy, each with the configuration it comes from. Select the image to enlarge.

Call another configuration by name

One application often has more than one kind of request. A support chatbot might answer customers with cheap, fast models and also send code questions to strong coding models. Instead of a second key, the key can list the other configurations it may call.

  1. On the key, open Edit key.
  2. Under Virtual models, tick the configurations and save.
  3. In the application, send model: "config:<slug>" on the requests that should run with that configuration. Every other request keeps sending auto.
json
{ "model": "config:coding", "messages": [{ "role": "user", "content": "Why does this test fail?" }] }

The named configuration takes the place of the key's own for that request: its request settings, routing and guardrails apply, and the router still picks the model. The key stays the same, so the key's limits, its project and its bill do not change, and components an organization configuration enforces still apply. The decision record for the request names the configuration that ran.

policy:<slug> is accepted as an alias of config:<slug>, so code written against routing policies keeps working: configurations created from routing policies kept their slugs.

Which requests go to which configuration is the application's choice; Inferbase does not decide it. A configuration not on the key's list is refused with a 403 that names the virtual models the key may call. Naming the key's own configuration, or for a key with none the default it runs with, is the same as auto. The listed virtual models also appear in GET /models after auto.

A request cannot add a configuration

A request may narrow what its routing policy allows, and may choose among the virtual models on the key's list, but it cannot reach a configuration the key does not list. What a key may do changes only when its configuration or its list is edited, both of which are visible in the audit log.

The Playground is the exception, for people rather than applications: a signed-in user can pick a configuration for a session to try it, and what they see is what a key with that configuration would get.

Last updated November 21, 2026.