curl --location --request POST '/predict/$workspace_slug/$prompt_slug' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <API_KEY>' \
--data-raw '{
    "args": { "input": "value" },
}'
{
  "prediction": "Hey! How can I assist you today?",
  "totalTime": 52,
  "outputFormatType": "string",
  "links": {
    "log": "http://localhost:3002/s/ms-test/prompts/test-prompt/logs/1374",
    "editor": "http://localhost:3002/s/ms-test/prompts/test-prompt/edit?logId=1374"
  }
}

Body

workspace_slug
path

This is the slug of the workspace that contains the prompt.

prompt_slug
path

This is the slug for your prompt.

args
body

These are the arguments that are passed into your prompt. Make sure these argument match the schema for the prompt.

x-api-key
header

This is the API Key for authentication. This should be passed as a header. View Authentication for more information

Content-Type
header

This is the content type of the request. This should be passed as a header. View Authentication for more information

Response

prediction

The prediction from the prompt. This could be any type depending on your output format. You can learn more about the output format in the Output Format section.

outputFormatType
string

The type of output. This could either be json, text, number or code.

totalTime
number

The total time it took to run the prompt in milliseconds.

links
object

The contents of the user group