Generate

GA
POST

Generate a completion using a previously defined deployment.

Note: Uses a base url of https://predict.vellum.ai.

Request

This endpoint expects an object.
requests
list of objectsRequired
The generation request to make. Bulk requests are no longer supported, this field must be an array of length 1.
deployment_id
stringOptional

The ID of the deployment. Must provide either this or deployment_name.

deployment_name
stringOptional

The name of the deployment. Must provide either this or deployment_id.

options
objectOptional
Additional configuration that can be used to control what's included in the response.

Response

This endpoint returns an object
results
list of objects
The results of each generation request.
POST
1curl -X POST https://predict.vellum.ai/v1/generate \
2 -H "X_API_KEY: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "requests": [
6 {
7 "input_values": {}
8 }
9 ]
10}'
200
Successful
1{
2 "results": [
3 {
4 "data": {
5 "completions": [
6 {
7 "id": "id",
8 "text": "text",
9 "model_version_id": "model_version_id",
10 "prompt_version_id": "prompt_version_id",
11 "deployment_release_tag": "deployment_release_tag",
12 "model_name": "model_name"
13 }
14 ]
15 },
16 "error": {
17 "message": "message"
18 }
19 }
20 ]
21}