AI API

Live

Four production lanes on the shared Bolrach AI engine: answer a prompt, summarize text, classify into labels you define, and moderate user content. Generation runs the current cheap-best GPT-5 lane; you never manage provider keys or model migrations.

Base URL https://api.bolrach.ioScope ai:invokeSpec openapi/ai.json

Authentication

Same as every platform service: Authorization: Bearer bt_... or x-api-key, with the ai:invoke scope on your key. All four endpoints are POST with JSON bodies and return 200 on success.

Responses include a model field naming the exact model that answered. The platform keeps this on the newest affordable GPT-5 tier, so the id changes over time; treat it as informational.

Endpoints

POST /v1/ai/answer

General question answering and instruction following.

FieldTypeDescription
promptstring, requiredThe question or instruction (up to 32,000 characters).
systemstring, optionalSystem framing, e.g. a persona or output rules.
max_tokensinteger, optional1-1024, default 512.
curl -X POST "https://api.bolrach.io/v1/ai/answer" \
  -H "Authorization: Bearer bt_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Write a one-line tagline for a Lagos logistics startup."}'

Response

{
  "text": "Lagos moves faster when your deliveries do.",
  "model": "openai/gpt-5.6-luna"
}
POST /v1/ai/summarize

Length-controlled summaries: short (2-3 sentences), medium (one paragraph) or long (3-5 short paragraphs).

curl -X POST "https://api.bolrach.io/v1/ai/summarize" \
  -H "Authorization: Bearer bt_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "…article text…", "length": "short"}'
POST /v1/ai/classify

Single-label classification into 2-20 labels you supply. The response is always exactly one of your strings.

curl -X POST "https://api.bolrach.io/v1/ai/classify" \
  -H "Authorization: Bearer bt_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "My card was charged twice", "labels": ["billing", "technical-support", "sales"]}'

Response

{
  "label": "billing",
  "model": "openai/gpt-5.6-luna"
}
POST /v1/ai/moderate

Content moderation tuned for Nigerian English and pidgin as well as global content. A deterministic keyword floor always runs; an LLM pass adds nuance when available, so this endpoint answers even when providers are down.

curl -X POST "https://api.bolrach.io/v1/ai/moderate" \
  -H "Authorization: Bearer bt_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "double your money fast, whatsapp me on 0801…"}'

Response

{
  "action": "block",
  "flagged": true,
  "scores": { "toxicity": 0.0, "spam": 1.0, "nsfw": 0.0 },
  "reasons": ["scam/lure phrases: double your money, whatsapp me", "contact-info drop"],
  "engine": "llm"
}

Limits and errors

Plan rate limits are shared across all platform services (free 60/min and 5,000/day; see the plans table). Inputs are capped at 32,000 characters (20,000 for moderation). Provider failures surface as 502 upstream_error in the standard envelope and are safe to retry with backoff; generation never silently falls back to a fake answer.

Changelog

DateChange
2026-07-14v1 launch: answer, summarize, classify, moderate on the GPT-5 stack (gpt-5.6-luna generation, gpt-5.4-nano moderation lane).