ZaltharDocs

API reference

Completions

Continue a text prompt. Compatible with the OpenAI Completions API.

POST /v1/completions

Use completions when you want raw text continuation rather than a chat turn.

Example

curl https://api.zalthar.com/v1/completions \
  -H "Authorization: Bearer $ZALTHAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "acme/support-triage",
    "prompt": "Ticket: parcel arrived damaged.\nCategory:",
    "max_tokens": 5
  }'

Request body

Field Type Notes
model string Required.
prompt string Required.
suffix string Text that comes after the completion.
echo boolean Include the prompt in the output.
stream boolean Return server-sent events.

The sampling fields from Chat completions (temperature, top_p, max_tokens, stop, penalties, logit_bias, logprobs, seed) are also accepted. n is always 1.

Response

{
  "id": "cmpl-...",
  "object": "text_completion",
  "model": "acme/support-triage",
  "choices": [{"index": 0, "text": " Damaged item", "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 12, "completion_tokens": 3, "total_tokens": 15}
}