attribution-plugins
Install or replace an attribution plugin
Changed onInstalls the latest attribution plugin version on an AI Gateway with this configuration, or replaces the installed plugin and its configuration, and returns the installation.
- The plugin becomes a streaming custom policy named ai-cost-attribution and a global policy that turns it on. The request writes both through the AI Gateway API as the caller, so the caller also needs the AI Gateways Admin role on the gateway.
- Every request installs the latest version, so a PUT of the stored configuration updates an outdated installation.
- The plugin tags requests only on data planes that run AI Gateway 2.3 or later. Each data plane must run with KONG_CUSTOM_PLUGIN_STREAMING_ENABLED=on. A data plane with streaming off refuses the gateway's whole configuration while the plugin is installed.
- If the gateway doesn't have the plugin yet and a data plane the AI Gateway API lists reports streaming off, or doesn't report the setting because it runs an older release, the request fails with 409, names those data planes, and changes nothing. The API lists a data plane for five minutes after its last ping, so a data plane replaced in that time can still be named. A data plane that connects later isn't checked, and neither is a gateway that already has the plugin.
- If the request fails partway, repeating it finishes the installation.
- If the body is invalid, the request fails with 400. A header mapping that names a credential header, or repeats a header or tag key, counts as invalid.
- If the gateway already has a custom policy or policy of this name that this product didn't install, the request fails with 409 and changes nothing.
- If another change to the gateway's plugin is running, the request fails with 409 and changes nothing. Repeat it once that change has finished.
put/v1/ai-cost-management/ai-gateways/{gatewayId}/attribution-plugin
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
gatewayIdstring uuid required
The ID of the AI Gateway.
Request body
Response
The installation after the replacement.
Example response
{
"created_at": "2022-11-04T20:10:06.927Z",
"updated_at": "2022-11-04T20:10:06.927Z"
}Changes
- info
endpoint added
- info