Generate Completions

POST
Retrieve text completions based on the provided input.

Request

This endpoint expects an object.
model
stringRequired
prompt
stringRequired

Response

This endpoint returns an object
id
stringOptional
Unique ID for the completion.
object
stringOptional
Type of object (text completion).
created
integerOptional
Timestamp of when the completion was created.
choices
list of objectsOptional
POST
$curl -X POST https://api.predictionguard.com/completions \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "model": "model",
> "prompt": "prompt"
>}'
Response
1{
2 "id": "cmpl-wzWm4jHomeRdbyiiDth6RIC0CI2eN",
3 "object": "text_completion",
4 "created": 1706909094,
5 "choices": [
6 {
7 "text": "2 dogs are walking down the street. One says to the other, \"I'm in love.\" The other says, \"I'm in love with the same bone.\"",
8 "index": 0,
9 "status": "success",
10 "model": "Nous-Hermes-Llama2-13B"
11 }
12 ]
13}