Skip to content
NotHolyDocs

API reference

Text completions

POST /v1/completions for the legacy prompt-in, text-out format.

View as Markdown

The legacy prompt endpoint, for tools that still speak it. It runs the prompt as one user message on the same models. For anything new, use chat completions.

POSThttps://api.notholy.com/v1/completions

Request

FieldTypeRequiredNotes
modelstringYesA model ID
promptstring or arrayYesA string, or an array with exactly one string
max_tokensnumberNoDefaults to 16. Capped at the model's maximum output
streambooleanNotrue returns text_completion chunks and data: [DONE]
temperature, top_p, stopNoPassed to the model
nnumberNoOnly 1

There are no tools and no reasoning effort here. echo, logprobs and suffix are ignored.

Response

JSON
{
  "id": "cmpl-4Qz7",
  "object": "text_completion",
  "created": 1793836800,
  "model": "notholy-specter",
  "choices": [{ "index": 0, "text": " ../../etc/passwd encoded as %2e%2e%2f…", "finish_reason": "length", "logprobs": null }],
  "usage": { "prompt_tokens": 14, "completion_tokens": 60, "total_tokens": 74 }
}
  • In a stream, each chunk carries choices[0].text. The last chunk has finish_reason and usage.

Example

curl https://api.notholy.com/v1/completions \
  -H "Authorization: Bearer $NOTHOLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "notholy-specter", "prompt": "A path traversal payload in a file download parameter looks like", "max_tokens": 60}'

Errors

400 missing prompt, more than one prompt or n above 1 · 401 bad key · 402 out of credits · 404 unknown model · 429 busy · 503 model unavailable. See Errors.