---
title: "Kong AI Gateway API"
url: "https://developer.kong-sales-engineering.com/apis/kong-gpt/versions/7cdae724-17c9-4c8b-b7b1-c60303c1a31e"
---

# Kong AI Gateway API

OpenAPI specification document.

```json
{"openapi":"3.1.0","info":{"title":"Kong AI Gateway API","contact":{"name":"Kong Solutions Engineering","email":"contact@konghq.com"},"description":"API interface for a variety of LLMs through Kong's AI Gateway","version":"1.0.0"},"servers":[{"url":"https://shared-services.kong-sales-engineering.com/portal/kongai"},{"url":"https://shared-services-hybrid.kong-sales-engineering.com/portal/kongai"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}}},"paths":{"/chat":{"post":{"operationId":"chat","tags":["Chat"],"summary":"Chat with the model","description":"This endpoint allows you to chat with the model by sending a series of messages.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}}}}},"required":["messages"]},"examples":{"example":{"value":{"messages":[{"role":"system","content":"You are a scientist."},{"role":"user","content":"What is the theory of relativity?"}]}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"string"}}}}}},"400":{"description":"Bad request"},"500":{"description":"Server error"}},"parameters":[{"name":"X-LLM","in":"header","required":true,"schema":{"type":"string","enum":["openai","azure","cohere","bedrock"]}}]}},"/chat/template":{"post":{"operationId":"promptTemplate","tags":["Template"],"summary":"Fill in the blank","description":"Use tuned AI prompts as a service","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string"},"properties":{"type":"object"}},"required":["prompt"]},"examples":{"historian":{"value":{"prompt":"{template://historian}","properties":{"event":"Fall of the Roman Empire"}}},"programmer":{"value":{"prompt":"{template://programmer}","properties":{"language":"Golang","program":"Main function"}}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"response":{"type":"string"}}}}}},"400":{"description":"Bad request"},"500":{"description":"Server error"}},"parameters":[{"name":"X-LLM","in":"header","required":true,"schema":{"type":"string","enum":["openai","azure","cohere"]}}]}}}}
```
