Skip to content

AI Gateway

Labs to explore AI Models, MCP servers, and Agents with the AI Gateway powered by Azure API Management and Microsoft Foundry

Install

$git clone https://github.com/Azure-Samples/AI-Gateway

Install command taken from the project's README or registry entry. Always review code before running it.

✨ AI Gateway Labs

Explore the enterprise-grade gateway for managing AI Models, Tools, and Agents

📰 New! The AI Gateway Dev Portal is now live — A starting point for building your own developer portal on top of Azure API Management AI Gateway's. Fork it, open it in VS Code with GitHub Copilot (or any coding agent), and shape it to fit your needs!

Why AI Gateway?

Building production-ready AI applications requires more than just calling model APIs. You need security, reliability, observability, and cost control—without slowing down innovation.

AI Gateway powered by Azure API Management provides:

  • 🔐 Security — OAuth 2.0, managed identities, content safety filtering
  • ⚡ Performance — Load balancing, semantic caching, request routing
  • 📊 Observability — Token metrics, built-in logging, tracing
  • 💰 Cost Control — Rate limiting, quota management, FinOps framework
  • 🔌 Extensibility — MCP protocol support, function calling, multi-model routing

📚 Explore the Labs

🔗 Browse all 30+ labs at aka.ms/ai-gateway/labs

Each lab is a hands-on Jupyter notebook with step-by-step instructions, Bicep infrastructure templates, and APIM policies you can deploy to your Azure subscription.

🧠 AI Gateway for Models

Manage and control access to Large Language Models with enterprise-grade policies.

Lab Description
Backend Pool Load Balancing Distribute requests across multiple model endpoints
Token Rate Limiting Control token consumption with rate limiting policies
Semantic Caching Cache responses using vector similarity for faster, cheaper completions
Model Routing Route requests to different backends based on model and version
FinOps Framework Manage AI budgets with automated quota controls

🔧 AI Gateway for Tools

Enable secure tool access with MCP protocol and function calling capabilities.

Lab Description
Model Context Protocol (MCP) Plug & play tools with OAuth credential management
MCP Client Authorization Implement MCP with the client authorization flow
Function Calling Use OpenAI function calling with Azure Functions backend
Realtime Audio + MCP Combine realtime voice API with MCP tools

🤖 AI Gateway for Agents

Build and control agentic applications with orchestration frameworks.

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io