Getting Started

Quickstart

Send your first LLM request through the CoreValue AI Gateway in under 2 minutes.

The CoreValue AI Gateway is an OpenAI-compatible API at https://gateway.corevalue.dev. Point your existing OpenAI SDK at it, use provider-prefixed model names to route to any supported provider, and every request is automatically logged with real cost tracking.

Supported Providers

Use provider/model-name format to route to any provider:

PrefixProviderExample
(none)OpenAIgpt-4o-mini
anthropic/Anthropicanthropic/claude-3.5-sonnet
google/Google Vertex AIgoogle/gemini-1.5-pro
bedrock/AWS Bedrockbedrock/anthropic.claude-3.5-sonnet
groq/Groqgroq/llama-3.3-70b-versatile
together/Together AItogether/meta-llama/Llama-3.3-70B-Instruct-Turbo
mistral/Mistral AImistral/mistral-large-latest
deepseek/DeepSeekdeepseek/deepseek-chat
xai/xAI (Grok)xai/grok-2
fireworks/Fireworks AIfireworks/accounts/fireworks/models/llama-v3p1-70b-instruct
perplexity/Perplexityperplexity/sonar
cerebras/Cerebrascerebras/llama-3.3-70b
deepinfra/DeepInfradeepinfra/meta-llama/Llama-3.3-70B-Instruct
novita/Novita AInovita/meta-llama/llama-3.3-70b-instruct
nebius/Nebiusnebius/meta-llama/Meta-Llama-3.1-70B-Instruct
baseten/Basetenbaseten/qwen2.5-72b
chutes/Chutes AIchutes/Llama-3.3-70B
openrouter/OpenRouteropenrouter/anthropic/claude-3.5-sonnet
canopywave/Canopywavecanopywave/llama-3.3-70b

OpenAI models don't need a prefix — just use the model name directly (e.g. gpt-4o-mini). All other providers require the provider/ prefix.

  1. Sign up for a CoreValue account
  2. Go to API Keys and generate a key — it starts with sk-cova-
  3. Add credits at Credits (0% markup, pay only what providers charge)

Use the OpenAI SDK pointed at the gateway. OpenAI models work with no prefix:

import { OpenAI } from "openai";

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

const response = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "Hello, world!" }],
});

console.log(response.choices[0].message.content);
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.corevalue.dev/v1",
    api_key=os.environ["COVA_API_KEY"],  # sk-cova-XXXXXXXXXXXXXXXX
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello, world!"}],
)

print(response.choices[0].message.content)
curl https://gateway.corevalue.dev/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COVA_API_KEY" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello, world!"}]
  }'

Your request appears in the Requests dashboard within seconds, with real cost, latency, and provider info tracked automatically.

Route to any provider by adding the provider/ prefix:

// Anthropic
const response = await client.chat.completions.create({
  model: "anthropic/claude-3.5-sonnet",
  messages: [{ role: "user", content: "Hello!" }],
});

// Groq (fast inference)
const response2 = await client.chat.completions.create({
  model: "groq/llama-3.3-70b-versatile",
  messages: [{ role: "user", content: "Hello!" }],
});
# Anthropic
response = client.chat.completions.create(
    model="anthropic/claude-3.5-sonnet",
    messages=[{"role": "user", "content": "Hello!"}],
)

# Groq (fast inference)
response2 = client.chat.completions.create(
    model="groq/llama-3.3-70b-versatile",
    messages=[{"role": "user", "content": "Hello!"}],
)
# Anthropic
curl https://gateway.corevalue.dev/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $COVA_API_KEY" \
  -d '{"model": "anthropic/claude-3.5-sonnet", "messages": [{"role": "user", "content": "Hello!"}]}'

The gateway translates the request format automatically — you send OpenAI-format requests, and it handles the provider-specific conversion for Anthropic, Google, and Bedrock.

Install the @cova/gateway SDK to attach Cova-* headers for user tracking, custom properties, and fallback chains:

npm install @cova/gateway
import { OpenAI } from "openai";
import { buildHeaders } from "@cova/gateway";

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-mini",
  messages: [{ role: "user", content: "Hello!" }],
  extra_headers: buildHeaders({
    userId: "user_abc123",
    properties: { feature: "chat", tier: "pro" },
    fallbacks: ["groq/llama-3.3-70b-versatile"],
  }),
});
pip install cova-gateway
from openai import OpenAI
from cova_gateway import build_headers

client = OpenAI(
    base_url="https://gateway.corevalue.dev/v1",
    api_key=os.environ["COVA_API_KEY"],
)

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello!"}],
    extra_headers=build_headers(
        user_id="user_abc123",
        properties={"feature": "chat", "tier": "pro"},
        fallbacks=["groq/llama-3.3-70b-versatile"],
    ),
)

If gpt-4o-mini fails, the gateway automatically retries with groq/llama-3.3-70b-versatile. See the SDK Quick Start for streaming, native fetch, and response metadata parsing.

What You Get

Every request through the gateway includes:

  • Real cost trackingCova-Request-Cost response header shows the actual cost in USD (not an estimate)
  • Provider and model infoCova-Provider and Cova-Model response headers
  • Credits remainingCova-Credits-Remaining response header
  • Request IDCova-Id response header for correlation with the dashboard
  • Gateway modeCova-Gateway-Mode shows passthrough or translated
  • Automatic logging — every request appears in the Requests dashboard with cost, latency, tokens, and status

Check Request Metadata

Retrieve metadata for any request using the meta endpoint:

curl https://gateway.corevalue.dev/gateway/v1/meta/$REQUEST_ID \
  -H "Authorization: Bearer $COVA_API_KEY"
{
  "requestId": "550e8400-e29b-41d4-a716-446655440000",
  "provider": "openai",
  "model": "gpt-4o-mini",
  "status": "success",
  "requestCost": 0.00015,
  "creditsRemaining": 99.85
}

Or use the SDK:

import { parseGatewayMeta } from "@cova/gateway";

const cova = parseGatewayMeta(response.headers);
console.log(cova.requestCost);   // 0.00015
console.log(cova.provider);      // "openai"
console.log(cova.requestId);     // "550e8400-..."

List Available Models

curl https://gateway.corevalue.dev/v1/models \
  -H "Authorization: Bearer $COVA_API_KEY"

Returns an OpenAI-compatible model list with all models available through the gateway.

What's Next?


Questions? Contact support@corevalue.dev.

On this page