Zuplo API v4
Zuplo Developer API

Provider Assignments

A provider assignment is the gateway's choice to use a provider: a routing label, the provider's models it serves, and the environment variable that holds the provider's API key. Clients select a model in requests as <label>/<model>, for example anthropic1/claude-sonnet-4-6, and policies, fallbacks and load balancing name it the same way. So a label cannot be changed yet: nothing rewrites the policies that name it. One provider can be assigned several times, with different labels, models or keys.

The key is never sent to this API. It is an environment variable of the bucket's project, read when the gateway calls the provider, so an assignment belongs to that project and is not shared. An assignment's models can have negotiated prices, which replace the list prices in cost metering and cost budgets.


List AI provider assignments

GET
https://dev-api-v4-main-a471234.zuplo.app
/v4/buckets/{bucketId}/ai/provider-assignments

Lists the providers the gateway routes to, ordered by label. Filter by providerId to see the assignments of one provider.

List AI provider assignments › path Parameters

bucketId
​string · maxLength: 64 · required

The bucket ID (bckt_…). Everything in a bucket is addressed under it.

List AI provider assignments › query Parameters

providerId
​string · maxLength: 64

Only return the assignments of this provider.

limit
​integer · min: 1 · max: 100

The maximum number of items to return.

Default: 10
offset
​integer · min: 0

The number of items to skip before the first item returned.

Default: 0

List AI provider assignments › Responses

A page of AI provider assignments.

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.


Create an AI provider assignment

POST
https://dev-api-v4-main-a471234.zuplo.app
/v4/buckets/{bucketId}/ai/provider-assignments

Assigns a provider to the gateway: requests for <label>/<model> go to the provider, with the key in the environment variable apiKeyEnvironmentVariable. A provider can be assigned more than once, with different labels, models or keys.

The key is never sent to or stored by this API. The variable is read from the bucket's project (its production environment, which serves the gateway), so an assignment belongs to one project and cannot be shared. It is not checked on write: if the variable is missing, the assignment is created, and requests routed to it fail until the variable is set.

label must be unique in the bucket because it is the routing prefix: requests and policies name the assignment's models <label>/<model>. apiKeyEnvironmentVariable must be unique in the project too. models are the provider's models the assignment serves, named as GET …/ai/providers/{providerId}/models lists them; nothing else is routed to it.

Creating an assignment deploys the gateway: it creates a deployment (source.type zuplo) of the project's production environment, normally done within a few minutes. The response does not link to it. To wait until the assignment is usable, list GET /v4/projects/{projectId}/deployments?environmentId=… and read the newest zuplo deployment created after this request until it has succeeded. That does not guarantee every edge serves the assignment yet: the gateway may serve the previous version for a while.

During the preview, models must include a model of each kind the provider offers (completions, embeddings). A list without any model of one kind answers 501: Zuplo stores an assignment's models per kind, and no model of a kind still means every model of that kind.

Create an AI provider assignment › path Parameters

bucketId
​string · maxLength: 64 · required

The bucket ID (bckt_…). Everything in a bucket is addressed under it.

Create an AI provider assignment › Request Body

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.

Create an AI provider assignment › Responses

The provider assignment was created.

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.


Get an AI provider assignment

GET
https://dev-api-v4-main-a471234.zuplo.app
/v4/buckets/{bucketId}/ai/provider-assignments/{assignmentId}

Returns a provider assignment and the models it serves, each with the price the gateway meters it at.

Get an AI provider assignment › path Parameters

bucketId
​string · maxLength: 64 · required

The bucket ID (bckt_…). Everything in a bucket is addressed under it.

assignmentId
​string · maxLength: 64 · required

The AI provider assignment ID (aip_…).

Get an AI provider assignment › Responses

The AI provider assignment.

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.


Update an AI provider assignment

PATCH
https://dev-api-v4-main-a471234.zuplo.app
/v4/buckets/{bucketId}/ai/provider-assignments/{assignmentId}

Updates a provider assignment with JSON Merge Patch semantics. Omitted properties are unchanged and null clears a property. providerId cannot be changed, and neither can label yet: requests and policies name the assignment's models <label>/<model>, and nothing rewrites them, so a change of label answers 501. To rotate the key, set the environment variable to the new key, or point apiKeyEnvironmentVariable at another variable; as on create, the variable is not checked on write.

models replaces all of the models the assignment serves, so send the complete list: the current models (with any changes) plus new ones, minus the ones to remove. Removing a model fails with 409 while a policy of an app, a user app or a pool template still names it as <label>/<model>.

A change deploys the gateway: like a create, it creates a zuplo deployment of the production environment: read the newest one, GET /v4/projects/{projectId}/deployments?environmentId=…&limit=1, until it has succeeded. That does not guarantee every edge serves the change yet: the gateway may serve the previous version for a while.

During the preview, a models list without any model of a kind the provider offers answers 501, as on create.

Update an AI provider assignment › path Parameters

bucketId
​string · maxLength: 64 · required

The bucket ID (bckt_…). Everything in a bucket is addressed under it.

assignmentId
​string · maxLength: 64 · required

The AI provider assignment ID (aip_…).

Update an AI provider assignment › Request Body

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.

Update an AI provider assignment › Responses

The updated AI provider assignment.

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.


Delete an AI provider assignment

DELETE
https://dev-api-v4-main-a471234.zuplo.app
/v4/buckets/{bucketId}/ai/provider-assignments/{assignmentId}

Deletes a provider assignment and its negotiated prices, and deploys the gateway. Requests for <label>/<model> fail once the deployment has succeeded. The provider and the environment variable are kept. Fails with 409 while a policy of an app, a user app or a pool template still names one of its models. A repeated delete returns 404, which clients should treat as success.

Delete an AI provider assignment › path Parameters

bucketId
​string · maxLength: 64 · required

The bucket ID (bckt_…). Everything in a bucket is addressed under it.

assignmentId
​string · maxLength: 64 · required

The AI provider assignment ID (aip_…).

Delete an AI provider assignment › Responses

The provider assignment was deleted.

No data returned