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
1curl -X POST https://api.predictionguard.com/completions \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "model": "model",
6 "prompt": "prompt"
7}'
200
Successful
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}