Endpoints

Create completion

Generate text from a raw prompt.

POST/v1/completions

Generate text from a raw prompt. The prompt should follow the Inkwell template. Most applications should use chat completions instead.

Template: ### Brief\n{brief}\n\n### Article\n. Stop on ### End and ### Brief.

Body parameters

promptstringrequired
The full prompt text.
modelstringoptionaldefault "inkwell-1"
The model id.
max_tokensintegeroptionaldefault 16
Maximum number of output tokens. Set this explicitly; the default is short.
temperaturenumberoptionaldefault 1
Sampling temperature.
top_pnumberoptionaldefault 1
Nucleus sampling.
stopstring or array of stringsoptional
Sequences that end generation.
streambooleanoptionaldefault false
Stream the response as server-sent events.

Response

objectstringrequired
text_completion.
choicesarray of objectsrequired
Always one choice.
Show child attributes
textstringrequired
The generated text.
finish_reason"stop" | "length"required
Why generation ended.
usageobjectrequired
prompt_tokens, completion_tokens and total_tokens.