API reference · AI gateway
Replace an alias's strategy and targets, with the checks of a new one
PUT/v1/orgs/{org}/ai/aliases/{alias}
- Permission
ai.aliases.manage- Audit log
ai.alias.update- Operation
ai.aliases.replace
Parameters
| Name | In | Type | Required | Notes |
|---|
org | path | string | yes | for example "org_01h455vb4pex5vsknk084sn02q" |
alias | path | string | yes | for example "als_01h455vb4pex5vsknk084sn02q" |
Idempotency-Key | header | string | no | One key per intended mutation. A retry with the key replays the recorded response instead of executing again; the key with another request answers 422 idempotency_key_reused. For example "01h455vb4pex5vsknk084sn02q" |
x-obhut-management-assignment | header | string | no | Select one staff assignment. Direct membership remains the default. Bound API tokens use their stored source and ignore this selector. For example "masg_01h455vb4pex5vsknk084sn02q" |
Request body
| Field | Type | Required | Notes |
|---|
strategy | string | yes | one of "priority", "weighted", "cheapest" |
targets | array of object | yes | 1 to 16 items |
targets[].model | string | yes | for example "cm_01h455vb4pex5vsknk084sn02q" |
targets[].credential | string | no | for example "pcr_01h455vb4pex5vsknk084sn02q" |
targets[].weight | integer | no | 1 to 10000 |
Response 200
| Field | Type | Required | Notes |
|---|
id | string | yes | for example "als_01h455vb4pex5vsknk084sn02q" |
orgId | string or null | yes | |
name | string | yes | |
strategy | string | yes | one of "priority", "weighted", "cheapest" |
targets | array of object | yes | |
targets[].model | string | yes | for example "cm_01h455vb4pex5vsknk084sn02q" |
targets[].provider | string | yes | |
targets[].providerModel | string | yes | |
targets[].location | string | yes | |
targets[].credential | string | yes | for example "pcr_01h455vb4pex5vsknk084sn02q" |
targets[].ownCredential | boolean | yes | |
targets[].weight | integer or null | yes | |
shadowed | boolean | yes | |
createdAt | string (date-time) | yes | UTC, ISO 8601. |
updatedAt | string (date-time) | yes | UTC, ISO 8601. |