AI Gateway Custom Policies

Create an AI Gateway Custom Policy

Changed on

Registers a new custom policy for the AI Gateway.

post/v1/ai-gateways/{gatewayId}/custom-policies

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Path parameters

gatewayId, string uuid required

Contains a unique identifier used for this resource.

Example:5f9fd312-a987-4628-b4c5-bb4f4fddd5f7

The unique ID of the AI Gateway.

Request body

union required

Request payload to register a new AI Gateway custom policy.

intersection required
OR
intersection required

Example request

{
  "name": "my-installed-custom-policy",
  "display_name": "Custom Policy - Installed plugin",
  "schema": "<lua_schema>",
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  }
}

Response

Custom policy created successfully.

union required

An AI Gateway custom policy.

intersection required
OR
intersection required

Example response

{
  "name": "my-installed-custom-policy",
  "display_name": "Custom Policy - Installed plugin",
  "schema": "<lua_schema>",
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z"
}

Changes

    • breaking

      the type request property const value installed was added

    • breaking

      the type request property const value streaming was added

    • breaking

      removed the enum value installed of the request property oneOf[#/components/schemas/CreateAIGatewayCustomPolicyInstalledRequest]/type

    5 more changes in this revision