API reference

BEZ Intelligence API

One gateway for every AI capability in the ecosystem. Requests are routed to the best available model for the task, failed over automatically, rate limited per key and logged for audit.

Authentication

Bearer keys, scoped to an organisation

Create a key in the developer portal. Keys are hashed at rest, bound to one organisation, carry scopes, and enforce a per-minute rate limit plus a monthly quota. Never ship a key in browser code — call the gateway from your server.

Authorization: Bearer $BEZ_API_KEY
Content-Type: application/json
X-BEZ-Product: your-app        # optional, used for usage attribution

Base URL https://zentechlimited.com. All endpoints accept CORS preflight and return { data } on success or { error: { code, message } } on failure.

Endpoints

Every route the gateway exposes

Text generation through the BEZ Intelligence router. The gateway selects a model per task, fails over automatically and returns the model that actually served the request.

POST/api/public/ai/chatBearer API key

Multi-turn conversation with routing, caching and failover.

Request parameters for /api/public/ai/chat
FieldTypeRequiredDescription
messagesMessage[]YesOrdered turns: { role: 'system' | 'user' | 'assistant', content: string }.
systemstringNoSystem instruction prepended to the conversation.
taskstringNoRouting hint — chat, reasoning, coding, extraction, summarisation.
temperaturenumberNo0–2. Defaults to the model profile.

Request

curl https://zentechlimited.com/api/public/ai/chat \
  -H "Authorization: Bearer $BEZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "reasoning",
    "messages": [
      { "role": "user", "content": "Summarise this quarter'"'"'s pipeline risk." }
    ]
  }'

Response

{
  "data": {
    "text": "Three deals carry 62% of forecast value…",
    "model": "bez-reason-1",
    "provider": "bez-self-hosted",
    "usage": { "input_tokens": 412, "output_tokens": 188 }
  }
}
POST/api/public/ai/completionsBearer API key

Single-prompt completion. Convenience wrapper over /chat.

Request parameters for /api/public/ai/completions
FieldTypeRequiredDescription
promptstringYesThe instruction to complete.
systemstringNoSystem instruction.
taskstringNoRouting hint.

Request

curl https://zentechlimited.com/api/public/ai/completions \
  -H "Authorization: Bearer $BEZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Write a renewal email for an expiring contract." }'

Response

{ "data": { "text": "Hi Ada, your contract renews on…", "model": "bez-lm-1" } }
POST/api/public/ai/buildBearer API key

One-pass software generation: PRD, architecture, database, APIs, UI, dashboard and timeline. Streams newline-delimited partial JSON.

Request parameters for /api/public/ai/build
FieldTypeRequiredDescription
promptstringYesWhat the software should do.

Request

curl -N https://zentechlimited.com/api/public/ai/build \
  -H "Authorization: Bearer $BEZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "A tenant onboarding platform for Lagos property managers" }'

Response

{ "name": "...", "prd": { … }, "architecture": { … }, "database": [ … ], "api": [ … ] }
POST/api/public/ai/studioBearer API key

Creation Engine modules — design, video, social and domain briefs streamed section by section.

Request parameters for /api/public/ai/studio
FieldTypeRequiredDescription
module'design' | 'video' | 'social' | 'domain'YesStudio module to run.
fieldsRecord<string,string>YesAnswers to the module brief fields.

Request

curl -N https://zentechlimited.com/api/public/ai/studio \
  -H "Authorization: Bearer $BEZ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "module": "design", "fields": { "brief": "Launch flyer for a Lekki development" } }'

Response

{ "name": "…", "summary": "…", "brand": { "palette": [ … ] }, "concept": [ … ] }
Errors & limits

Fail predictably, retry safely

Every failure returns the same envelope. Retry 429 and 503 with exponential backoff and jitter; never retry 400 or 403 without changing the request.

BEZ Intelligence API error codes
StatusCodeMeaning
400invalid_requestA required field is missing or malformed. The message names the field.
401unauthorizedMissing, invalid or revoked bearer API key.
403scope_deniedThe key is valid but lacks the scope for this endpoint.
429rate_limitedPer-minute rate limit exceeded. Retry with exponential backoff.
429quota_exhaustedMonthly quota for the key is spent. Raise the quota in the portal.
503no_model_availableNo model in the routing chain is deployed and healthy for this task.
500internal_errorUnexpected gateway error. Safe to retry once.

Streaming endpoints (/build and /studio) return newline-delimited partial JSON — read the body as a stream and parse incrementally rather than awaiting the full response. Back to documentation.