Zuplo API v4
Zuplo Developer API

Problem

An [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem. `type` identifies the kind of error, `title` is the HTTP reason phrase, and `detail` is written to be shown to people as is.
type
​string · uri · required

Identifies the kind of error. https://zup.fail/{slug} for Zuplo errors, https://zup.fail/http-status/{code} for generic ones.

title
​string · required

The HTTP reason phrase for status, for example "Not Found".

status
​integer · min: 400 · max: 599 · required

The HTTP status code.

detail
​string

What went wrong in this occurrence, suitable to show to a person. Omitted on 500 responses.

instance
​string

The path of the request that failed.

​ProblemTrace

Correlation data for support. requestId equals the request-id response header.

Present on validation failures; one entry per invalid field.

​ProblemRequiredChange[]

Present on 501 Not Implemented: the backend changes the operation waits for, one entry each. detail says why the request cannot be served yet.

ProblemTrace

Correlation data for support. `requestId` equals the `request-id` response header.
timestamp
​string · date-time · required

When the error occurred.

requestId
​string · required

The ID of the failed request.

ProblemFieldError

One invalid field.
location
​string · required

Where the invalid value is, for example body.budgetRules[0].limits[1].value or query.limit.

message
​string · required

What is wrong with the value.

ProblemRequiredChange

One backend change an operation waits for before Zuplo can serve it.
service
​string · required

The Zuplo service that has to change, for example tenant-api or gateway-service.

Example: tenant-api
planItem
​string · required

The item of the v4 implementation plan that makes the change, for example T1. Plan item IDs can change while v4 is a preview: show them to people, but do not depend on them.

Example: T1
change
​string · required

What has to change.

Example: An AccountMembership table holds each member's status and when they were added.

ProjectType

string · enum
Enum values:
ai-gateway
api-gateway

What a project is. ai-gateway is an AI Gateway, api-gateway an API gateway built from source. New values may be added.

EnvironmentType

string · enum
Enum values:
working-copy
preview
production

The environment of a project. New values may be added.

EnvironmentStatus

string · enum
Enum values:
provisioning
deploying
live
deleting

Whether an environment serves a deployment. provisioning: no deployment has succeeded yet, so it has no URL. deploying: a deployment is pending or running, and the environment serves its live deployment until it succeeds. live: it serves its live deployment, and nothing is deploying. deleting: it is being deleted, and requests to it fail. A failed deployment leaves the environment serving what it served before. An AI Gateway environment reports none of these: its status is null, and its deployments say where a change is. New values may be added.

DeploymentStatus

string · enum
Enum values:
pending
running
succeeded
failed

Where a deployment is. pending: it waits for its source to be uploaded, or to start. running: it is building and rolling out. succeeded: its environment served it once it was done; the environment's liveDeploymentId says whether it still does. For an AI Gateway, succeeded means the rollout finished, not that every edge serves it yet: an edge may serve the previous version for a while. failed: it did not build or roll out, and its environment kept serving what it served before. succeeded and failed are final. New values may be added.

DeploymentSourceType

string · enum
Enum values:
git
upload
deployment
zuplo

What a deployment deployed. git: a push to the project's Git repository. upload: source code uploaded with the CLI or the API. deployment: an earlier deployment of the same environment, deployed again. zuplo: Zuplo deployed it, as it does for an AI Gateway when its provider assignments change. New values may be added.

AccountRole

string · enum
Enum values:
admin
developer
member
ai-user

A person's role in the account. New values may be added.

ProjectRole

string · enum
Enum values:
admin
developer
member
ai-user

A role on a project. admin manages the project, its environments and its members. developer changes and deploys the preview and development environments, and reads production. member reads the project. ai-user, on ai-gateway projects only, uses the AI Gateway's user app with personal API keys and sees nothing else. New values may be added.

AccountRoleInput

string · enum
Enum values:
admin
developer
member

The account role to give a person. ai-user is a project role, so it is not one: give it on a project. Without role-based access control any value but admin is a 400. New values may be added.

AccountMemberStatus

string · enum
Enum values:
invited
active

Whether a person can use the account yet. invited: they were added and emailed a link, and have not signed in since; their roles take effect when they do. active: they have signed in. New values may be added.

ProviderType

string · enum
Enum values:
anthropic
azure-ai
bedrock-mantle
bedrock-runtime
custom
google
mistral
moonshot

The kind of upstream provider. Every built-in provider has its own type; custom is a custom provider, any OpenAI-compatible endpoint. zuplo-demo is Zuplo's demo provider. New values may be added.

ProviderAssignmentLabel

string · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9][a-z0-9._-]…

A provider assignment's routing prefix, unique in the bucket. Requests and policies name its models <label>/<model name>. It cannot be changed yet: changing it answers 501, because nothing rewrites the policies that name it.

Example: anthropic1

EnvironmentVariableName

string · minLength: 1 · maxLength: 255 · pattern: ^[A-Z][A-Z0-9_]*$

The name of an environment variable of the bucket's project that holds the provider's API key. The gateway reads it from the production environment when it calls the provider, so it is not checked on write: while it is missing, requests routed to the assignment fail. Unique among the project's provider assignments.

Example: ANTHROPIC_API_KEY

ModelRef

string · minLength: 3 · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+…

A model as policies, fallbacks and load balancing name it, <label>/<model name>: the provider assignment's label, as clients name the model in requests. References a policy stored before v4 are returned as they were written.

Example: anthropic1/claude-sonnet-4-6

UserId

string · maxLength: 64

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS

UserSub

string · maxLength: 255

The subject the identity provider of a person's Zuplo sign-in assigned them, for example auth0|… or samlp|…. Read-only: it is set at their first sign-in. It is not an identifier in v4, where people are their userId.

Example: auth0|65f1c2d9e4b0a1b2c3d4e5f6

DeveloperPortalUserSub

string · maxLength: 255

The subject your developer portal's identity provider assigned a person who signs in to the portal, for example google-oauth2|…. Developer portal users are not Zuplo users and have no userId: this is the named exception to V4-DATA-5.

Example: google-oauth2|113533232396018044159

ModelKind

string · enum
Enum values:
completions
embeddings

What a model is used for. New values may be added.

ModelStatus

string · enum
Enum values:
active
deprecated

Whether a model is current or on its way out. New values may be added.

PoolRole

string · enum
Enum values:
admin
member

A role on a pool. admin manages the pool, its apps and members; member can view the pool and use its apps. Neither creates, links, changes or rolls the consumers of the pool's apps, which people who manage the bucket's consumers do; both read them.

BudgetBy

string · enum
Enum values:
app
expression

What one budget is counted for. app: one budget for all the traffic the rule covers, that of an app or everything in a pool or the gateway. expression: one budget per distinct value of expression, for example per end user.

BudgetMeter

string · enum
Enum values:
cost
requests
tokens

What a limit measures. cost is in US dollars.

BudgetPeriod

string · enum
Enum values:
hourly
daily
weekly
monthly

The calendar window (UTC) a limit resets on.

BudgetAction

string · enum
Enum values:
warn
block

warn records the breach and lets requests through. block rejects requests until the period resets.

Account

An account: the people, projects and buckets of one organization, and its plan. It is addressed by `id`. Its `name` is what the portal shows.
id
​string · required

The account ID.

Example: 5f0c7c2e-8d3a-4b1e-9f2a-6c1d0e7b3a49
name
​string · required

The account's name, unique across Zuplo. The portal shows it, and v1 URLs use it. Address the account by id.

Example: acme-corp
createdOn
​string | null · date-time · required

When the account was created. Null when Zuplo has no record of it, which can be the case for accounts created before it was recorded.

AccountList

A page of accounts.
​Account[] · required

The accounts on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

Project

One gateway in an account. An `ai-gateway` project keeps everything its AI Gateway has in the bucket of its production environment.
id
​string · required

The project ID.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
accountId
​string · required

The account the project belongs to.

Example: 5f0c7c2e-8d3a-4b1e-9f2a-6c1d0e7b3a49
name
​string · required

The project's name, unique in the account. It is part of the gateway's URL. Address the project by id.

Example: acme-ai-gateway
type
​ProjectType · enum · required

What a project is. ai-gateway is an AI Gateway, api-gateway an API gateway built from source. New values may be added.

Enum values:
ai-gateway
api-gateway
​ProjectBucket[] · required

The bucket of each of the project's environment types, production first. The environments of one type share it. An ai-gateway project has only a production environment, so it has one bucket, which is created right after the project: empty until then.

createdOn
​string · date-time · required

When the project was created.

updatedOn
​string · date-time · required

When the project was last changed.

ProjectBucket

The bucket of one of a project's environment types.
id
​string · required

The bucket ID.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
environmentType
​EnvironmentType · enum · required

The environment of a project. New values may be added.

Enum values:
working-copy
preview
production

ProjectList

A page of projects.
​Project[] · required

The projects on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateProjectRequest

A new project.
name
​string · minLength: 3 · maxLength: 40 · pattern: ^[a-z][a-z0-9-]*[a-z… · required

The project's name, unique in the account. Lowercase letters, digits and hyphens. It cannot be changed later.

type
​ProjectType · enum · required

What a project is. ai-gateway is an AI Gateway, api-gateway an API gateway built from source. New values may be added.

Enum values:
ai-gateway
api-gateway

ProjectMember

A person's role on a project.
projectId
​string · required

The project.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
email
​string · email · required

The person's email address.

name
​string | null · required

The person's display name, if they set one.

Example: Jane Doe
role
​ProjectRole · enum · required

A role on a project. admin manages the project, its environments and its members. developer changes and deploys the preview and development environments, and reads production. member reads the project. ai-user, on ai-gateway projects only, uses the AI Gateway's user app with personal API keys and sees nothing else. New values may be added.

Enum values:
admin
developer
member
ai-user

ProjectMemberList

A page of project members.
​ProjectMember[] · required

The project members on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

UpsertProjectMemberRequest

A person and their role on the project.
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
role
​ProjectRole · enum · required

A role on a project. admin manages the project, its environments and its members. developer changes and deploys the preview and development environments, and reads production. member reads the project. ai-user, on ai-gateway projects only, uses the AI Gateway's user app with personal API keys and sees nothing else. New values may be added.

Enum values:
admin
developer
member
ai-user

Environment

One deployed copy of a project's gateway, with its own URL: the production environment, a preview environment for a Git branch, or a person's working copy. It serves its live deployment.
id
​string · required

The environment ID.

Example: 4f8b6c1e-2d7a-4e3b-9c5f-8a1d2e6b7c90
projectId
​string · required

The project the environment belongs to.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
name
​string · required

The environment's name, unique across Zuplo and the first label of its URL's host: the project name, the branch and a random suffix. The CLI and logs show it. Not an identifier; address environments by id.

Example: acme-api-rate-limit-9f628be
type
​EnvironmentType · enum · required

The environment of a project. New values may be added.

Enum values:
working-copy
preview
production
branch
​string | null · required

The Git branch the environment deploys, unique among the project's production and preview environments. The production environment's is the project's default branch. Null for a working copy, which deploys what its person edits in the portal.

Example: rate-limits
​required

The person whose working copy this is. Null for production and preview environments.

bucketId
​string · required

The bucket the environment keeps its gateway data in, such as consumers and API keys. A project's environments of one type share their bucket: every preview environment uses the project's preview bucket. An AI Gateway keeps its data in its production bucket.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
​required

Whether the environment serves a deployment. Null for an AI Gateway environment: nothing reliably says that every edge of an AI Gateway serves its newest configuration, so v4 does not report it. Read the environment's newest deployment (GET /v4/projects/{projectId}/deployments?environmentId=…&limit=1) until it has succeeded instead, and send the gateway a request to know what it serves.

url
​string | null · uri · required

The environment's default URL. Null until its first deployment succeeds.

Example: https://acme-api-rate-limit-9f628be.zuplo.app
liveDeploymentId
​string | null · required

The deployment the environment serves, the last one that succeeded. Null until one has.

Example: a3c9e5d1-6b2f-4a8e-b7d4-1f0e9c8b2a65
hasCustomDomain
​boolean · required

Whether a custom domain points at the environment. An environment with one cannot be deleted.

createdOn
​string · date-time · required

When the environment was created.

updatedOn
​string · date-time · required

When the environment last changed.

EnvironmentList

A page of environments.
​Environment[] · required

The environments on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateEnvironmentRequest

A new environment for a Git branch.
branch
​string · minLength: 1 · maxLength: 255 · pattern: ^[^\s~]+$ · required

The Git branch the environment deploys, without refs/heads/. It cannot contain ~ or whitespace, and cannot be changed later.

Example: rate-limits

Deployment

One build of a project's source, rolled out to one environment. Created, then read until its `status` is `succeeded` or `failed`.
id
​string · required

The deployment ID.

Example: a3c9e5d1-6b2f-4a8e-b7d4-1f0e9c8b2a65
projectId
​string · required

The project the deployment belongs to.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
environmentId
​string · required

The environment it deploys to.

Example: 4f8b6c1e-2d7a-4e3b-9c5f-8a1d2e6b7c90
status
​DeploymentStatus · enum · required

Where a deployment is. pending: it waits for its source to be uploaded, or to start. running: it is building and rolling out. succeeded: its environment served it once it was done; the environment's liveDeploymentId says whether it still does. For an AI Gateway, succeeded means the rollout finished, not that every edge serves it yet: an edge may serve the previous version for a while. failed: it did not build or roll out, and its environment kept serving what it served before. succeeded and failed are final. New values may be added.

Enum values:
pending
running
succeeded
failed
​DeploymentSource · required

What a deployment deployed.

createdOn
​string · date-time · required

When the deployment was created.

finishedOn
​string | null · date-time · required

When it succeeded or failed. Null while it is pending or running.

DeploymentWithUpload

A newly created deployment, with where to upload its source when `source.type` is `upload`.
id
​string · required

The deployment ID.

Example: a3c9e5d1-6b2f-4a8e-b7d4-1f0e9c8b2a65
projectId
​string · required

The project the deployment belongs to.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
environmentId
​string · required

The environment it deploys to.

Example: 4f8b6c1e-2d7a-4e3b-9c5f-8a1d2e6b7c90
status
​DeploymentStatus · enum · required

Where a deployment is. pending: it waits for its source to be uploaded, or to start. running: it is building and rolling out. succeeded: its environment served it once it was done; the environment's liveDeploymentId says whether it still does. For an AI Gateway, succeeded means the rollout finished, not that every edge serves it yet: an edge may serve the previous version for a while. failed: it did not build or roll out, and its environment kept serving what it served before. succeeded and failed are final. New values may be added.

Enum values:
pending
running
succeeded
failed
​DeploymentSource · required

What a deployment deployed.

createdOn
​string · date-time · required

When the deployment was created.

finishedOn
​string | null · date-time · required

When it succeeded or failed. Null while it is pending or running.

​required

Where to upload the source, which is shown only once. Null unless source.type is upload.

DeploymentUpload

Where to send a deployment's source: `PUT` a gzipped tar archive of the project to `url` with `headers`, before `expiresOn`. The URL works like a password.
url
​string · uri · required

The signed URL to PUT the archive to. Never send it anywhere else, or log it.

Example: https://storage.googleapis.com/…
​object · required

The headers to send with the PUT, exactly as given. The URL's signature covers them.

expiresOn
​string · date-time · required

When the URL stops working, five minutes after the deployment was created. The deployment fails if the archive has not arrived by then.

DeploymentSource

What a deployment deployed.
type
​DeploymentSourceType · enum · required

What a deployment deployed. git: a push to the project's Git repository. upload: source code uploaded with the CLI or the API. deployment: an earlier deployment of the same environment, deployed again. zuplo: Zuplo deployed it, as it does for an AI Gateway when its provider assignments change. New values may be added.

Enum values:
git
upload
deployment
zuplo
deploymentId
​string | null · required

For deployment, the earlier deployment it deployed again. Null otherwise.

Example: 7e1d4b9a-3c6f-4d2e-8a5b-0f9c2e7d1b34
rebuild
​boolean | null · required

For deployment, whether it built that deployment's source again (true) or deployed its build as it was (false). Null otherwise.

​required

The Git commit it was built from. Null when it was not built from a known commit.

DeploymentCommit

The Git commit a deployment was built from. An upload knows only the `sha` it was sent with.
sha
​string · required

The commit SHA.

Example: 3f9c2a7e1b4d8f6a0c5e9b2d7a1f4c8e6b0d3a5f
message
​string | null · required

The commit message. Null for an upload.

Example: Add rate limits to the orders API
authorName
​string | null · required

The commit's author, as Git records them. Null for an upload.

Example: Jane Doe
committedOn
​string | null · date-time · required

When the commit was made. Null for an upload.

DeploymentList

A page of deployments.
​Deployment[] · required

The deployments on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateDeploymentRequest

A new deployment.
environmentId
​string · maxLength: 64 · required

The project's environment to deploy to.

Example: 4f8b6c1e-2d7a-4e3b-9c5f-8a1d2e6b7c90
​DeploymentSourceInput · required

What to deploy. type says where it comes from.

DeploymentSourceInput

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · type="upload"
type = object · type="deployment" · requires: deploymentId
Properties for Variant 1:
Source code you upload after creating the deployment, to the `upload.url` of the response.
type
​string · const · required

Source code you upload.

Const value: upload
commitSha
​string · minLength: 7 · maxLength: 64 · pattern: ^[0-9a-f]+$

The Git commit the source is from, when you deploy from a Git checkout. The deployment shows it in source.commit.

Example: 3f9c2a7e1b4d8f6a0c5e9b2d7a1f4c8e6b0d3a5f

UploadSourceInput

Source code you upload after creating the deployment, to the `upload.url` of the response.
type
​string · const · required

Source code you upload.

Const value: upload
commitSha
​string · minLength: 7 · maxLength: 64 · pattern: ^[0-9a-f]+$

The Git commit the source is from, when you deploy from a Git checkout. The deployment shows it in source.commit.

Example: 3f9c2a7e1b4d8f6a0c5e9b2d7a1f4c8e6b0d3a5f

RedeploySourceInput

An earlier deployment of the same environment, deployed again.
type
​string · const · required

An earlier deployment.

Const value: deployment
deploymentId
​string · maxLength: 64 · required

The deployment to deploy again. It must be a deployment of the same environment.

Example: 7e1d4b9a-3c6f-4d2e-8a5b-0f9c2e7d1b34
rebuild
​boolean

true builds the deployment's source again. false deploys its build as it is, which is faster and does not change the code that runs. Either way the new deployment gets the environment's current environment variables. Defaults to false.

Default: false

Bucket

The container for the gateway data of one environment type of a project, or a custom bucket created in the account. Everything in a bucket is addressed under `/v4/buckets/{bucketId}`.
id
​string · required

The bucket ID.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
accountId
​string · required

The account the bucket belongs to.

Example: 5f0c7c2e-8d3a-4b1e-9f2a-6c1d0e7b3a49
name
​string · required

A friendly name, unique across Zuplo. Not an identifier; address buckets by id.

Example: contoso-qa
description
​string | null · required

What the bucket is for.

projectId
​string | null · required

The project the bucket belongs to. Null for a custom bucket.

Example: prj_Hn4QzW7cVb2LpX9sTe5RgK1m
​required

The environment type of the project the bucket belongs to. Its environments of that type share it. Null for a custom bucket.

createdOn
​string · date-time · required

When the bucket was created.

updatedOn
​string · date-time · required

When the bucket was last changed.

BucketList

A page of buckets.
​Bucket[] · required

The buckets on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateBucketRequest

A new custom bucket.
name
​string · minLength: 5 · maxLength: 128 · pattern: ^[a-z0-9-]+$ · required

A friendly name, unique across Zuplo, so a name another account uses is a 409. Lowercase letters, digits and hyphens. Names that contain zuplo or start with zup, system or zprj- are reserved for Zuplo and are a 400.

description
​string | null · maxLength: 1024

What the bucket is for.

AccountMember

A person in an account, invited or active.
accountId
​string · required

The account.

Example: 5f0c7c2e-8d3a-4b1e-9f2a-6c1d0e7b3a49
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
​required

The subject their identity provider assigned them, set at their first sign-in. Null while they are invited.

email
​string · email · required

The person's email address. An invited member signs in with it.

name
​string | null · required

The person's display name, if they set one. Null while they are invited.

Example: Jane Doe
role
​AccountRole · enum · required

A person's role in the account. New values may be added.

Enum values:
admin
developer
member
ai-user
status
​AccountMemberStatus · enum · required

Whether a person can use the account yet. invited: they were added and emailed a link, and have not signed in since; their roles take effect when they do. active: they have signed in. New values may be added.

Enum values:
invited
active
invitationExpiresOn
​string | null · date-time · required

When the link in the latest invitation email stops working, seven days after it was sent. Null once the member is active.

createdOn
​string · date-time · required

When the person was added to the account.

AccountMemberList

A page of account members.
​AccountMember[] · required

The account members on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

UpsertAccountMemberRequest

A person to add to the account, by email, or whose account role to change.
email
​string · email · maxLength: 320 · required

The person's email address. Someone new is invited at this address and signs in with it. Compared case-insensitively, without surrounding whitespace.

role
​AccountRoleInput · enum

The account role to give a person. ai-user is a project role, so it is not one: give it on a project. Without role-based access control any value but admin is a 400. New values may be added.

Enum values:
admin
developer
member

AiBudgetRules

The gateway's own budget. A budgetBy: app rule limits the combined traffic of every pool, app and user app. A budgetBy: expression rule gives each distinct value its own budget across the whole gateway, for example each person with request.user.sub. Empty when the gateway has no budget of its own.

A set of limits counted per app, or per value of an expression (for example per end user).
budgetBy
​BudgetBy · enum · required

What one budget is counted for. app: one budget for all the traffic the rule covers, that of an app or everything in a pool or the gateway. expression: one budget per distinct value of expression, for example per end user.

Enum values:
app
expression
expression
​string | null · required

For budgetBy: expression, what to count separately, for example request.user.sub. Null otherwise.

​BudgetLimit[] · required

The limits of this rule.

UpsertAiBudgetRulesRequest

​BudgetRuleInput[] · maxItems: 5

The gateway's budget rules, replacing the ones it has. [] removes them.

A budget rule.
budgetBy
​BudgetBy · enum · required

What one budget is counted for. app: one budget for all the traffic the rule covers, that of an app or everything in a pool or the gateway. expression: one budget per distinct value of expression, for example per end user.

Enum values:
app
expression
​BudgetLimitInput[] · maxItems: 24 · required

The limits. At most one per meter, period and action; a warn value must be below the block value for the same meter and period.

expression
​string | null · maxLength: 512

Required for budgetBy: expression; must be omitted otherwise.

AiProvider

An AI provider the gateway can use: one of Zuplo's built-in providers, or a custom provider defined in the bucket. It holds no key and routes nothing on its own; a provider assignment does.
id
​string · required

The provider ID: a built-in provider's name (Anthropic, BedrockRuntime, …), or a custom provider's ID (aiprov_…).

Example: Anthropic
bucketId
​string | null · required

The bucket that defines the custom provider. Null for a built-in provider.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
type
​ProviderType · enum · required

The kind of upstream provider. Every built-in provider has its own type; custom is a custom provider, any OpenAI-compatible endpoint. zuplo-demo is Zuplo's demo provider. New values may be added.

Enum values:
anthropic
azure-ai
bedrock-mantle
bedrock-runtime
custom
google
mistral
moonshot
builtIn
​boolean · required

Whether this is one of Zuplo's built-in providers, which are read-only. False for a custom provider.

name
​string · required

The provider's display name. It is not a routing prefix; an assignment's label is.

Example: Anthropic
description
​string | null · required

A note for people managing the gateway.

baseUrl
​string | null · uri · required

The upstream endpoint. Null for a built-in provider whose endpoint is set per assignment (bedrock-mantle, azure-ai, vertex-ai).

Example: https://api.anthropic.com
createdOn
​string | null · date-time · required

When the custom provider was defined. Null for a built-in provider.

updatedOn
​string | null · date-time · required

When the custom provider was last changed. Null for a built-in provider.

AiProviderList

A page of AI providers.
​AiProvider[] · required

The providers on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateAiProviderRequest

A new custom AI provider. Its `type` is `custom`.
name
​string · minLength: 1 · maxLength: 128 · required

The provider's display name, unique among the bucket's custom providers.

baseUrl
​string · uri · maxLength: 2048 · required

The OpenAI-compatible endpoint.

​AiCustomModelInput[] · minItems: 1 · maxItems: 100 · required

The models the provider offers, each with its kind and prices.

description
​string | null · maxLength: 1024

A note for people managing the gateway.

UpdateAiProviderRequest

Changes to a custom AI provider (JSON Merge Patch).
name
​string · minLength: 1 · maxLength: 128

The provider's display name, unique among the bucket's custom providers.

description
​string | null · maxLength: 1024

A note for people managing the gateway. Null clears it.

baseUrl
​string · uri · maxLength: 2048

The OpenAI-compatible endpoint.

​AiCustomModelInput[] · minItems: 1 · maxItems: 100

Replaces all of the models the provider offers. Send the complete list.

AiProviderModel

A model a provider offers, and its list price.
id
​string · required

The model ID.

Example: Rz3Kp8VnQ1wT6yLm4sHb9XcF
providerId
​string · required

The provider that offers the model.

Example: Anthropic
name
​string · required

The model's name at the provider, unique per provider. A provider assignment selects the model by this name.

Example: claude-sonnet-4-6
kind
​ModelKind · enum · required

What a model is used for. New values may be added.

Enum values:
completions
embeddings
status
​ModelStatus · enum · required

Whether a model is current or on its way out. New values may be added.

Enum values:
active
deprecated
​AiModelPricing · required

Prices in US dollars per one million tokens. They drive cost metering and cost budgets. Null means the token type is not priced.

AiProviderModelList

A page of a provider's models.
​AiProviderModel[] · required

The models on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

AiModelPricing

Prices in US dollars per one million tokens. They drive cost metering and cost budgets. Null means the token type is not priced.
currency
​string · enum · required

The currency of all prices. Always usd.

Enum values:
usd
inputPerMillionTokens
​number · min: 0 · required

Price of one million input tokens.

Example: 0.15
outputPerMillionTokens
​number · min: 0 · required

Price of one million output tokens.

Example: 0.6
cachedInputPerMillionTokens
​number | null · min: 0 · required

Price of one million input tokens read from the provider's prompt cache.

cacheWritePerMillionTokens
​number | null · min: 0 · required

Price of one million tokens written to the provider's prompt cache (default lifetime).

cacheWrite1hPerMillionTokens
​number | null · min: 0 · required

Price of one million tokens written to the provider's one-hour prompt cache.

AiCustomModelInput

A model a custom provider offers. An omitted `status` is `active`.
name
​string · minLength: 1 · maxLength: 255 · pattern: ^\S+$ · required

The model's name at the provider. Unique per provider.

Example: llama-3.1-70b
kind
​ModelKind · enum · required

What a model is used for. New values may be added.

Enum values:
completions
embeddings
​AiModelPricingInput · required

Prices in US dollars per one million tokens.

status
​ModelStatus · enum

Whether a model is current or on its way out. New values may be added.

Enum values:
active
deprecated

AiModelPricingInput

Prices in US dollars per one million tokens.
inputPerMillionTokens
​number · min: 0 · required

Price of one million input tokens.

outputPerMillionTokens
​number · min: 0 · required

Price of one million output tokens.

cachedInputPerMillionTokens
​number | null · min: 0

Price of one million cached input tokens. Omit or null to leave unpriced.

cacheWritePerMillionTokens
​number | null · min: 0

Price of one million cache-write tokens. Required when cacheWrite1hPerMillionTokens is set.

cacheWrite1hPerMillionTokens
​number | null · min: 0

Price of one million one-hour cache-write tokens.

AiProviderAssignment

A provider the gateway routes to: clients select its models in requests as `<label>/<model>`, policies name them the same way, and the gateway calls the provider with the key in the environment variable `apiKeyEnvironmentVariable` of the bucket's project. The key itself is never stored or returned.
id
​string · required

The provider assignment ID.

Example: aip_6eljoh
bucketId
​string · required

The bucket (gateway) the assignment belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
providerId
​string · required

The provider assigned, a built-in provider's name or a custom provider's ID.

Example: Anthropic
label
​ProviderAssignmentLabel · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9][a-z0-9._-]… · required

A provider assignment's routing prefix, unique in the bucket. Requests and policies name its models <label>/<model name>. It cannot be changed yet: changing it answers 501, because nothing rewrites the policies that name it.

Example: anthropic1
apiKeyEnvironmentVariable
​EnvironmentVariableName · minLength: 1 · maxLength: 255 · pattern: ^[A-Z][A-Z0-9_]*$ · required

The name of an environment variable of the bucket's project that holds the provider's API key. The gateway reads it from the production environment when it calls the provider, so it is not checked on write: while it is missing, requests routed to the assignment fail. Unique among the project's provider assignments.

Example: ANTHROPIC_API_KEY
baseUrl
​string | null · uri · required

The upstream endpoint of this assignment, for providers whose endpoint depends on the account or region (bedrock-mantle, azure-ai, vertex-ai), or to override a custom provider's. Null means the provider's baseUrl.

Example: https://bedrock-mantle.eu-central-1.api.aws
​object | null · required

For azure-ai, the model each Azure deployment serves, keyed by deployment name. Null for other types.

Example: {"gpt4o-prod":"gpt-4o"}
gcpProjectId
​string | null · required

For vertex-ai, the Google Cloud project to bill. Null for other types.

​AiProviderAssignmentModel[] · required

The provider's models the assignment serves, each with the price the gateway meters it at. Only these are routed to it. An assignment made before v4 that selects no model of a kind serves every model of that kind the provider offers, including models added later, and lists them all here; its first change through v4 stores the list it is sent.

createdOn
​string · date-time · required

When the assignment was created.

updatedOn
​string · date-time · required

When the assignment was last changed.

AiProviderAssignmentList

A page of AI provider assignments.
​AiProviderAssignment[] · required

The provider assignments on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

AiProviderAssignmentModel

A model an assignment serves.
name
​string · required

The model's name at the provider, as GET …/ai/providers/{providerId}/models lists it.

Example: claude-sonnet-4-6
ref
​ModelRef · minLength: 3 · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+… · required

A model as policies, fallbacks and load balancing name it, <label>/<model name>: the provider assignment's label, as clients name the model in requests. References a policy stored before v4 are returned as they were written.

Example: anthropic1/claude-sonnet-4-6
kind
​ModelKind · enum · required

What a model is used for. New values may be added.

Enum values:
completions
embeddings
status
​ModelStatus · enum · required

Whether a model is current or on its way out. New values may be added.

Enum values:
active
deprecated
​AiModelPricing · required

Prices in US dollars per one million tokens. They drive cost metering and cost budgets. Null means the token type is not priced.

​required

The prices this assignment negotiated with the provider, which replace the list prices in pricing. Null when it has none, and always for a custom provider's model.

AiNegotiatedPricing

A provider assignment's own prices for a model, in US dollars per one million tokens. Each rate that is set replaces the list rate in cost metering and cost budgets; a null rate is the list rate.
inputPerMillionTokens
​number | null · min: 0 · required

Price of one million input tokens.

outputPerMillionTokens
​number | null · min: 0 · required

Price of one million output tokens.

cachedInputPerMillionTokens
​number | null · min: 0 · required

Price of one million cached input tokens.

cacheWritePerMillionTokens
​number | null · min: 0 · required

Price of one million cache-write tokens.

cacheWrite1hPerMillionTokens
​number | null · min: 0 · required

Price of one million one-hour cache-write tokens.

CreateAiProviderAssignmentRequest

A new AI provider assignment.
providerId
​string · maxLength: 64 · required

The provider to assign, a built-in provider's name or a custom provider's ID.

label
​ProviderAssignmentLabel · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9][a-z0-9._-]… · required

A provider assignment's routing prefix, unique in the bucket. Requests and policies name its models <label>/<model name>. It cannot be changed yet: changing it answers 501, because nothing rewrites the policies that name it.

Example: anthropic1
apiKeyEnvironmentVariable
​EnvironmentVariableName · minLength: 1 · maxLength: 255 · pattern: ^[A-Z][A-Z0-9_]*$ · required

The name of an environment variable of the bucket's project that holds the provider's API key. The gateway reads it from the production environment when it calls the provider, so it is not checked on write: while it is missing, requests routed to the assignment fail. Unique among the project's provider assignments.

Example: ANTHROPIC_API_KEY
​AiProviderAssignmentModelInput[] · minItems: 1 · maxItems: 100 · required

The provider's models the assignment serves, named as GET …/ai/providers/{providerId}/models lists them. A model the provider does not offer is a 400.

baseUrl
​string | null · uri · maxLength: 2048

The upstream endpoint. Required for bedrock-mantle, azure-ai and vertex-ai; for a custom provider, omit it to use the provider's.

​object | null · maxProps: 100

For azure-ai, the model each Azure deployment serves, keyed by deployment name.

gcpProjectId
​string | null · maxLength: 63

For vertex-ai, the Google Cloud project to bill.

UpdateAiProviderAssignmentRequest

Changes to an AI provider assignment (JSON Merge Patch).
label
​ProviderAssignmentLabel · minLength: 1 · maxLength: 64 · pattern: ^[a-z0-9][a-z0-9._-]…

A provider assignment's routing prefix, unique in the bucket. Requests and policies name its models <label>/<model name>. It cannot be changed yet: changing it answers 501, because nothing rewrites the policies that name it.

Example: anthropic1
apiKeyEnvironmentVariable
​EnvironmentVariableName · minLength: 1 · maxLength: 255 · pattern: ^[A-Z][A-Z0-9_]*$

The name of an environment variable of the bucket's project that holds the provider's API key. The gateway reads it from the production environment when it calls the provider, so it is not checked on write: while it is missing, requests routed to the assignment fail. Unique among the project's provider assignments.

Example: ANTHROPIC_API_KEY
baseUrl
​string | null · uri · maxLength: 2048

The upstream endpoint. Null switches back to the provider's.

​object | null · maxProps: 100

For azure-ai, replaces the deployment-to-model map.

gcpProjectId
​string | null · maxLength: 63

For vertex-ai, the Google Cloud project to bill.

​AiProviderAssignmentModelInput[] · minItems: 1 · maxItems: 100

Replaces all of the models the assignment serves. Send the complete list.

AiProviderAssignmentModelInput

A model the assignment serves, and optionally its negotiated prices.
name
​string · minLength: 1 · maxLength: 255 · pattern: ^\S+$ · required

The model's name at the provider, as GET …/ai/providers/{providerId}/models lists it.

Example: claude-sonnet-4-6
​AiNegotiatedPricingInput · minProps: 1

The assignment's own prices for a built-in provider's model, in US dollars per one million tokens. Set only the rates that differ from the list price; the others stay at the list price. Not allowed on a custom provider's model, whose prices are the provider's.

AiNegotiatedPricingInput

The assignment's own prices for a built-in provider's model, in US dollars per one million tokens. Set only the rates that differ from the list price; the others stay at the list price. Not allowed on a custom provider's model, whose prices are the provider's.
inputPerMillionTokens
​number · min: 0

Price of one million input tokens.

outputPerMillionTokens
​number · min: 0

Price of one million output tokens.

cachedInputPerMillionTokens
​number · min: 0

Price of one million cached input tokens.

cacheWritePerMillionTokens
​number · min: 0

Price of one million cache-write tokens.

cacheWrite1hPerMillionTokens
​number · min: 0

Price of one million one-hour cache-write tokens.

BudgetRule

A set of limits counted per app, or per value of an expression (for example per end user).
budgetBy
​BudgetBy · enum · required

What one budget is counted for. app: one budget for all the traffic the rule covers, that of an app or everything in a pool or the gateway. expression: one budget per distinct value of expression, for example per end user.

Enum values:
app
expression
expression
​string | null · required

For budgetBy: expression, what to count separately, for example request.user.sub. Null otherwise.

​BudgetLimit[] · required

The limits of this rule.

BudgetLimit

One limit, for example "block after $500 per month".
meter
​BudgetMeter · enum · required

What a limit measures. cost is in US dollars.

Enum values:
cost
requests
tokens
period
​BudgetPeriod · enum · required

The calendar window (UTC) a limit resets on.

Enum values:
hourly
daily
weekly
monthly
action
​BudgetAction · enum · required

warn records the breach and lets requests through. block rejects requests until the period resets.

Enum values:
warn
block
value
​number · required

The limit, in US dollars for cost, otherwise a count.

Example: 500

BudgetRuleInput

A budget rule.
budgetBy
​BudgetBy · enum · required

What one budget is counted for. app: one budget for all the traffic the rule covers, that of an app or everything in a pool or the gateway. expression: one budget per distinct value of expression, for example per end user.

Enum values:
app
expression
​BudgetLimitInput[] · maxItems: 24 · required

The limits. At most one per meter, period and action; a warn value must be below the block value for the same meter and period.

expression
​string | null · maxLength: 512

Required for budgetBy: expression; must be omitted otherwise.

BudgetLimitInput

One limit.
meter
​BudgetMeter · enum · required

What a limit measures. cost is in US dollars.

Enum values:
cost
requests
tokens
period
​BudgetPeriod · enum · required

The calendar window (UTC) a limit resets on.

Enum values:
hourly
daily
weekly
monthly
action
​BudgetAction · enum · required

warn records the breach and lets requests through. block rejects requests until the period resets.

Enum values:
warn
block
value
​number · required

The limit, in US dollars for cost, otherwise a count.

AiPolicy

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · type="auth" · requires: enabled, authHeader, authScheme +2 more
type = object · type="internal-only" · requires: enabled, status, statusText +1 more
type = object · type="metering" · requires: enabled, budgetRules, failOnError
type = object · type="model-filtering" · requires: enabled, completions, embeddings
type = object · type="model-override" · requires: enabled, completions, embeddings
type = object · type="fallback-model" · requires: enabled, completions, embeddings +1 more
type = object · type="load-balancing" · requires: enabled, strategy, stickyBy +3 more
type = object · type="smart-router" · requires: enabled, classifier, modelsByComplexity +6 more
type = object · type="semantic-cache" · requires: enabled, semanticTolerance, ttlSeconds +4 more
type = object · type="prompt-injection" · requires: enabled, appId, model +8 more
type = object · type="dlp" · requires: enabled, rules, customRules +7 more
type = object · type="akamai-firewall" · requires: enabled, configurationId, applicationId +4 more
type = object · type="opik-tracing" · requires: enabled, workspace, projectName +3 more
type = object · type="galileo-tracing" · requires: enabled, projectId, logStreamId +3 more
type = object · type="custom" · requires: enabled, name
Properties for Variant 1:
Authenticates callers with the app's API keys. It runs first, unless the app runs `internal-only` instead.
type
​string · const · required

The auth policy.

Const value: auth
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

authHeader
​string · required

The request header that carries the API key. Must not be Authorization when credentialPassthrough is on.

authScheme
​string · required

The scheme before the key in authHeader. An empty string means the header holds only the key.

cacheTtlSeconds
​integer · required

How long a key's validation result is cached.

credentialPassthrough
​boolean · required

Forward the caller's Authorization header to the provider as its credential.

AiPolicyInput

oneOf
Exactly one variant must match.

Decision Table

VariantMatching Criteria
type = object · type="auth"
type = object · type="internal-only"
type = object · type="metering"
type = object · type="model-filtering"
type = object · type="model-override"
type = object · type="fallback-model"
type = object · type="load-balancing" · requires: models
type = object · type="smart-router" · requires: classifier, modelsByComplexity
type = object · type="semantic-cache"
type = object · type="prompt-injection"
type = object · type="dlp" · requires: rules
type = object · type="akamai-firewall" · requires: configurationId
type = object · type="opik-tracing" · requires: workspace, projectName
type = object · type="galileo-tracing" · requires: projectId, logStreamId
type = object · type="custom" · requires: name
Properties for Variant 1:
Authenticates callers with the app's API keys. It runs first, unless the app runs `internal-only` instead.
type
​string · const · required

The auth policy.

Const value: auth
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
authHeader
​string · minLength: 1 · maxLength: 128

The request header that carries the API key. Must not be Authorization when credentialPassthrough is on. Defaults to Authorization.

Default: Authorization
authScheme
​string · maxLength: 64 · pattern: ^(\$env\([^)]+\)|[!#…

The scheme before the key in authHeader. An empty string means the header holds only the key. Defaults to Bearer.

Default: Bearer
cacheTtlSeconds
​integer · min: 10 · max: 86400

How long a key's validation result is cached. Defaults to 10.

Default: 10
credentialPassthrough
​boolean

Forward the caller's Authorization header to the provider as its credential. Defaults to false.

Default: false

AiPolicyTemplateEntry

A policy in a pool's template, and what an app may do with its copy.
​AiPolicy · required

One policy in an app's, user app's or template's list. type says which policy it is, and the other properties are its options. New types may be added.

canEdit
​boolean · required

Whether apps may change the policy's options.

canRemove
​boolean · required

Whether apps may remove or disable the policy.

AiPolicyTemplateEntryInput

A policy in a pool's template, and what an app may do with its copy.
​AiPolicyInput · required

One policy. type says which policy it is, and the other properties are its options. A list holds each type at most once, and custom once per name, so a policy sent back without its credential keeps the stored one.

canEdit
​boolean

Whether apps may change the policy's options. Defaults to false.

Default: false
canRemove
​boolean

Whether apps may remove or disable the policy. Defaults to false.

Default: false

AiAuthPolicy

Authenticates callers with the app's API keys. It runs first, unless the app runs `internal-only` instead.
type
​string · const · required

The auth policy.

Const value: auth
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

authHeader
​string · required

The request header that carries the API key. Must not be Authorization when credentialPassthrough is on.

authScheme
​string · required

The scheme before the key in authHeader. An empty string means the header holds only the key.

cacheTtlSeconds
​integer · required

How long a key's validation result is cached.

credentialPassthrough
​boolean · required

Forward the caller's Authorization header to the provider as its credential.

AiAuthPolicyInput

Authenticates callers with the app's API keys. It runs first, unless the app runs `internal-only` instead.
type
​string · const · required

The auth policy.

Const value: auth
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
authHeader
​string · minLength: 1 · maxLength: 128

The request header that carries the API key. Must not be Authorization when credentialPassthrough is on. Defaults to Authorization.

Default: Authorization
authScheme
​string · maxLength: 64 · pattern: ^(\$env\([^)]+\)|[!#…

The scheme before the key in authHeader. An empty string means the header holds only the key. Defaults to Bearer.

Default: Bearer
cacheTtlSeconds
​integer · min: 10 · max: 86400

How long a key's validation result is cached. Defaults to 10.

Default: 10
credentialPassthrough
​boolean

Forward the caller's Authorization header to the provider as its credential. Defaults to false.

Default: false

AiInternalOnlyPolicy

Accepts only calls from inside the gateway, such as a smart router's classifier call, and rejects every request from outside. Used instead of `auth` on apps that serve other policies.
type
​string · const · required

The internal-only policy.

Const value: internal-only
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

status
​integer · required

The status code returned to a request from outside the gateway.

statusText
​string | null · required

The status text of a rejected request. Null for the standard text of status.

detail
​string | null · required

The detail of a rejected request's problem response. Null when the response has no detail.

AiInternalOnlyPolicyInput

Accepts only calls from inside the gateway, such as a smart router's classifier call, and rejects every request from outside. Used instead of `auth` on apps that serve other policies.
type
​string · const · required

The internal-only policy.

Const value: internal-only
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
status
​integer · min: 400 · max: 499

The status code returned to a request from outside the gateway. Defaults to 403.

Default: 403
statusText
​string · minLength: 1 · maxLength: 128

The status text of a rejected request.

detail
​string · minLength: 1 · maxLength: 512

The detail of a rejected request's problem response.

AiMeteringPolicy

Meters usage and cost, and enforces budget rules.
type
​string · const · required

The metering policy.

Const value: metering
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​BudgetRule[] · required

Budgets counted for all of the app's traffic, or per value of an expression (for example per person). The budgets of pools and of the gateway apply as well.

failOnError
​boolean · required

Reject a request when its usage cannot be recorded, instead of logging the error.

AiMeteringPolicyInput

Meters usage and cost, and enforces budget rules.
type
​string · const · required

The metering policy.

Const value: metering
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
​BudgetRuleInput[] · maxItems: 5

Budgets counted for all of the app's traffic, or per value of an expression (for example per person). The budgets of pools and of the gateway apply as well. Defaults to [].

Default: []
failOnError
​boolean

Reject a request when its usage cannot be recorded, instead of logging the error. Defaults to false.

Default: false

AiModelFilteringPolicy

Restricts the models clients may select.
type
​string · const · required

The model-filtering policy.

Const value: model-filtering
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​required

Filtering for chat completions, Responses and Anthropic Messages requests. Null when they are not filtered.

​required

Filtering for embeddings requests. Null when they are not filtered.

AiModelFilteringPolicyInput

Restricts the models clients may select.
type
​string · const · required

The model-filtering policy.

Const value: model-filtering
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
​AiModelFilterInput

The models clients may select for one capability: exactly one of allowList and blockList is set.

​AiModelFilterInput

The models clients may select for one capability: exactly one of allowList and blockList is set.

AiModelOverridePolicy

Sets the model used when a request names none, or forces one model.
type
​string · const · required

The model-override policy.

Const value: model-override
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​required

The override for chat completions, Responses and Anthropic Messages requests. Null when they are not overridden.

​required

The override for embeddings requests. Null when they are not overridden.

AiModelOverridePolicyInput

Sets the model used when a request names none, or forces one model.
type
​string · const · required

The model-override policy.

Const value: model-override
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
​AiModelOverrideInput

The model override for one capability: exactly one of default and force is set.

The model override for one capability: exactly one of default and force is set.

AiFallbackModelPolicy

Retries a failed request on a fallback model, and switches to a quota fallback once a budget is exhausted.
type
​string · const · required

The fallback-model policy.

Const value: fallback-model
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​required

Fallbacks for chat completions, Responses and Anthropic Messages requests. Null when they have none.

​required

Fallbacks for embeddings requests. Null when they have none.

fallbackTimeoutSeconds
​integer · required

How long to wait for the model's response headers before trying fallback.

AiFallbackModelPolicyInput

Retries a failed request on a fallback model, and switches to a quota fallback once a budget is exhausted.
type
​string · const · required

The fallback-model policy.

Const value: fallback-model
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
​AiModelFallbackInput

Fallback models for one capability. Set at least one.

Fallback models for one capability. Set at least one.

fallbackTimeoutSeconds
​integer · min: 1 · max: 300

How long to wait for the model's response headers before trying fallback. Defaults to 60.

Default: 60

AiLoadBalancingPolicy

Spreads requests across several models.
type
​string · const · required

The load-balancing policy.

Const value: load-balancing
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

strategy
​string · enum · required

How a model is picked for each request. round-robin cycles through the models, and sticky sends requests with the same key to the same model.

Enum values:
round-robin
sticky
stickyBy
​string | null · enum · required

What sticky keys on. user is the caller (request.user.sub), conversation the conversation's first messages, and expression the value of expression. Null for round-robin.

Enum values:
user
conversation
expression
expression
​string | null · required

For stickyBy: expression, the value to key on, for example request.headers.get("x-end-user-id"). Null otherwise.

​AiLoadBalancingModels · required

The models to spread requests across, by capability. Set at least one list.

fallbackTimeoutSeconds
​integer · required

How long to wait for a model to respond before retrying on another.

AiLoadBalancingPolicyInput

Spreads requests across several models.
type
​string · const · required

The load-balancing policy.

Const value: load-balancing
​AiLoadBalancingModelsInput · required

The models to spread requests across, by capability. Set at least one list.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
strategy
​string · enum

How a model is picked for each request. round-robin cycles through the models, and sticky sends requests with the same key to the same model. Defaults to round-robin.

Enum values:
round-robin
sticky
Default: round-robin
stickyBy
​string · enum

What sticky keys on. user is the caller (request.user.sub), conversation the conversation's first messages, and expression the value of expression.

Enum values:
user
conversation
expression
expression
​string · minLength: 1 · maxLength: 512

For stickyBy: expression, the value to key on, for example request.headers.get("x-end-user-id").

fallbackTimeoutSeconds
​integer · min: 1 · max: 300

How long to wait for a model to respond before retrying on another. Defaults to 60.

Default: 60

AiSmartRouterPolicy

Classifies each prompt with another app and routes it to a model by its complexity.
type
​string · const · required

The smart-router policy.

Const value: smart-router
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​AiSmartRouterClassifier · required

The AI Gateway app that classifies prompts. The call runs inside the gateway.

​AiModelsByComplexity · required

The model used for each complexity the classifier assigns.

routingEnabled
​boolean · required

Route by the classification. When off, prompts are still classified but not rerouted, to test the classifier.

​array | null · required

The intents the classifier chooses from. Null for the built-in list (code, summarization, translation, qa, …).

classifierPrompt
​string | null · required

The system prompt sent to the classifier. Not used with the system-one dialect. Null for the built-in prompt.

minConfidenceForRouting
​number · required

The confidence, from 0 to 1, a classification needs before it reroutes a request.

classifierTimeoutMs
​integer · required

How long to wait for the classifier, in milliseconds, before forwarding the request unclassified.

maxPromptChars
​integer · required

How many characters of the prompt are sent to the classifier.

AiSmartRouterPolicyInput

Classifies each prompt with another app and routes it to a model by its complexity.
type
​string · const · required

The smart-router policy.

Const value: smart-router
​AiSmartRouterClassifierInput · required

The AI Gateway app that classifies prompts. The call runs inside the gateway.

​AiModelsByComplexityInput · required

The model used for each complexity the classifier assigns.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
routingEnabled
​boolean

Route by the classification. When off, prompts are still classified but not rerouted, to test the classifier. Defaults to true.

Default: true
​AiSmartRouterIntentInput[] · minItems: 1 · maxItems: 50

The intents the classifier chooses from.

classifierPrompt
​string · minLength: 1 · maxLength: 16384

The system prompt sent to the classifier. Not used with the system-one dialect.

minConfidenceForRouting
​number · min: 0 · max: 1

The confidence, from 0 to 1, a classification needs before it reroutes a request. Defaults to 0.5.

Default: 0.5
classifierTimeoutMs
​integer · min: 1 · max: 120000

How long to wait for the classifier, in milliseconds, before forwarding the request unclassified. Defaults to 8000.

Default: 8000
maxPromptChars
​integer · min: 1 · max: 1000000

How many characters of the prompt are sent to the classifier. Defaults to 8000.

Default: 8000

AiSemanticCachePolicy

Answers a request from the cache when a similar prompt was answered before.
type
​string · const · required

The semantic-cache policy.

Const value: semantic-cache
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

semanticTolerance
​number · required

How similar a prompt must be to match: closer to 0 requires closer similarity.

ttlSeconds
​integer · required

How long a cached response is kept.

recentMessageCount
​integer · required

How many of the conversation's latest messages form the cache key. System messages always count.

maxConversationLength
​integer | null · required

Skip the cache for conversations with more messages than this. Null for no limit.

namespace
​string | null · required

Partitions the cache for callers that are not an app. Apps always have a cache of their own. Null when not set.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages

AiSemanticCachePolicyInput

Answers a request from the cache when a similar prompt was answered before.
type
​string · const · required

The semantic-cache policy.

Const value: semantic-cache
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
semanticTolerance
​number · min: 0 · max: 1

How similar a prompt must be to match: closer to 0 requires closer similarity. Defaults to 0.2.

Default: 0.2
ttlSeconds
​integer · min: 1 · max: 2592000

How long a cached response is kept. Defaults to 3600.

Default: 3600
recentMessageCount
​integer · min: 1 · max: 1000

How many of the conversation's latest messages form the cache key. System messages always count. Defaults to 1.

Default: 1
maxConversationLength
​integer · min: 1 · max: 10000

Skip the cache for conversations with more messages than this.

namespace
​string · minLength: 1 · maxLength: 128

Partitions the cache for callers that are not an app. Apps always have a cache of their own.

endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages

AiPromptInjectionPolicy

Rejects requests that a classifier model finds to be prompt injections.
type
​string · const · required

The prompt-injection policy.

Const value: prompt-injection
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

appId
​string | null · required

Run the classifier on this AI Gateway app, inside the gateway. model must then be a model it routes, and baseUrl must not be set. Null when an external API at baseUrl is called.

model
​string · required

The tool-calling model that classifies prompts. With appId, a model reference (openai1/gpt-4o-mini).

baseUrl
​string | null · required

The OpenAI-compatible API that runs the classifier, when appId is not set. Null with appId, or for https://api.openai.com/v1.

execution
​string · enum · required

Whether the classifier runs before the rest of the policies or alongside them. sequential classifies before the next policy runs; parallel classifies while the other policies run, still before the request reaches the model.

Enum values:
sequential
parallel
recentMessageCount
​integer · required

How many of the conversation's latest messages are classified.

classifierPrompt
​string | null · required

Replaces the built-in system prompt that says what counts as a prompt injection. Null for the built-in prompt.

timeoutMs
​integer · required

How long to wait for the classifier, in milliseconds, before onError applies.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum · required

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked.

Enum values:
deny
skip
onError
​string · enum · required

What happens when the classifier call fails, for example on an invalid API key, a timeout or an outage. block rejects the request, and allow lets it through.

Enum values:
block
allow

AiPromptInjectionPolicyInput

Rejects requests that a classifier model finds to be prompt injections.
type
​string · const · required

The prompt-injection policy.

Const value: prompt-injection
enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
appId
​string · maxLength: 64

Run the classifier on this AI Gateway app, inside the gateway. model must then be a model it routes, and baseUrl must not be set.

model
​string · minLength: 1 · maxLength: 255

The tool-calling model that classifies prompts. With appId, a model reference (openai1/gpt-4o-mini). Defaults to gpt-4o-mini.

Default: gpt-4o-mini
baseUrl
​string · maxLength: 2048

The OpenAI-compatible API that runs the classifier, when appId is not set.

apiKey
​string · minLength: 1 · maxLength: 8192 · writeOnly

The classifier's credential: the key for baseUrl, or with appId an API key of that app (omit it when the app runs internal-only). Write-only: it is never returned, and omitting it keeps the stored value.

execution
​string · enum

Whether the classifier runs before the rest of the policies or alongside them. sequential classifies before the next policy runs; parallel classifies while the other policies run, still before the request reaches the model. Defaults to sequential.

Enum values:
sequential
parallel
Default: sequential
recentMessageCount
​integer · min: 1 · max: 1000

How many of the conversation's latest messages are classified. Defaults to 1.

Default: 1
classifierPrompt
​string · minLength: 1 · maxLength: 16384

Replaces the built-in system prompt that says what counts as a prompt injection.

timeoutMs
​integer · min: 100 · max: 60000

How long to wait for the classifier, in milliseconds, before onError applies. Defaults to 10000.

Default: 10000
endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked. Defaults to deny.

Enum values:
deny
skip
Default: deny
onError
​string · enum

What happens when the classifier call fails, for example on an invalid API key, a timeout or an outage. block rejects the request, and allow lets it through. Defaults to block.

Enum values:
block
allow
Default: block

AiDlpPolicy

Data loss prevention: finds personal data and secrets in requests and responses, and masks, blocks or logs them.
type
​string · const · required

The dlp policy.

Const value: dlp
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

​AiDlpRules · required

What the policy scans for, by direction. Each direction that is set is scanned; at least one must enable a rule.

​AiDlpCustomRule[] · required

Detectors of your own.

allowValues
​string[] · required

Exact values that are never flagged, such as documented test card numbers.

detection
​string · enum · required

How much evidence a match needs, for rules that do not set their own. corroborated also needs a context word near the match, standard is tuned per type, and aggressive counts every pattern match.

Enum values:
corroborated
standard
aggressive
scanToolArguments
​boolean · required

Also scan tool-call arguments.

​AiDlpStreaming · required

How streaming responses are scanned.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum · required

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked.

Enum values:
deny
skip
onError
​string · enum · required

What happens when the scanner itself fails. block rejects the request, and allow lets it through.

Enum values:
block
allow

AiDlpPolicyInput

Data loss prevention: finds personal data and secrets in requests and responses, and masks, blocks or logs them.
type
​string · const · required

The dlp policy.

Const value: dlp
​AiDlpRulesInput · required

What the policy scans for, by direction. Each direction that is set is scanned; at least one must enable a rule.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
​AiDlpCustomRuleInput[] · maxItems: 50

Detectors of your own. Defaults to [].

Default: []
allowValues
​string[] · maxItems: 200

Exact values that are never flagged, such as documented test card numbers. Defaults to [].

Default: []
detection
​string · enum

How much evidence a match needs, for rules that do not set their own. corroborated also needs a context word near the match, standard is tuned per type, and aggressive counts every pattern match. Defaults to standard.

Enum values:
corroborated
standard
aggressive
Default: standard
scanToolArguments
​boolean

Also scan tool-call arguments. Defaults to true.

Default: true

How streaming responses are scanned.

endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked. Defaults to deny.

Enum values:
deny
skip
Default: deny
onError
​string · enum

What happens when the scanner itself fails. block rejects the request, and allow lets it through. Defaults to block.

Enum values:
block
allow
Default: block

AiAkamaiFirewallPolicy

Checks requests and responses with Akamai's AI firewall.
type
​string · const · required

The akamai-firewall policy.

Const value: akamai-firewall
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

configurationId
​string · required

The AI firewall configuration to use.

applicationId
​string | null · required

Identifies this usage of the firewall. Null when not set.

​AiAkamaiStreamingAccumulation · required

How streaming responses are checked.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum · required

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked.

Enum values:
deny
skip
onError
​string · enum · required

What happens when the firewall check itself fails, for example on an invalid API key or an outage. block rejects the request, and allow lets it through.

Enum values:
block
allow

AiAkamaiFirewallPolicyInput

Checks requests and responses with Akamai's AI firewall.
type
​string · const · required

The akamai-firewall policy.

Const value: akamai-firewall
configurationId
​string · minLength: 1 · maxLength: 255 · required

The AI firewall configuration to use.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
applicationId
​string · minLength: 1 · maxLength: 255

Identifies this usage of the firewall.

apiKey
​string · minLength: 1 · maxLength: 8192 · writeOnly

The firewall's API key. Required when the policy is added. Write-only: it is never returned, and omitting it keeps the stored value.

​AiAkamaiStreamingAccumulationInput

How streaming responses are checked.

endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked. Defaults to deny.

Enum values:
deny
skip
Default: deny
onError
​string · enum

What happens when the firewall check itself fails, for example on an invalid API key or an outage. block rejects the request, and allow lets it through. Defaults to block.

Enum values:
block
allow
Default: block

AiOpikTracingPolicy

Sends requests and responses to Comet Opik for LLM observability.
type
​string · const · required

The opik-tracing policy.

Const value: opik-tracing
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

workspace
​string · required

The Opik workspace.

projectName
​string · required

The Opik project that traces are filed under.

baseUrl
​string | null · required

The Opik API. Null for https://www.comet.com/opik/api.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum · required

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked.

Enum values:
deny
skip

AiOpikTracingPolicyInput

Sends requests and responses to Comet Opik for LLM observability.
type
​string · const · required

The opik-tracing policy.

Const value: opik-tracing
workspace
​string · minLength: 1 · maxLength: 255 · required

The Opik workspace.

projectName
​string · minLength: 1 · maxLength: 255 · required

The Opik project that traces are filed under.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
baseUrl
​string · maxLength: 2048

The Opik API.

apiKey
​string · minLength: 1 · maxLength: 8192 · writeOnly

The Opik API key. Required when the policy is added. Write-only: it is never returned, and omitting it keeps the stored value.

endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked. Defaults to skip.

Enum values:
deny
skip
Default: skip

AiGalileoTracingPolicy

Sends requests and responses to Galileo for LLM observability.
type
​string · const · required

The galileo-tracing policy.

Const value: galileo-tracing
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

projectId
​string · required

The Galileo project that traces are filed under.

logStreamId
​string · required

The Galileo log stream.

baseUrl
​string | null · required

The Galileo API. Null for https://api.galileo.ai.

endpoints
​AiEndpointShape[] · required

The request shapes the policy applies to.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum · required

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked.

Enum values:
deny
skip

AiGalileoTracingPolicyInput

Sends requests and responses to Galileo for LLM observability.
type
​string · const · required

The galileo-tracing policy.

Const value: galileo-tracing
projectId
​string · minLength: 1 · maxLength: 64 · required

The Galileo project that traces are filed under.

logStreamId
​string · minLength: 1 · maxLength: 64 · required

The Galileo log stream.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true
baseUrl
​string · maxLength: 2048

The Galileo API.

apiKey
​string · minLength: 1 · maxLength: 8192 · writeOnly

The Galileo API key. Required when the policy is added. Write-only: it is never returned, and omitting it keeps the stored value.

endpoints
​AiEndpointShape[] · minItems: 1 · maxItems: 3

The request shapes the policy applies to. Defaults to all of them.

Enum values:
openai-chat
openai-responses
anthropic-messages
onUnknownShape
​string · enum

What happens to a request whose shape the policy cannot inspect. deny rejects the request, and skip lets it through unchecked. Defaults to skip.

Enum values:
deny
skip
Default: skip

AiCustomPolicy

A policy declared in the project's `config/policies.json`, such as custom code. Its options are part of that declaration; options set on the entry itself outside v4 are kept and not shown.
type
​string · const · required

The custom policy.

Const value: custom
enabled
​boolean · required

Whether the policy runs. A disabled policy keeps its place and options.

name
​string · required

The policy's name in config/policies.json.

Example: check-tenant-inbound

AiCustomPolicyInput

A policy declared in the project's `config/policies.json`, such as custom code. Its options are part of that declaration; options set on the entry itself outside v4 are kept and not shown.
type
​string · const · required

The custom policy.

Const value: custom
name
​string · minLength: 1 · maxLength: 128 · required

The policy's name in config/policies.json.

enabled
​boolean

Whether the policy runs. A disabled policy keeps its place and options. Defaults to true.

Default: true

AiModelFilter

The models clients may select for one capability: exactly one of `allowList` and `blockList` is set.
allowList
​array | null · required

The only models clients may select. The first is used when a request names no model. Null when blockList is set.

blockList
​array | null · required

Models clients may not select. Every other model on the gateway is allowed. Null when allowList is set.

AiModelFilterInput

The models clients may select for one capability: exactly one of `allowList` and `blockList` is set.
allowList
​ModelRef[] · minItems: 1 · maxItems: 100

The only models clients may select. The first is used when a request names no model.

blockList
​ModelRef[] · minItems: 1 · maxItems: 100

Models clients may not select. Every other model on the gateway is allowed.

AiModelOverride

The model override for one capability: exactly one of `default` and `force` is set.
default
​string | null · required

The model used when a request names none. Null when force is set.

Example: openai1/gpt-4o-mini
force
​string | null · required

The model every request uses, whatever it asks for. Null when default is set.

Example: openai1/gpt-4o-mini

AiModelOverrideInput

The model override for one capability: exactly one of `default` and `force` is set.
default
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+…

The model used when a request names none.

force
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+…

The model every request uses, whatever it asks for.

AiModelFallback

Fallback models for one capability. Set at least one.
fallback
​string | null · required

The model tried after a retryable error or a timeout. Null when not set.

Example: openai1/gpt-4o-mini
quotaFallback
​string | null · required

The model used once a budget with action block is exhausted. Null when not set.

Example: openai1/gpt-4o-mini

AiModelFallbackInput

Fallback models for one capability. Set at least one.
fallback
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+…

The model tried after a retryable error or a timeout.

quotaFallback
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+…

The model used once a budget with action block is exhausted.

AiLoadBalancingModels

The models to spread requests across, by capability. Set at least one list.
completions
​array | null · required

Models for chat completions, Responses and Anthropic Messages requests, each listed once. Null when completions are not balanced.

embeddings
​array | null · required

Models for embeddings requests, each listed once. Null when embeddings are not balanced.

AiLoadBalancingModelsInput

The models to spread requests across, by capability. Set at least one list.
completions
​ModelRef[] · minItems: 1 · maxItems: 32

Models for chat completions, Responses and Anthropic Messages requests, each listed once.

embeddings
​ModelRef[] · minItems: 1 · maxItems: 32

Models for embeddings requests, each listed once.

AiSmartRouterClassifier

The AI Gateway app that classifies prompts. The call runs inside the gateway.
appId
​string · required

The app that runs the classifier. It must not be this app, and must not run a smart router itself.

Example: config_Kx7gDiGsr1c2tOOUW5kpmXZn
model
​string · required

The model the classifier app uses, a model reference (<label>/<model name>).

Example: openai1/gpt-4o-mini
dialect
​string · enum · required

The API the classifier app is called with. chat-completions and messages (Anthropic Messages) send a prompt; system-one is for classification models such as Jev.

Enum values:
chat-completions
messages
system-one

AiSmartRouterClassifierInput

The AI Gateway app that classifies prompts. The call runs inside the gateway.
appId
​string · maxLength: 64 · required

The app that runs the classifier. It must not be this app, and must not run a smart router itself.

model
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+… · required

The model the classifier app uses, a model reference (<label>/<model name>).

dialect
​string · enum

The API the classifier app is called with. chat-completions and messages (Anthropic Messages) send a prompt; system-one is for classification models such as Jev. Defaults to chat-completions.

Enum values:
chat-completions
messages
system-one
Default: chat-completions
apiKey
​string · minLength: 1 · maxLength: 8192 · writeOnly

An API key of the classifier app, sent as Authorization: Bearer. Omit it when that app runs the internal-only policy. Write-only: it is never returned, and omitting it keeps the stored value.

AiModelsByComplexity

The model used for each complexity the classifier assigns.
low
​string · required

The model for low-complexity prompts.

Example: openai1/gpt-4o-mini
medium
​string · required

The model for medium-complexity prompts.

Example: openai1/gpt-4o-mini
high
​string · required

The model for high-complexity prompts.

Example: openai1/gpt-4o-mini

AiModelsByComplexityInput

The model used for each complexity the classifier assigns.
low
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+… · required

The model for low-complexity prompts.

medium
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+… · required

The model for medium-complexity prompts.

high
​string · maxLength: 255 · pattern: ^[A-Za-z0-9._-]+/\S+… · required

The model for high-complexity prompts.

AiSmartRouterIntent

An intent the classifier can assign to a prompt.
name
​string · required

The intent's label, for example code.

description
​string · required

What prompts with this intent are about.

AiSmartRouterIntentInput

An intent the classifier can assign to a prompt.
name
​string · minLength: 1 · maxLength: 64 · required

The intent's label, for example code.

description
​string · maxLength: 512 · required

What prompts with this intent are about.

AiDlpRules

What the policy scans for, by direction. Each direction that is set is scanned; at least one must enable a rule.
​object | null · required

What callers send the model (system prompt, messages and tool-call arguments). Keyed by a data type (id-us-ssn), a group (pii, secret-aws) or a custom rule's name. The most specific key wins. Null when requests are not scanned.

​object | null · required

What the model sends back, keyed like inbound. Null when responses are not scanned.

AiDlpRulesInput

What the policy scans for, by direction. Each direction that is set is scanned; at least one must enable a rule.
​object · maxProps: 200

What callers send the model (system prompt, messages and tool-call arguments). Keyed by a data type (id-us-ssn), a group (pii, secret-aws) or a custom rule's name. The most specific key wins.

​object · maxProps: 200

What the model sends back, keyed like inbound.

AiDlpRule

What happens when one data type, group or custom rule matches.
action
​string · enum · required

What happens on a match. mask replaces the value, block rejects the request or ends the response, log only records the match, and off excludes the type from a broader rule.

Enum values:
mask
block
log
off
detection
​string | null · enum · required

How much evidence a match needs. Overrides the policy's detection. corroborated also needs a context word near the match, standard is tuned per type, and aggressive counts every pattern match. Null when the policy's detection applies.

Enum values:
corroborated
standard
aggressive
mask
​string · required

The replacement for masked text. {type} inserts the detected type.

maskKeepLast
​integer | null · required

Keep this many trailing characters of a masked value and replace the rest with *, for example for the last four digits of a card. Null when the whole value is masked.

AiDlpRuleInput

What happens when one data type, group or custom rule matches.
action
​string · enum · required

What happens on a match. mask replaces the value, block rejects the request or ends the response, log only records the match, and off excludes the type from a broader rule.

Enum values:
mask
block
log
off
detection
​string · enum

How much evidence a match needs. Overrides the policy's detection. corroborated also needs a context word near the match, standard is tuned per type, and aggressive counts every pattern match.

Enum values:
corroborated
standard
aggressive
mask
​string · maxLength: 128

The replacement for masked text. {type} inserts the detected type. Defaults to [{type}].

Default: [{type}]
maskKeepLast
​integer · min: 1 · max: 8

Keep this many trailing characters of a masked value and replace the rest with *, for example for the last four digits of a card.

AiDlpCustomRule

A detector of your own. It acts only when a key in `rules` names it.
name
​string · required

The detector's name, used as its key in rules.

pattern
​string · required

A JavaScript regular expression source.

context
​string[] · required

Words that must appear near a match for corroborated detection.

AiDlpCustomRuleInput

A detector of your own. It acts only when a key in `rules` names it.
name
​string · minLength: 1 · maxLength: 64 · required

The detector's name, used as its key in rules.

pattern
​string · minLength: 1 · maxLength: 1024 · required

A JavaScript regular expression source.

context
​string[] · maxItems: 50

Words that must appear near a match for corroborated detection. Defaults to [].

Default: []

AiDlpStreaming

How streaming responses are scanned.
mode
​string · enum · required

How streaming responses are scanned. stream scans chunks as they flow, buffer scans the whole response once, and off does not scan streams.

Enum values:
stream
buffer
off
boundaryScan
​boolean · required

Scan across chunk boundaries, so a value split over two chunks is still found.

maxCarryChars
​integer · required

How many trailing characters of a chunk are carried into the next boundary scan.

AiDlpStreamingInput

How streaming responses are scanned.
mode
​string · enum

How streaming responses are scanned. stream scans chunks as they flow, buffer scans the whole response once, and off does not scan streams. Defaults to stream.

Enum values:
stream
buffer
off
Default: stream
boundaryScan
​boolean

Scan across chunk boundaries, so a value split over two chunks is still found. Defaults to true.

Default: true
maxCarryChars
​integer · min: 32 · max: 4096

How many trailing characters of a chunk are carried into the next boundary scan. Defaults to 512.

Default: 512

AiAkamaiStreamingAccumulation

How streaming responses are checked.
enabled
​boolean · required

Accumulate and check streaming responses.

eventsInterval
​integer · required

How many events are accumulated before each check.

checkIntervalMs
​integer | null · required

Check on this interval, in milliseconds, instead of by event count. Null when checks go by event count.

AiAkamaiStreamingAccumulationInput

How streaming responses are checked.
enabled
​boolean

Accumulate and check streaming responses. Defaults to true.

Default: true
eventsInterval
​integer · min: 1 · max: 100

How many events are accumulated before each check. Defaults to 5.

Default: 5
checkIntervalMs
​integer · min: 100 · max: 10000

Check on this interval, in milliseconds, instead of by event count.

AiEndpointShape

string · enum
Enum values:
openai-chat
openai-responses
anthropic-messages

A request shape a policy can inspect. New values may be added.

AiPool

A group of apps that share a budget, a policy template and people.
id
​string · required

The pool ID.

Example: config_IM1F8Z4rUT6rDPhabvfnrt27
bucketId
​string · required

The bucket (gateway) the pool belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
parentPoolId
​string | null · required

The parent pool, or null for a top-level pool.

name
​string · required

The pool's display name.

Example: Engineering
​BudgetRule[] · required

The pool's own budget. A budgetBy: app rule limits the combined traffic of every app in the pool and its sub-pools. The budgets of the apps, the parent pools and the gateway apply as well.

​AiPolicyTemplateEntry[] · required

The policies a new app in the pool starts with, in order, and what the app may do with each. An app gets a copy when it is created: changing the template does not change existing apps. Empty while inheritPolicyTemplate is true.

inheritPolicyTemplate
​boolean · required

When true, the pool uses the template of its nearest ancestor that has its own. Always false for top-level pools.

createdOn
​string · date-time · required

When the pool was created.

updatedOn
​string · date-time · required

When the pool was last changed.

AiPoolList

A page of pools.
​AiPool[] · required

The pools on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateAiPoolRequest

A new pool.
name
​string · minLength: 1 · maxLength: 128 · required

The pool's display name.

parentPoolId
​string | null · maxLength: 64

Create the pool as a sub-pool of this pool. Omit for a top-level pool. Cannot be changed later.

​BudgetRuleInput[] · maxItems: 5

The pool's own budget, for the combined traffic of its apps and sub-pools.

​AiPolicyTemplateEntryInput[] · maxItems: 30

The policies new apps in the pool start with, in order. Omit it on a top-level pool to start with auth, which apps can neither change nor remove.

inheritPolicyTemplate
​boolean

Use the template of the nearest ancestor that has its own. Only allowed on sub-pools, and defaults to true for them when policyTemplate is omitted.

UpdateAiPoolRequest

Changes to a pool (JSON Merge Patch).
name
​string · minLength: 1 · maxLength: 128

The pool's display name.

​BudgetRuleInput[] · maxItems: 5

Replaces all of the pool's budget rules.

​AiPolicyTemplateEntryInput[] · maxItems: 30

Replaces the pool's policy template. Existing apps keep their policies.

inheritPolicyTemplate
​boolean

Use the template of the nearest ancestor that has its own. Only allowed on sub-pools.

AiPoolMember

A person's access to a pool, either assigned on the pool or inherited from an ancestor pool.
poolId
​string · required

The pool.

Example: config_IM1F8Z4rUT6rDPhabvfnrt27
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
email
​string · email · required

The person's email address.

name
​string | null · required

The person's display name, if they set one.

role
​string | null · enum · required

The role assigned on this pool, or null if the person only inherits access.

Enum values:
admin
member
inheritedRole
​string | null · enum · required

The highest role inherited from an ancestor pool, or null.

Enum values:
admin
member
effectiveRole
​PoolRole · enum · required

A role on a pool. admin manages the pool, its apps and members; member can view the pool and use its apps. Neither creates, links, changes or rolls the consumers of the pool's apps, which people who manage the bucket's consumers do; both read them.

Enum values:
admin
member

AiPoolMemberList

A page of pool members.
​AiPoolMember[] · required

The pool members on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

UpsertAiPoolMemberRequest

The person and the role to give them on this pool.
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
role
​PoolRole · enum · required

A role on a pool. admin manages the pool, its apps and members; member can view the pool and use its apps. Neither creates, links, changes or rolls the consumers of the pool's apps, which people who manage the bucket's consumers do; both read them.

Enum values:
admin
member

AiAppConsumer

The link between an app and a consumer in its bucket. The consumer's keys call the app.
appId
​string · required

The app.

Example: config_Kx7gDiGsr1c2tOOUW5kpmXZn
consumerId
​string · required

The consumer.

Example: csmr_brw0leTAVw478VFKD4F6OqVI
createdOn
​string · date-time · required

When the consumer was linked to the app.

UpsertAiAppConsumerRequest

The consumer to link to the app.
consumerId
​string · maxLength: 64 · required

A consumer in the app's bucket. It cannot be a person's consumer or one another app holds.

Example: csmr_brw0leTAVw478VFKD4F6OqVI

AiApp

One client of the AI Gateway, with its own keys and policies.
id
​string · required

The app ID.

Example: config_Kx7gDiGsr1c2tOOUW5kpmXZn
bucketId
​string · required

The bucket (gateway) the app belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
poolId
​string · required

The pool the app belongs to.

Example: config_IM1F8Z4rUT6rDPhabvfnrt27
name
​string · required

The app's display name.

Example: Support bot
baseUrl
​string | null · uri · required

Where 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.

Example: https://acme-ai-gateway-main-b8e2f1a.zuplo.app/a/Kx7gDiGsr1c2tOOUW5kpmXZn
​AiPolicy[] · required

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.

​array | null · required

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.

createdOn
​string · date-time · required

When the app was created.

updatedOn
​string · date-time · required

When the app was last changed.

AiAppList

A page of apps.
​AiApp[] · required

The apps on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

CreateAiAppRequest

A new app.
poolId
​string · maxLength: 64 · required

The pool the app belongs to. Cannot be changed later.

Example: config_IM1F8Z4rUT6rDPhabvfnrt27
name
​string · minLength: 1 · maxLength: 128 · required

The app's display name.

​AiPolicyInput[] · maxItems: 30

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.

UpdateAiAppRequest

Changes to an app (JSON Merge Patch).
name
​string · minLength: 1 · maxLength: 128

The app's display name.

​AiPolicyInput[] · maxItems: 30

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.

AiUserApp

Personal API keys and per-person budgets for everyone in the account.
id
​string · required

The user app ID.

Example: config_UsTroIp2e0K8mWYGj1GT8U13
bucketId
​string · required

The bucket (gateway) the user app belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
name
​string · required

The user app's display name.

Example: Personal keys
baseUrl
​string | null · uri · required

Where personal-key clients (Claude Code, Cursor, scripts) send requests. Null until the gateway is deployed.

Example: https://acme-ai-gateway-main-b8e2f1a.zuplo.app/u/UsTroIp2e0K8mWYGj1GT8U13
​AiPolicy[] · required

The policies every personal-key request runs, in order. The metering policy's per-person rule (budgetBy: expression on request.user.sub) sets the limits every person gets. A person's budget changes them for that person.

createdOn
​string · date-time · required

When the user app was created.

updatedOn
​string · date-time · required

When the user app was last changed.

AiUserAppList

A page of user apps.
​AiUserApp[] · required

The user apps on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

UpdateAiUserAppRequest

Changes to a user app (JSON Merge Patch).
name
​string · minLength: 1 · maxLength: 128

The user app's display name.

​AiPolicyInput[] · maxItems: 30

Replaces all of the user app's policies, in the order they run. Keep the metering policy's per-person rule to keep personal limits: removing a limit that a person's budget still changes fails with 409.

AiUserAppUser

A person who can use a user app, and with `include[]=budget` their `budget` as `GET …/users/{userId}/budget` returns it. The budget is read-only here: set it with `PUT …/users/{userId}/budget`.
userAppId
​string · required

The user app.

Example: config_UsTroIp2e0K8mWYGj1GT8U13
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
email
​string · email · required

The person's email address.

name
​string | null · required

The person's display name, if they set one.

hasBudgetOverride
​boolean · required

Whether the person has limits of their own (…/users/{userId}/budget) instead of the user app's defaults.

​required

The person's limits, as GET …/users/{userId}/budget returns them. Null unless include[] has budget.

AiUserAppUserList

A page of the people in a user app.
​AiUserAppUser[] · required

The people on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

AiUserBudget

One person's own limits in a user app, which replace the user app's per-person defaults.
userAppId
​string · required

The user app.

Example: config_UsTroIp2e0K8mWYGj1GT8U13
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
​BudgetLimit[] · required

The person's own limits. Empty when the defaults apply. Limits that are not listed keep the defaults.

updatedOn
​string | null · date-time · required

When the limits were last set, or null if they never were.

UpsertAiUserBudgetRequest

One person's own limits. The person is the `userId` in the path.
​BudgetLimitInput[] · maxItems: 4 · required

Replaces the person's own limits. Each must match a cost limit with action block in the user app's per-person budget rule. [] puts the person back on the defaults.

AiUserAppUsage

One person's usage against their personal limits.
userAppId
​string · required

The user app.

Example: config_UsTroIp2e0K8mWYGj1GT8U13
userId
​UserId · maxLength: 64 · required

A person, identified by their Zuplo user ID (user_…). Zuplo assigns it when the person is first added to an account, before they ever sign in, and it never changes. Every userId and ownerId in v4 is one.

Example: user_Jm5tR8wQz2KcX7vB4nLp9HdS
​AiUsageLimit[] · required

Usage per limit.

measuredOn
​string · date-time · required

How fresh the numbers are. Usage is aggregated asynchronously and can lag by a few seconds.

AiUsageLimit

Usage against one limit in the current period.
meter
​BudgetMeter · enum · required

What a limit measures. cost is in US dollars.

Enum values:
cost
requests
tokens
period
​BudgetPeriod · enum · required

The calendar window (UTC) a limit resets on.

Enum values:
hourly
daily
weekly
monthly
action
​BudgetAction · enum · required

warn records the breach and lets requests through. block rejects requests until the period resets.

Enum values:
warn
block
limit
​number | null · required

The limit that applies to this person, or null if it cannot be determined right now.

used
​number · required

Usage so far in the current period.

remaining
​number | null · required

What is left before the limit, or null when limit is null.

resetsOn
​string · date-time · required

When the current period ends.

source
​string | null · enum · required

Whether the limit comes from the per-person budget rule (default) or the person's own budget, or null when unknown.

Enum values:
default
override

ApiKey

An API key, one version of its consumer's credential, without its secret.
id
​string · required

The key ID. Not the secret.

Example: key_XKrbtT8H72PH0gQpblaXfstB
consumerId
​string · required

The consumer the key belongs to.

Example: csmr_brw0leTAVw478VFKD4F6OqVI
description
​string | null · required

What the key is used for.

Example: Production backend
maskedKey
​string · required

The first and last characters of the secret, to recognize the key.

Example: zpka_xxxx…xxxx
expiresOn
​string | null · date-time · required

When the key stops working, or null if it never expires.

createdOn
​string · date-time · required

When the key was created.

updatedOn
​string · date-time · required

When the key was last changed.

ApiKeyWithSecret

A newly created API key, including its secret, which is shown only once.
id
​string · required

The key ID. Not the secret.

Example: key_XKrbtT8H72PH0gQpblaXfstB
consumerId
​string · required

The consumer the key belongs to.

Example: csmr_brw0leTAVw478VFKD4F6OqVI
description
​string | null · required

What the key is used for.

maskedKey
​string · required

The first and last characters of the secret, to recognize the key later.

Example: zpka_xxxx…xxxx
expiresOn
​string | null · date-time · required

When the key stops working, or null if it never expires.

createdOn
​string · date-time · required

When the key was created.

updatedOn
​string · date-time · required

When the key was last changed.

secret
​string · required

The full API key. Send it as Authorization: Bearer <secret>. Returned only in this response.

Example: zpka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxx

ApiKeyList

A page of API keys.
​ApiKey[] · required

The API keys on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

ApiKeySecret

The secret of a key of a personal consumer, which only the person who holds the consumer can read.
apiKeyId
​string · required

The key the secret belongs to.

Example: key_XKrbtT8H72PH0gQpblaXfstB
secret
​string · required

The full API key. Send it as Authorization: Bearer <secret>.

Example: zpka_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_xxxxxxxx

CreateConsumerApiKeyRequest

A new key for a consumer, which replaces its other keys. Send `{}` for a key without description or expiry.
description
​string | null · maxLength: 512

What the key is used for.

expiresOn
​string | null · date-time

When the key stops working. Omit for a key that never expires.

UpdateApiKeyRequest

Changes to an API key (JSON Merge Patch).
description
​string | null · maxLength: 512

What the key is used for. Null clears it.

expiresOn
​string | null · date-time

When the key stops working. Null removes the expiry.

Consumer

One credential, held by an app, a person in a user app or the bucket. Its keys are the versions of that credential.
id
​string · required

The consumer ID.

Example: csmr_brw0leTAVw478VFKD4F6OqVI
bucketId
​string · required

The bucket the consumer belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
name
​string · required

The consumer's name, unique in the bucket. For a consumer the bucket holds, the API key authentication policy sets request.user.sub to it. Generated for the consumers of apps and people.

Example: acme-corp
description
​string | null · required

Who or what the consumer is.

Example: Acme Corp
​object · required

Key-value pairs to organize and find consumers. Empty when there are none.

Example: {"plan":"gold"}
​object · required

Your data for your own code: the API key authentication policy passes it to your gateway as request.user.data. Any JSON values, at most 3 KB (3,072 bytes) as JSON. Empty when there is none.

Example: {"customerId":"cus_9s6XKzkNRiz8i3","plan":"gold","seats":25}
​ConsumerManager[] · required

The people who manage the consumer's keys in your developer portal, by email. Empty when there are none, and always empty for the consumers of apps and people.

createdOn
​string · date-time · required

When the consumer was created.

updatedOn
​string · date-time · required

When the consumer was last changed.

ConsumerList

A page of consumers.
​Consumer[] · required

The consumers on this page.

limit
​integer · required

The page size that was applied.

offset
​integer · required

The number of items skipped before this page.

total
​integer · required

The number of items in the whole collection.

hasMore
​boolean · required

Whether there are more items after this page.

next
​string | null · required

The relative URL of the next page, or null on the last page.

ConsumerWithApiKey

A newly created consumer, with its first key and that key's secret when `include[]` had `apiKey`.
id
​string · required

The consumer ID.

Example: csmr_brw0leTAVw478VFKD4F6OqVI
bucketId
​string · required

The bucket the consumer belongs to.

Example: bckt_Y40ypGODCDP3S7iZxNwCAbIe
name
​string · required

The consumer's name, unique in the bucket.

Example: acme-corp
description
​string | null · required

Who or what the consumer is.

​object · required

Key-value pairs to organize and find consumers. Empty when there are none.

​object · required

Your data for your own code, passed to your gateway as request.user.data. Any JSON values, at most 3 KB (3,072 bytes) as JSON. Empty when there is none.

​ConsumerManager[] · required

The people who manage the consumer's keys in your developer portal, by email. Empty when there are none, and always empty for the consumers of apps and people.

createdOn
​string · date-time · required

When the consumer was created.

updatedOn
​string · date-time · required

When the consumer was last changed.

​required

The consumer's first key, with its secret, which is shown only once. Null unless include[] had apiKey.

CreateConsumerRequest

A new consumer.
name
​string · minLength: 1 · maxLength: 128 · pattern: ^[a-z0-9-]+$ · required

A name, unique in the bucket, that cannot be changed later: lowercase letters, digits and hyphens. The API key authentication policy sets request.user.sub to it.

description
​string | null · maxLength: 512

Who or what the consumer is.

​object · maxProps: 5

Up to five key-value pairs to organize and find consumers. Keys are at most 64 characters.

​object · maxProps: 50

Your data for your own code: the API key authentication policy passes it to your gateway as request.user.data. Any JSON values, at most 3 KB (3,072 bytes) as JSON. Keys are at most 64 characters.

​ConsumerManagerInput[] · maxItems: 100

The people who manage the consumer's keys in your developer portal, by email, at most 100. They see its keys there once they sign in with that address.

CreateAiUserConsumerRequest

A new consumer for a person in a user app.
description
​string | null · maxLength: 512

Where the person uses the consumer's keys, for example their laptop.

UpdateConsumerRequest

Changes to a consumer (JSON Merge Patch).
description
​string | null · maxLength: 512

Who or what the consumer is. Null clears it.

​object | null · maxProps: 5

Tags to set, merged key by key. A key set to null is removed, and null removes every tag. A consumer has at most five tags.

​object | null · maxProps: 50

Metadata to set, merged as a JSON Merge Patch. A key set to null is removed, an object is merged into the object it replaces, any other value replaces the key's value, and null removes all metadata. The result is at most 3 KB (3,072 bytes) as JSON.

​ConsumerManagerInput[] · maxItems: 100

All of the consumer's managers, replacing the current ones: send the complete list, and [] to remove them all. Only a consumer the bucket holds has managers; on any other consumer this is a 400.

ConsumerMetadataValue

ConsumerMetadataValueInput

ConsumerManager

A person who manages a consumer's keys in your developer portal. They sign in to the portal, not to Zuplo, so they have an `email` and, once they have signed in, a portal `sub`, but no `userId`.
email
​string · email · required

The person's email address. The developer portal shows them the consumer's keys when they sign in with it.

​required

Their subject in your developer portal's identity provider. Null until they first sign in to the portal.

ConsumerManagerInput

A person who manages a consumer's keys in your developer portal.
email
​string · email · maxLength: 320 · required

The person's email address, compared case-insensitively. Each address appears once.