AI Gateway

AI Gateway Overview

Use any LLM provider through a single OpenAI-compatible API with intelligent routing, fallbacks, and unified observability

CoreValue AI Gateway provides a unified API for LLM providers through the OpenAI SDK format. Instead of learning different SDKs and APIs for each provider, use one familiar interface to access any model with intelligent routing, automatic fallbacks, and complete observability built-in.

Post-M3, the Hono gateway on Cloud Run is the sole LLM request path. The legacy Cloudflare Worker proxy has been decommissioned — all traffic flows through the gateway.

Why Use AI Gateway?

One SDK for All Models

Use OpenAI SDK to access GPT, Claude, Gemini, and other models across 18 provider prefixes

No Rate Limits

Skip provider tier restrictions - use credits with 0% markup

Always Online

Automatic failover across providers keeps your app running

Unified Observability

Track usage, costs, and performance across all providers in one dashboard

How It Works

The AI Gateway sits between your application and LLM providers, acting as a unified translation layer:

  1. You make one request - Use the OpenAI SDK format, regardless of which provider you want
  2. We translate & route - CoreValue converts your request to the correct provider format (Anthropic, Google, etc.)
  3. Provider responds - The LLM provider processes your request
  4. We log & return - You get the response back while we capture metrics, costs, and errors

All through a single endpoint: https://gateway.corevalue.dev/v1

With credits, we manage provider API keys for you. Your requests automatically work with OpenAI, Anthropic, Google, and other providers without signing up for each one.

Gateway Routes

The gateway exposes six routes:

MethodPathPurpose
GET/healthcheckHealth check — no auth required
POST/v1/feedbackFeedback endpoint
GET/v1/modelsOpenAI-compatible model list (auth required, 60s cache)
GET/gateway/v1/meta/:requestIdPer-request FinOps metadata fallback (auth required)
POST*Provider dispatch — all LLM requests enter the 12-step pipeline
ALL* (fallback)405 Method Not Allowed for unhandled methods

Every POST LLM request passes through the same 12-step request pipeline: format adaptation, provider handler lookup, authentication, Cova header extraction, rate limiting, key resolution, wallet check, cache, and async post-processing.

Quick Example

Add two lines to your existing OpenAI code to unlock routed models with automatic observability:

import { OpenAI } from "openai";

const client = new OpenAI({
  baseURL: "https://gateway.corevalue.dev/v1", 
  apiKey: process.env.COVA_API_KEY, 
});

const response = await client.chat.completions.create({
  model: "gpt-4o",  // Or: anthropic/claude-sonnet-4, google/gemini-2.0-flash, etc.
  messages: [{ role: "user", content: "Hello!" }]
});

CoreValue vs OpenRouter

CoreValue offers a complete platform for production AI applications, while OpenRouter focuses on simple model access.

FeatureCoreValueOpenRouter
Pricing0% markup5.5% markup
ObservabilityFull-featured (sessions, users, custom properties, cost tracking)Basic (requests/costs per model only)
Session Tracking
Prompt Management
Caching
Custom Rate Limits
Open Source
BYOK
Automatic Fallbacks

Next Steps

Want to integrate a new model provider to the AI Gateway? Check out our tutorial for detailed instructions.

On this page