Create an AI Gateway Model
Changed onRegisters a new model with routing, capabilities, and target backends.
Request
- Base URLhttps://global.api.konghq.com
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
Contains a unique identifier used for this resource.
The unique ID of the AI Gateway.
Request body
Configuration for an AI Gateway model.
Configuration for proxying asynchronous requests/responses to/from an AI Gateway model using the files, batches, and skills APIs.
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": {
"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": {
"classifier": {
"type": "custom",
"url": "https://api.typesafe.ai",
"format": "/v1/systemone",
"name": "jev-latest",
"timeout": 5000,
"context_window": 32768,
"auth": {
"type": "basic",
"headers": [
{
"name": "Authorization",
"value": "Bearer {vault://env/classifier-api-key}"
}
]
}
},
"session_affinity": {
"enabled": true,
"ttl": 21600,
"storage": {
"type": "redis"
}
}
}
}
}Response
Model created successfully.
Configuration for an AI Gateway model.
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": {
"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": {
"classifier": {
"type": "custom",
"url": "https://api.typesafe.ai",
"format": "/v1/systemone",
"name": "jev-latest",
"timeout": 5000,
"context_window": 32768,
"auth": {
"type": "basic",
"headers": [
{
"name": "Authorization",
"value": "Bearer {vault://env/classifier-api-key}"
}
]
}
},
"session_affinity": {
"enabled": true,
"ttl": 21600,
"storage": {
"type": "redis"
}
}
}
}
}Changes
- breaking
the request property
oneOf[#/components/schemas/AIGatewayModelAPI]/config/balancer/oneOf[#/components/schemas/AIGatewayModelBalancerSemanticConfig]/embeddings/config/oneOf[#/components/schemas/AIGatewayBedrockEmbeddingsModelConfig]/batch_bucket_prefixbecame not nullable - breaking
the request property
oneOf[#/components/schemas/AIGatewayModelAPI]/config/balancer/oneOf[#/components/schemas/AIGatewayModelBalancerSemanticConfig]/embeddings/config/oneOf[#/components/schemas/AIGatewayBedrockEmbeddingsModelConfig]/performance_config_latencybecame not nullable - breaking
the request property
oneOf[#/components/schemas/AIGatewayModelAPI]/config/balancer/oneOf[#/components/schemas/AIGatewayModelBalancerSemanticConfig]/embeddings/config/oneOf[#/components/schemas/AIGatewayBedrockEmbeddingsModelConfig]/regionbecame not nullable
1371 more changes in this revision
- breaking