Authentication
Use your API key in the Authorization header:Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/completions | Main endpoint (use ?stream=true/false) |
| POST | /api/completions/sync | Non-streaming response |
| POST | /api/completions/stream | HTTP/2 streaming (JSON array) |
| POST | /api/completions/sse | Server-Sent Events streaming |
Request Body
Fields
| Field | Type | Required | Description |
|---|---|---|---|
promptText | string | Yes | The prompt text. Supports {{variable}} placeholders |
systemMessage | string | No | System message for AI context |
aiSystem | string | Yes | AI provider: HyperleapAi, OpenAi, Anthropic, GoogleGemini, Groq, Cohere |
model | string | Yes | Model name (e.g., hl-gpt-4o-mini, gpt-4, claude-3-haiku-20240307) |
configuration | object | No | Model parameters (temperature, max_tokens, etc.) |
replacements | object | No | Key-value pairs for {{variable}} substitution |
dataspaceIds | array | No | Dataspace UUIDs for RAG grounding |
metadata | object | No | Custom metadata to attach |
Examples
Basic Request
With Variable Replacements
With System Message
Streaming (SSE)
With Configuration
Response Format
Sync Response
SSE Response
Available Models
HyperleapAi
hl-gpt-4o-minihl-gpt-4.1-mini
OpenAi
gpt-4ogpt-4o-minigpt-4-turbogpt-3.5-turbo
Anthropic
claude-3-opus-20240229claude-3-sonnet-20240229claude-3-haiku-20240307
Google Gemini
gemini-progemini-1.5-pro
Groq
llama3-70b-8192mixtral-8x7b-32768
Error Handling
| Status | Description |
|---|---|
| 400 | Invalid request (missing required fields, invalid model) |
| 401 | Unauthorized (invalid or missing API key) |
| 500 | Server error |
Notes
- Credits are consumed for each API call
- Variable replacement uses Handlebars syntax:
{{variableName}} - All endpoints support the same request body format
- Use
/api/completions?stream=truefor streaming via query parameter

