Endpoints
Create completion
Generate text from a raw prompt.
POST
/v1/completionsGenerate 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
promptstringrequiredThe full prompt text.
modelstringoptionaldefault "inkwell-1"The model id.
max_tokensintegeroptionaldefault 16Maximum number of output tokens. Set this explicitly; the default is short.
temperaturenumberoptionaldefault 1Sampling temperature.
top_pnumberoptionaldefault 1Nucleus sampling.
stopstring or array of stringsoptionalSequences that end generation.
streambooleanoptionaldefault falseStream the response as server-sent events.
Response
objectstringrequiredtext_completion.choicesarray of objectsrequiredAlways one choice.
Show child attributesHide child attributes
textstringrequiredThe generated text.
finish_reason"stop" | "length"requiredWhy generation ended.
usageobjectrequiredprompt_tokens, completion_tokens and total_tokens.