• Explore the unified API Platform
        • BUILD APIs
        • Kong Insomnia
        • API Design
        • API Mocking
        • API Testing & Debugging
        • MCP Client
        • RUN APIs
        • API Gateway
        • Context Mesh
        • AI Gateway
        • Event Gateway
        • Kubernetes Operator
        • Service Mesh
        • Ingress Controller
        • Runtime Management
        • DISCOVER APIs
        • Developer Portal
        • Service Catalog
        • MCP Registry
        • GOVERN APIs
        • Metering & Billing
        • APIOps & Automation
        • API Observability
        • Why Kong?
      • CLOUD
      • Cloud API Gateways
      • Need a self-hosted or hybrid option?
      • COMPARE
      • Considering AI Gateway alternatives?
      • Kong vs. Postman
      • Kong vs. MuleSoft
      • Kong vs. Apigee
      • Kong vs. IBM
      • GET STARTED
      • Sign Up for Kong Konnect
      • Documentation
  • Agents
      • FOR PLATFORM TEAMS
      • Developer Platform
      • Kubernetes & Microservices
      • Observability
      • Service Mesh Connectivity
      • Kafka Event Streaming
      • FOR EXECUTIVES
      • AI Connectivity
      • Open Banking
      • Legacy Migration
      • Platform Cost Reduction
      • Kafka Cost Optimization
      • API Monetization
      • AI Monetization
      • AI FinOps
      • FOR AI TEAMS
      • AI Cost Control
      • AI Governance
      • AI Integration
      • AI Security
      • Agentic Infrastructure
      • MCP Production
      • MCP Traffic Gateway
      • FOR DEVELOPERS
      • Mobile App API Development
      • GenAI App Development
      • API Gateway for Istio
      • Decentralized Load Balancing
      • BY INDUSTRY
      • Financial Services
      • Healthcare
      • Higher Education
      • Insurance
      • Manufacturing
      • Retail
      • Software & Technology
      • Transportation
      • See all Solutions
      • DOCUMENTATION
      • Kong Konnect
      • Kong Gateway
      • Kong Mesh
      • Kong AI Gateway
      • Kong Event Gateway
      • Kong Insomnia
      • Plugin Hub
      • EXPLORE
      • Blog
      • Learning Center
      • eBooks
      • Reports
      • Demos
      • Customer Stories
      • Videos
      • EVENTS
      • AI + API Summit
      • Webinars
      • User Calls
      • Workshops
      • Meetups
      • See All Events
      • FOR DEVELOPERS
      • Get Started
      • Community
      • Certification
      • Training
      • COMPANY
      • About Us
      • Why Kong?
      • We're Hiring!
      • Press Room
      • Investors
      • Contact Us
      • PARTNER
      • Kong Partner Program
      • SECURITY
      • Trust and Compliance
      • SUPPORT
      • Enterprise Support Portal
      • Professional Services
      • Documentation
      • Press Releases

        Kong Names Bruce Felt as Chief Financial Officer

        Read More
  • Pricing
  • Login
  • Get a Demo
  • Start for Free
Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. From Chaos to Control: How Kong AI Gateway Streamlined My GenAI Application
Engineering
October 6, 2025
3 min read

From Chaos to Control: How Kong AI Gateway Streamlined My GenAI Application

Sachin Ghumbre
Sr. Architect - Technology, Cognizant + Kong Champion

In this post, Kong Champion Sachin Ghumbre shares his journey of transforming a complex GenAI application from a state of operational challenges to streamlined control. Discover how Kong AI Gateway provided the enterprise-grade governance needed to secure, optimize, and scale his GenAI solution, tackling issues from escalating LLM costs to prompt injection risks.

🚧 The challenge: Scaling GenAI with governance

While building a GenAI-powered agent for one of our company websites, I integrated components like LLM APIs, embedding models, and a RAG (Retrieval-Augmented Generation) pipeline. The application was deployed using a Flask API backend and secured with API keys.

However, post-deployment, several operational challenges emerged:

  • Escalating LLM usage costs
  • Security risks from exposed API keys and prompt injection
  • Limited observability into prompt flows, token usage, and latency
  • Difficulty in maintaining and scaling the API infrastructure

It became clear that while the GenAI logic was sound, the API layer lacked enterprise-grade governance. That’s when I turned to Kong Gateway, specifically its AI Gateway capabilities.

🤖 Why Kong Gateway for GenAI?

Kong isn’t just a traditional API gateway; it now offers a dedicated AI Gateway designed to meet the unique demands of GenAI workloads. Here’s what makes it ideal:

  • AI Manager: Centralized control plane for LLM APIs
  • One-Click API Exposure: Secure and governed API publishing
  • Secure Key Management: Store secrets in Kong Vault
  • Prompt Guard Plugin: Prevent prompt injection attacks
  • Semantic Routing: Route prompts based on intent/context
  • RAG Pipeline Simplification: Offload orchestration to the gateway
  • Caching & Optimization: Reduce token usage and latency
  • Observability & Analytics: Monitor usage, latency, and cost
  • Rate Limiting & Quotas: Control overuse and manage budgets
  • Future-Ready: Support for multi-agent protocols like MCP and A2A

These features allowed me to shift complexity away from the backend and focus on GenAI logic.

🧱 Architecture overview

This architecture, built on AWS, leverages Kong Gateway to securely manage interactions between internal services and external LLM providers. The environment described reflects my development setup, including AWS services and supporting technologies. 

For production deployments, I recommend evaluating and adopting a more robust technology stack and configuration to ensure enhanced security, compliance, scalability, and high availability.

🔄 Challenge vs. solution matrix

1. AWS Infrastructure

  • VPC with public/private subnets
  • Public Subnet: Kong Gateway EC2 (Data Plane Node)
  • Private Subnet: PostgreSQL for embeddings/chat history
  • S3 Bucket: Hosts React-based agent frontend

 2. Kong Gateway Components

  • Kong Gateway EC2: Kong Gateway data plane on EC2 that applies plugins for rate limiting, guard, caching, prompt decorating, AI proxy, prompt template, etc.
  • Kong Konnect: Manages configuration, policies, and analytics

3. External LLM Integration

  • Gemini 2.0 Flash Model: Kong acts as a secure proxy to this external LLM

🔁 Data Flow Overview

1. User interacts with GenAI agent (S3-hosted React app)
2. Request sent to Kong Gateway
3. Kong routes request, queries DB if needed, forwards to Gemini
4. Response returned via Kong to GenAI agent 

Conclusion

Building a GenAI application is only half the battle; the real complexity begins when scaling, securing, and monitoring it in production.

By integrating Kong Gateway and its AI-specific capabilities, I was able to:

  • Centralize and secure LLM APIs
  • Monitor and optimize token usage
  • Prevent prompt injection
  • Simplify RAG orchestration
  • Enable scalable, governed access to GenAI services

Kong’s AI Gateway isn’t just an API wrapper; it’s a purpose-built control layer for modern AI workloads. If you're building GenAI applications in production, I highly recommend exploring Kong’s capabilities to future-proof your architecture.

AI-powered API security? Yes please!

Learn MoreGet a Demo
AI GatewayLLMObservabilityAPI ManagementAPI Security

More on this topic

Videos

Security Observability: Securing Your Cloud Native Apps and APIs

Videos

Disparate Telemetry, Unified Product

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
AI GatewayLLMObservabilityAPI ManagementAPI Security
Sachin Ghumbre
Sr. Architect - Technology, Cognizant + Kong Champion

Recommended posts

AI Voice Agents with Kong AI Gateway and Cerebras

EngineeringNovember 24, 2025

Kong Gateway is an API gateway and a core component of the Kong Konnect platform . Built on a plugin-based extensibility model, it centralizes essential functions such as proxying, routing, load balancing, and health checking, efficiently manag

Claudio Acquaviva

Building the Agentic AI Developer Platform: A 5-Pillar Framework

EnterpriseJanuary 15, 2026

The first pillar is enablement. Developers need tools that reduce friction when building AI-powered applications and agents. This means providing: Native MCP support for connecting agents to enterprise tools and data sources SDKs and frameworks op

Alex Drag

Insights from eBay: How API Ecosystems Are Ushering In the Agentic Era

EngineeringDecember 15, 2025

APIs have quietly powered the global shift to an interconnected economy. They’ve served as the data exchange highways behind the seamless experiences we now take for granted — booking a ride, paying a vendor, sending a message, syncing financial rec

Amit Dey

Kong Simplifies Multicloud Cloud Gateways with Managed Redis Cache

Product ReleasesMarch 12, 2026

Managed Redis cache is a turnkey "Shared State" add-on for Kong Dedicated Cloud Gateways. It is designed to combine the performance of an in-memory data store with the simplicity of a SaaS product. When you spin up a Dedicated Cloud Gateway in Kong

Amit Shah

AI Input vs. Output: Why Token Direction Matters for AI Cost Management

EnterpriseMarch 10, 2026

The Shifting Economic Landscape: The AI token economy in 2026 is evolving, and enterprise leaders must distinguish between low-cost input tokens and high-premium output tokens to maintain profitability. Agentic AI Financial Risks: The transition t

Dan Temkin

AI Observability: Monitoring and Troubleshooting Your LLM Infrastructure

Learning CenterFebruary 27, 2026

AI observability extends traditional monitoring by adding behavioral telemetry for quality, safety, and cost metrics alongside standard logs, metrics, and traces Time-to-First-Token (TTFT) and token usage metrics are critical performance indicator

Kong

From APIs to Agentic Integration: Introducing Kong Context Mesh

Product ReleasesFebruary 10, 2026

Agents are ultimately decision makers. They make those decisions by combining intelligence with context, ultimately meaning they are only ever as useful as the context they can access. An agent that can't check inventory levels, look up customer his

Alex Drag

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2026