API Documentation

A single endpoint for text generation. Authenticated with an API key.

Endpoint
POSThttps://your-domain.com/api/public/v1/generate
Authentication

Include your API key in one of these headers:

x-api-key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# or
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request body
{
  "prompt": "The full text to send to the model",
  "conversationHistory": [
    { "role": "assistant", "content": "..." },
    { "role": "user", "content": "..." }
  ],
  "stream": false
}
Response
{
  "text": "Model response",
  "finish_reason": "stop"
}
curl example
curl -sS -X POST "https://your-domain.com/api/public/v1/generate" \
  -H "Content-Type: application/json; charset=utf-8" \
  -H "x-api-key: sk_live_YOUR_KEY" \
  --max-time 600 \
  -d '{"prompt":"Hello", "conversationHistory":[], "stream":false}'
Notes

stream: false — returns one full response (no streaming).

finish_reason: "stop" — the model completed successfully.

• Long timeout (600s) recommended — first request may need to load the model.

• All calls are logged: timestamp, status, duration, prompt preview, and source IP.

• HTTP 401 means missing or revoked key. HTTP 502 means the upstream model is unavailable.