# Configure a project key and routing group

A project key controls which requests a client may make. Wallet selection happens when those requests are billed. Start in [API Keys](https://modapi.ai/keys) with a project name, intended model IDs, expected network location, budget and end date.

<a id="create-and-manage"></a>

## Give each deployment a recognizable key

Use different keys for staging and production so a test cannot exhaust the production key's cap. For example, create a named staging key, store its secret in the staging secret manager, and list its models before updating the client. For rotation, provision the replacement first, switch the intended deployment and check it before disabling the old key. Keep the old identifier available for matching historical usage.

<a id="limits"></a>

## Set restrictions the runtime can satisfy

Select only the required model IDs. Set an expiry that covers the deployment and a finite quota that covers the approved work. With an IP allowlist, enter the application's public egress IP; a developer laptop can succeed while a deployed worker fails from another address. Read back expiry, enabled model restrictions, group, quota and IPs. The settings API uses quota units; use the console's currency display or the documented conversion when specifying a dollar cap.

<a id="channel-groups"></a>

## Choose a group your account can use

Read `GET /api/user/self/groups` with profile:read and compare the intended group's model and price in the [catalog](https://modapi.ai/pricing). Set the exact group value offered for the account. A project that requires covered Prime routing should select Prime explicitly and verify that alternative groups are excluded. List models with the project key after the change. Group access does not by itself grant access to a restricted model.

<a id="fallback"></a>

## Check what Auto is allowed to try

Inspect the key's auto-group options and cross-group retry setting. Review every eligible group's policy and rate with the owner. If a second group would violate a retention requirement or spending limit, narrow the selection before running the application. An assistant diagnosing routing can compare the configured group with the actual group in [usage logs](https://modapi.ai/usage-logs/common). Record those two values, the key's project name and the time; the key secret is unnecessary.

---

Reviewed 2026-11-21 · Edition 2 · English · [Canonical page](https://modapi.ai/agent/keys-routing/)
