Headers

Authentication

Authenticating with the CoreValue gateway

API Key Authentication

Every request to the CoreValue gateway must be authenticated with a single organization API key. The key is sent in the standard Authorization header using the Bearer scheme:

Authorization: Bearer sk-cova-XXXXXXXXXXXXXXXX

The gateway uses a single API key per organization. There is no public/secret key split — the same key is used for all gateway operations.

Required on Every Endpoint

Authentication is required on every gateway endpoint except /healthcheck. Requests missing or failing authentication receive a 401 Unauthorized response.

EndpointAuth Required
GET /healthcheckNo
POST /v1/feedbackYes
GET /v1/modelsYes
GET /gateway/v1/meta/:requestIdYes
POST * (provider dispatch)Yes

Examples

curl https://gateway.corevalue.dev/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-cova-XXXXXXXXXXXXXXXX" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.corevalue.dev/v1",
    api_key="sk-cova-XXXXXXXXXXXXXXXX",
)

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

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

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

Passing the Key Explicitly

If your HTTP client does not set the Authorization header automatically from an apiKey field, you can pass it explicitly via custom/default headers:

curl https://gateway.corevalue.dev/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-cova-XXXXXXXXXXXXXXXX" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.corevalue.dev/v1",
    default_headers={
        "Authorization": "Bearer sk-cova-XXXXXXXXXXXXXXXX",
    },
)

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

const client = new OpenAI({
  baseURL: "https://gateway.corevalue.dev/v1",
  defaultHeaders: {
    Authorization: `Bearer sk-cova-XXXXXXXXXXXXXXXX`,
  },
});

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

Do not use CoreValue-Auth or TraceAI-Auth headers — these are deprecated and no longer accepted by the gateway. Always use the standard Authorization: Bearer header.

On this page