🌐 AI Gateway

Route all your AI traffic through a single, secure endpoint. Support for 12 providers with smart routing, caching, and cost optimization.

Overview

The AI Gateway is an OpenAI-compatible proxy that sits between your application and LLM providers. Send requests to a single endpoint and CloudVera handles provider routing, security scanning, caching, cost tracking, and failover — all at the edge with sub-20ms overhead.

Streaming

Stream responses in real-time using Server-Sent Events (SSE). Set stream: true in your request and iterate over chunks as they arrive. Works with all providers.

Function & Tool Calling

Define tools (functions) that the model can invoke, then handle the results. CloudVera proxies tool calls transparently — works with OpenAI, Anthropic, Google, Mistral, and any provider that supports function calling.

Supported Providers

CloudVera supports 12 AI providers through a unified API. Each provider's models are accessible through the same endpoint.

Smart Routing

Intelligent model routing with automatic failover, circuit breakers, and latency-based selection.

Semantic Caching

Save 30-50% on costs by caching semantically similar requests. When a request matches a previous response, CloudVera returns the cached result instantly.

Virtual API Keys

Create scoped API keys with granular permissions, model allow-lists, budgets, and rate limits. Every proxy request is checked against the key's permissions before reaching the provider.

A/B Testing & Canary

Experiment with different models and providers to find the best combination of quality, cost, and latency for your use case.

Workers AI Specialized Models

Access 30+ Cloudflare Workers AI models for tasks beyond chat and embeddings — summarization, translation, image generation, speech-to-text, text-to-speech, classification, object detection, and more. These models use the /v1/run endpoint instead of /v1/chat/completions.

API Reference

The CloudVera gateway is OpenAI-compatible. These are the additional headers and endpoints specific to CloudVera.

Error Handling

When a request fails — blocked by security, rate limited, or provider error — CloudVera returns a structured error response. All errors follow the same format so you can handle them consistently.

Response Headers

CloudVera adds metadata headers to every response. Use these for debugging, monitoring, and cost tracking. All headers are exposed via CORS for browser-based applications.

Canary Testing & Model Rollout

Gradually roll out new models or provider changes with traffic splitting, real-time metric comparison, and automatic rollback on regression.