The OpenAI-compatible /v1 API

Core AI's /v1 API accepts OpenAI-compatible requests. An application can use the standard openai client library with three settings: a Core AI base URL, a Core AI API key and a Core AI model alias.

Endpoints

The /v1 endpoints
EndpointPurpose
POST /v1/chat/completionsChat, with streaming when "stream": true
POST /v1/responsesThe same chat in the Responses request shape
POST /v1/embeddingsText embeddings
GET /v1/modelsThe aliases this key can use right now
GET /v1/models/{alias}One alias
GET /v1/usageThis key's own usage records
GET /v1/healthService status; the only endpoint that needs no key

API keys and scopes

Send the key as Authorization: Bearer <key>. An operator issues each key to one application, with scopes (v1.chat, v1.embeddings, v1.models, v1.usage), a request rate limit, an expiry, and optional limits on providers, runtimes, regions and data classification. A request outside the key's scopes is refused before any model is called.

Model aliases

Put an alias in model: core-auto, core-fast, core-reasoning, core-local or core-embedding. The Router maps it to a configured model, and that mapping can change without any change to your code. See Models and providers.

While you build, use core-sandbox. Core AI answers chat completions, Responses and streaming with a fixed text: no model is called, nothing is charged and the token quota is not used. Authentication, scopes, rate limits and the usage records work exactly as for a real alias.

Example

curl "$CORE_AI_BASE_URL/chat/completions" \
  -H "Authorization: Bearer $CORE_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"core-auto","messages":[{"role":"user","content":"Summarize this document."}]}'
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.CORE_AI_API_KEY,
  baseURL: process.env.CORE_AI_BASE_URL, // ends in /v1
});
const reply = await client.chat.completions.create({
  model: "core-auto",
  messages: [{ role: "user", content: "Summarize this document." }],
});

Errors and limits

Errors use the OpenAI error shape. The type field is one of:

  • invalid_api_key
  • permission_denied
  • rate_limit_exceeded
  • quota_exceeded
  • invalid_request
  • model_unavailable
  • provider_error
  • internal_error

A rate-limited request gets HTTP 429 with Retry-After. A non-streaming request repeated with the same Idempotency-Key within ten minutes is replayed, without a second model call, by the instance that answered it.

Last updated .