attribution-plugins

Update an AI Gateway's attribution plugin

Changed on

Changes part of an installation's configuration with a JSON Merge Patch, installs the latest plugin version with the result, and returns the installation.

  • An omitted field keeps its stored value, and an array, such as headers, replaces the stored one whole.
  • operator_tags merges per key, and a key set to null is removed.
  • null returns headers, prefixes, operator_tags, or group_patterns to its empty default. integrations can't be null.
  • Like PUT, the request writes the plugin through the AI Gateway API as the caller, and it updates an outdated installation to the latest version.
  • If the gateway has no installation, or the identifier isn't a valid ID, the request fails with 404. The request never installs the plugin.
  • The body is application/merge-patch+json or application/json. Any other media type fails with 415.
  • If the patch, or the configuration it produces, is invalid, the request fails with 400.
  • 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.
patch/v1/ai-cost-management/ai-gateways/{gatewayId}/attribution-plugin

Request

  • Base URL
    https://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

integrationsAICostAttributionPluginIntegration[]

The integrations whose headers the plugin reads. Any other tool's headers are ignored.

operator_tagsobject nullable

Tags the plugin adds to every request. The patch merges per key, and a key set to null is removed. A key has at most 128 characters: lowercase letters and digits in words joined by single hyphens.

group_patternsstring[] nullable

PCRE regular expressions that choose which groups the plugin keeps from the caller's token. A group is kept when any pattern matches its name, case-insensitively and anywhere in the name unless the pattern anchors itself. An empty list keeps every group, and each pattern appears once.

Response

The installation after the update.

gateway_idstring uuid required

The ID of the AI Gateway the plugin is installed on.

versionstring required

The plugin version installed on the gateway.

latest_versionstring required

The newest plugin version. When it differs from version, a PUT of the stored configuration installs it.

integrationsAICostAttributionPluginIntegration[] required

The integrations whose headers the plugin reads.

operator_tagsobject required

Tags the plugin adds to every request.

group_patternsstring[] required

PCRE regular expressions that choose which groups the plugin keeps from the caller's token.

created_atstring date-time required

An ISO-8601 timestamp representation of entity creation date.

updated_atstring date-time required

An ISO-8601 timestamp representation of entity update date.

Example response

{
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z"
}

Changes