SacredGPT API

SacredAI and Heretic through a familiar OpenAI-compatible API.

Connect SacredAI or sacredai-heretic through the familiar OpenAI format. Only the Base URL and key change.

https://sacredgpt.pro/v1OpenAI compatibleJSON · SSE · Tools

01 — Documentation without the wall of text

Your first request in minutes

Base URL
https://sacredgpt.pro/v1
Primary endpointPOST /chat/completions
AuthenticationBearer sg_live_…
01Quick startKey, environment variable, and first cURL
  1. Review plansThe Chat plan sets 5h / 7d windows. These are quota units, not a token price.
  2. Start with the free windowsFree SacredAI: 10,000 / 5h and 50,000 / 7d. Heretic has 10 lifetime requests. An ordinary key shares those windows with chat and browser Agent. Hosted Hermes is a separate subscription with its own quota; no Chat plan is required for it.
  3. Enable 2FAKey creation is protected by a one-time code.
  4. Choose a plan if the windows are not enoughA paid Chat plan gives each model its own windows. There are no one-off balance top-ups.
  5. Create and store the keySACREDGPT_KEY=sg_live_…
  6. Send the cURL requestUse a stable model ID.
cURL
curl https://sacredgpt.pro/v1/chat/completions \
  -H "Authorization: Bearer $SACREDGPT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sacredai-heretic",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
02OpenAI SDK and model listPython · TypeScript · GET /v1/models

Official OpenAI SDKs work without an adapter. Set the SacredGPT Base URL and your key; GET /v1/models returns the stable IDs available to it.

Python
from openai import OpenAI

client = OpenAI(
    base_url="https://sacredgpt.pro/v1",
    api_key="sg_live_...",
)

response = client.chat.completions.create(
    model="sacredai-heretic",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)
TypeScript
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://sacredgpt.pro/v1",
  apiKey: process.env.SACREDGPT_KEY,
});

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

console.log(response.choices[0].message.content);

GET /v1/modelsmodels available to the current key and their context windows.

Model nameModel ID
SacredAI
sacredgpt-auto
SacredAI Heretic
sacredai-heretic
03StreamingIncremental responses over Server-Sent Events

Add stream: true. The SDK returns an async stream of response deltas.

TypeScript
const stream = await client.chat.completions.create({
  model: "sacredai-heretic",
  messages: [{ role: "user", content: "Explain this code" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}
04Tools & Structured OutputFunction calls and JSON Schema responses
  • Pass tools and tool_choice in the OpenAI format; requested function calls are returned in tool_calls.
  • Use response_format for structured responses. Availability depends on the current Heretic route.
  • SacredGPT does not execute functions for you: your code handles tool_calls and sends the result back to the model.
05API privacyRetention follows the current Heretic route

API request content is not added to chat history; only technical data required for billing, limits, and security is retained. Heretic requests follow the current provider's retention terms.

06Quotas and limitsAccount windows, key budgets, RPM, and TPM
  • Ordinary Public API shares a model's windows with chat: free SacredAI and 10 lifetime Heretic requests, then the active paid plan's windows. There is no per-token rouble price.
  • When the limit is exhausted, access returns as the 5-hour or 7-day window recovers. A paid Chat plan gives higher limits.
  • The current UI exposes daily and monthly budgets. RPM, TPM, and concurrent streams are enforced by the server; advanced configuration is not yet available in the dashboard.
  • GET /v1/usage with the usage:read scope returns usage for that API key plus a separately labeled account-shared Heretic status. Managed Hermes keys do not receive the owner's shared status.
  • For sacredai-heretic, an exact final user command of /usage or heretic usage in Chat Completions returns shared status without a model call, quota usage, or charge. A client may intercept a same-named local command before HTTP, which the server cannot override; use GET /v1/usage as the reliable fallback.

GET /v1/usage · x-ratelimit-limit-* · x-ratelimit-remaining-* · x-ratelimit-reset-*

07ErrorsCodes your application should handle
HTTPCodeWhat happened
400invalid_requestInvalid request body or parameters
401invalid_api_keyThe key is invalid, expired, or lacks the required scope
402insufficient_balanceNo active quota, or the model window is exhausted
429rate_limit_exceededRPM, TPM, or concurrent stream limit exceeded
502provider_errorTemporary model provider failure
503model_unavailableNo suitable route is currently available for the model
Direct line

Found a bug? Show us.

Tell us what happened and what you expected. The page address and browser details help us reproduce it faster.