AI Gateway Models

Update an AI Gateway Model

Changed on

Updates the configuration of an existing AI Gateway model.

put/v1/ai-gateways/{gatewayId}/models/{modelIdOrName}

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.

modelIdOrName, string required

Identifier for an AI Gateway entity. In some cases, this may be the entity name or ID.

Example:my-entity-name

The unique ID or name of the AI Gateway model.

Request body

union required

Configuration for an AI Gateway model.

AIGatewayModelAPI required

Configuration for proxying asynchronous requests/responses to/from an AI Gateway model using the files, batches, and skills APIs.

OR
AIGatewayModelModel required

Configuration for proxying synchronous requests/responses to/from an AI Gateway model using generative APIs.

Example request

{
  "display_name": "My GPT 5 model",
  "name": "my-gpt-5-model",
  "enabled": true,
  "access": {
    "acls": {
      "allow": [
        "consumer-group-1"
      ]
    },
    "identity_providers": [
      "okta-ai-se"
    ],
    "auth_strategies": [
      "okta-ai-se"
    ]
  },
  "formats": [
    {
      "type": "openai"
    }
  ],
  "targets": [
    {
      "name": "gpt-5-model",
      "weight": 100,
      "provider": "azure-ai-se",
      "config": {
        "endpoint_type": "runtime"
      }
    }
  ],
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "datastores": [
    {
      "name": "kong-managed",
      "purpose": "semantic-balancer"
    }
  ],
  "config": {
    "route": {
      "headers": {
        "version": [
          "v1",
          "v2"
        ]
      },
      "hosts": [
        "foo.example.com"
      ],
      "model": {
        "body_param": "model",
        "header_param": "x-model",
        "path_param": "model_name"
      }
    },
    "balancer": {
      "embeddings": {
        "provider": "azure-ai-se"
      },
      "vectordb": {
        "port": 6379
      }
    }
  }
}

Response

Model updated successfully.

union required

Configuration for an AI Gateway model.

intersection required
OR
intersection required

Example response

{
  "id": "5f9fd312-a987-4628-b4c5-bb4f4fddd5f7",
  "created_at": "2022-11-04T20:10:06.927Z",
  "updated_at": "2022-11-04T20:10:06.927Z",
  "display_name": "My GPT 5 model",
  "name": "my-gpt-5-model",
  "enabled": true,
  "access": {
    "acls": {
      "allow": [
        "consumer-group-1"
      ]
    },
    "identity_providers": [
      "okta-ai-se"
    ],
    "auth_strategies": [
      "okta-ai-se"
    ]
  },
  "formats": [
    {
      "type": "openai"
    }
  ],
  "targets": [
    {
      "name": "gpt-5-model",
      "weight": 100,
      "provider": "azure-ai-se",
      "config": {
        "endpoint_type": "runtime"
      }
    }
  ],
  "labels": {
    "category": "finance"
  },
  "managed_by": {
    "owner": "terraform"
  },
  "datastores": [
    {
      "name": "kong-managed",
      "purpose": "semantic-balancer"
    }
  ],
  "config": {
    "route": {
      "headers": {
        "version": [
          "v1",
          "v2"
        ]
      },
      "hosts": [
        "foo.example.com"
      ],
      "model": {
        "body_param": "model",
        "header_param": "x-model",
        "path_param": "model_name"
      }
    },
    "balancer": {
      "embeddings": {
        "provider": "azure-ai-se"
      },
      "vectordb": {
        "port": 6379
      }
    }
  }
}

Changes

    • info

      added the new optional request property oneOf[#/components/schemas/AIGatewayModelAPI]/datastores/items/purpose

    • info

      added the new optional request property oneOf[#/components/schemas/AIGatewayModelModel]/datastores/items/purpose

    • info

      added the optional property oneOf[#/components/schemas/AIGatewayModelAPI]/datastores/items/purpose to the response with the status

    1 more change in this revision