Why AI needs its own gateway
Wiring an LLM straight to your APIs and BigQuery tables with a shared key is fine for a demo. In production it fails security review, or burns a month of token budget over a weekend. We deploy Apigee as an AI gateway between your data warehouse, your internal APIs and your models, across Google Cloud and multicloud setups.
AI traffic is different from normal API traffic. Outputs are non deterministic, payloads carry large context windows, and usage is measured in tokens, not requests. Agents also stream over SSE (Server Sent Events), use JSON-RPC for MCP (Model Context Protocol), and talk to other agents over A2A (Agent to Agent) and AP2.
Without a gateway, three things usually go wrong:
- Direct data warehouse exposure: An agent gets a broad service account to query BigQuery or internal APIs. One prompt injection or bad tool call later, it is reading records it should never see.
- 429 errors and token bill shock: One runaway agent loop uses the whole Vertex AI or third party model quota, and every other team on the project gets
429 Too Many Requests. - MCP sprawl: Several teams write their own MCP servers around the same APIs, with inconsistent OAuth, no shared inventory and no audit logs.
Putting Apigee between your data, your APIs and your models means every BigQuery query, RAG lookup, LLM call and MCP tool call goes through one control point. Governance, cost control and security are applied by default, not left to each developer.
These capabilities work on both Apigee (hosted on Google Cloud) and Apigee hybrid.
What we configure
1. Routing LLM traffic and controlling token cost
If a model endpoint is hardcoded in your app, switching models or riding out a regional quota spike needs a code deployment. We use Apigee API proxies and Extension processor policies (which apply Apigee policies to model and MCP calls that are not behind a classic proxy) to control the traffic:
- Model abstraction and routing: Send each use case to the right model behind one API contract. For example, fast classification to Gemini Flash, complex coding or reasoning to Claude on Vertex AI, or Hugging Face models on Vertex AI Agent Platform and other clouds.
- Semantic caching: Apigee uses vector search and a configurable similarity score to return cached responses for prompts that mean the same thing, reducing token spend and latency.
- LLM Token Limit policy: Standard rate limits count HTTP requests, which means little when one prompt is 50 tokens and the next is 100,000. We set quotas and rate limits on actual token counts so one noisy app cannot destabilise the platform.
- LLM circuit breaker: Catches rate limit responses or high latency from a primary model and fails over to a backup model or region, avoiding
429errors in RAG and agent applications. - Request and response enrichment: Add grounding context from BigQuery or Vertex AI Search inside the proxy flow before the request reaches the LLM.
2. Turning enterprise APIs into MCP tools
Agents are only useful if they can act on your systems. Whether your teams build in Gemini Enterprise and Dialogflow, or in code with Google ADK, LangChain or LlamaIndex, Apigee sits between the agents and your backend tools:
- APIs as MCP tools: Expose existing REST and gRPC APIs as MCP servers without writing wrapper code. Apigee handles MCP transcoding over SSE and JSON-RPC.
- Specification Boost and Gemini Code Assist: Agents call APIs badly when the OpenAPI spec has vague field names and no descriptions. We use Specification Boost and Gemini Code Assist in Apigee to generate descriptions, schemas and documentation so agents know when and how to call each tool.
- Apigee API Hub and agentic skills: Catalogue your first and third party APIs, workflows and MCP servers in Apigee API Hub. We group tools into reusable agentic skills and AI products, and can set up tool monetisation if you charge partners for agent access.
- Agent Registry and search: Sync MCP tools from API Hub into Google Cloud Agent Registry. Developers and agents can use semantic search in API Hub with MCP to find the right API in plain language.
- Third party systems: Connect agents to systems such as Salesforce, SAP, Workday and ServiceNow through Google Cloud Application Integration behind Apigee.
3. Governing and securing LLMs, data and MCP proxies
As covered in our post on governing AI at scale in financial services, regulators like APRA and MAS expect you to know every AI model and agent in your estate, control what data it can reach, and have a tested kill switch. Apigee provides those guardrails:
- Model Armor: Screens every prompt and response at the gateway for prompt injection, jailbreaks and sensitive data or PII leakage.
- OAuth 2.0 and JSON-RPC policies: Lock down MCP proxies with OAuth 2.0, JWT validation and API keys, and control which MCP tools each agent can call.
- Advanced API Security: Detects abuse, anomalies, LLM API misconfigurations and OWASP Top 10 API and LLM risks, with logs sent to Google SecOps or your SIEM.
4. Developer self service and token visibility
If the approved AI path takes a month of security tickets, developers will paste company data into unapproved tools instead. We set up Apigeeβs integrated developer portal so internal teams can get access to approved models and MCP tools, register apps and receive scoped keys with token limits built in.
For platform owners and finance teams:
- Token monitoring: Model usage and token consumption per app, agent or business unit.
- Cost dashboards: Looker Studio and Looker dashboards that break down cost by token count and cache savings.
- Audit logging: Every prompt, MCP tool call and response logged for compliance audits and incident investigation.
How we roll it out
- Map your models, agents and data: We review the LLMs, agents, BigQuery datasets and internal APIs you run today, find unguarded warehouse connections, and choose the highest value APIs to turn into governed MCP tools first.
- Deploy the gateway and policies: We deploy Apigee AI proxies and Extension processor policies in Terraform, with model routing, circuit breakers, semantic caching, token limits and Model Armor.
- Set up API Hub and MCP servers: We register your APIs in API Hub, run Specification Boost, expose priority services as OAuth protected MCP tools and sync them to Agent Registry.
- Connect cost reporting and SecOps: We launch the developer portal, connect token analytics to Looker Studio and send Model Armor and Advanced API Security alerts to Google SecOps.
Who this is for
- Engineering teams moving AI agents from proof of concept to production who need one place to manage model routing, token limits, caching and MCP tools.
- Data platform leads who need a governed boundary between BigQuery and AI agents instead of handing out database credentials.
- Regulated organisations in finance, healthcare and government that need prompt screening, tool level access controls and full audit logs to get security sign off.
Related
- Apigee API management, Edge and hybrid migrations: our core Apigee practice, including legacy Edge and hybrid migrations and healthcare API modernisation.
- Agentic engineering: building production multi agent systems with Google ADK and MCP.
- MCP and agentic AI on Google Cloud Run: Ben Kingβs guide to running stateless MCP servers on Cloud Run.
- Unblock AI workloads with Wiz and Google SecOps: getting AI workloads through security review with posture and runtime detection.
- Governing AI at scale in financial services: our seven control framework for APRA, MAS, RBI and BNM AI compliance on Google Cloud.
Talk to an architect
Book a 20 minute call with a senior Google Cloud architect. Show us how your agents and models reach your APIs and data today, and we will map out where Apigee AI Gateway fits.
Talk to an architect who has done this before.
Bring your current setup and the outcome you need. You will get a view on the approach, the risks and roughly what it costs.
Straight to a senior GCP architect. No SDR, no slide deck.
Not ready to talk? See how we migrated Hapana off AWS β
Or call +61 2 8359 9507 · Hello@aviato.consulting