An app is one client of the AI Gateway, such as a product feature, a service
or an agent. It has its own policies (authentication, model routing, budgets,
guardrails, caching and tracing), and belongs to exactly one pool. A new app
starts with a copy of its pool's policy template. Apps are listed and created
at …/ai/apps: set poolId when you create one, and filter the list by
poolId to see a pool's apps.
An app's API keys belong to its consumers, one for each client or environment
that calls it. Create a consumer in the bucket (POST …/consumers), then link it
to the app by its ID (POST …/ai/apps/{appId}/consumers with its consumerId).
The app returns its linked consumers in consumers.
List apps
Lists the gateway's apps, oldest first. Filter by poolId to list the apps
of one pool. Apps in its sub-pools are not included.
path Parameters
bucketIdThe bucket ID (bckt_…). Everything in a bucket is addressed under it.
query Parameters
poolIdOnly return the apps directly in this pool.
include[]What else to return with each app. consumers returns the consumers linked
to the app in consumers, which is null otherwise.
limitThe maximum number of items to return.
offsetThe number of items to skip before the first item returned.
List apps › Responses
A page of apps.
The apps on this page.
limitThe page size that was applied.
offsetThe number of items skipped before this page.
totalThe number of items in the whole collection.
hasMoreWhether there are more items after this page.
nextThe relative URL of the next page, or null on the last page.
Create an app
Creates an app in the pool given by poolId, which cannot be changed later.
Without policies, the app starts with a copy of the pool's policy template.
Creating an app does not issue a key.
path Parameters
bucketIdThe bucket ID (bckt_…). Everything in a bucket is addressed under it.
query Parameters
include[]What else to return with each app. consumers returns the consumers linked
to the app in consumers, which is null otherwise.
Create an app › Request Body
poolIdThe pool the app belongs to. Cannot be changed later.
nameThe app's display name.
The app's policies, in the order they run, auth or internal-only
first. Omit to start from a copy of the pool's policy template.
Create an app › Responses
The app was created.
idThe app ID.
bucketIdThe bucket (gateway) the app belongs to.
poolIdThe pool the app belongs to.
nameThe app's display name.
baseUrlWhere the app's clients send OpenAI- and Anthropic-compatible requests, authenticated with one of the app's API keys. Null until the gateway is deployed.
The app's policies, in the order they run: authentication, model routing, budgets, guardrails, caching and tracing. The budgets of the app's pools and of the gateway apply as well.
The consumers linked to the app, in the order they were linked: one for each
client or environment that calls the app with its own key. Null unless
include[] has consumers. Link a consumer with
POST …/ai/apps/{appId}/consumers, unlink it with
DELETE …/ai/apps/{appId}/consumers/{consumerId}, and change it at
…/consumers/{consumerId}. Empty for a new app.
createdOnWhen the app was created.
updatedOnWhen the app was last changed.
Get an app
Returns an app, the base URL its clients call and its policies. Add include[]=consumers for its consumers.
path Parameters
bucketIdThe bucket ID (bckt_…). Everything in a bucket is addressed under it.
appIdThe app ID (config_…).
query Parameters
include[]What else to return with each app. consumers returns the consumers linked
to the app in consumers, which is null otherwise.
Get an app › Responses
The app.
idThe app ID.
bucketIdThe bucket (gateway) the app belongs to.
poolIdThe pool the app belongs to.
nameThe app's display name.
baseUrlWhere the app's clients send OpenAI- and Anthropic-compatible requests, authenticated with one of the app's API keys. Null until the gateway is deployed.
The app's policies, in the order they run: authentication, model routing, budgets, guardrails, caching and tracing. The budgets of the app's pools and of the gateway apply as well.
The consumers linked to the app, in the order they were linked: one for each
client or environment that calls the app with its own key. Null unless
include[] has consumers. Link a consumer with
POST …/ai/apps/{appId}/consumers, unlink it with
DELETE …/ai/apps/{appId}/consumers/{consumerId}, and change it at
…/consumers/{consumerId}. Empty for a new app.
createdOnWhen the app was created.
updatedOnWhen the app was last changed.
Update an app
Updates an app with JSON Merge Patch semantics: omitted properties are
unchanged, null clears, and arrays such as policies are replaced as a
whole, so send the complete list in the order the policies run. An API key
or other credential in a policy you send back without it is kept. An app
cannot move to another pool.
Fails with 409 when it changes or removes a policy that the pool's template
does not let apps change or remove.
path Parameters
bucketIdThe bucket ID (bckt_…). Everything in a bucket is addressed under it.
appIdThe app ID (config_…).
query Parameters
include[]What else to return with each app. consumers returns the consumers linked
to the app in consumers, which is null otherwise.
Update an app › Request Body
nameThe app's display name.
Replaces all of the app's policies, in the order they run. Policies that the pool's template does not let apps change or remove must stay as they are.
Update an app › Responses
The updated app.
idThe app ID.
bucketIdThe bucket (gateway) the app belongs to.
poolIdThe pool the app belongs to.
nameThe app's display name.
baseUrlWhere the app's clients send OpenAI- and Anthropic-compatible requests, authenticated with one of the app's API keys. Null until the gateway is deployed.
The app's policies, in the order they run: authentication, model routing, budgets, guardrails, caching and tracing. The budgets of the app's pools and of the gateway apply as well.
The consumers linked to the app, in the order they were linked: one for each
client or environment that calls the app with its own key. Null unless
include[] has consumers. Link a consumer with
POST …/ai/apps/{appId}/consumers, unlink it with
DELETE …/ai/apps/{appId}/consumers/{consumerId}, and change it at
…/consumers/{consumerId}. Empty for a new app.
createdOnWhen the app was created.
updatedOnWhen the app was last changed.
Delete an app
Deletes an app and unlinks its consumers. They stay in the bucket with their
keys, which no longer call the app: delete them at …/consumers/{consumerId}
to revoke the keys. A repeated delete returns 404, which clients should
treat as success.
path Parameters
bucketIdThe bucket ID (bckt_…). Everything in a bucket is addressed under it.
appIdThe app ID (config_…).
Delete an app › Responses
The app was deleted.