POST
/
apps
/
{appSlug}
/
prompts
Create a new prompt
curl --request POST \
  --url https://api-v2.autoblocks.ai/apps/{appSlug}/prompts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "soap-note-generator",
  "templates": [
    {
      "id": "template-1",
      "template": "Hi {{name}}"
    }
  ],
  "params": {
    "temperature": 0.5,
    "topP": 0.5,
    "topK": 10,
    "frequencyPenalty": 0.5,
    "presencePenalty": 0.5,
    "maxTokens": 100,
    "responseFormat": {
      "type": "json_object"
    },
    "stopSequences": [
      "<|endoftext|>"
    ],
    "model": "gpt-4o"
  }
}'
{
  "id": "<string>",
  "version": "<string>",
  "revisionId": "<string>",
  "templates": [
    {
      "id": "<string>",
      "template": "<string>"
    }
  ],
  "tools": [
    {}
  ],
  "toolsParams": [
    {
      "name": "<string>",
      "params": [
        "<string>"
      ]
    }
  ],
  "params": {
    "params": {}
  }
}

Authorizations

Authorization
string
header
required

API Key created in the Autoblocks Webapp

Path Parameters

appSlug
string
required

Body

application/json
id
string
required

The id for the prompt. Should be human readable and unique.

Minimum length: 1
Example:

"soap-note-generator"

templates
object[]
required

The templates for the prompt. At least one template is required. Variables can be wrapped in braces.

Minimum length: 1
Example:
[
{
"id": "template-1",
"template": "Hi {{name}}"
}
]
params
object | null

The optional parameters for the prompt.

Example:
{
"temperature": 0.5,
"topP": 0.5,
"topK": 10,
"frequencyPenalty": 0.5,
"presencePenalty": 0.5,
"maxTokens": 100,
"responseFormat": { "type": "json_object" },
"stopSequences": ["<|endoftext|>"],
"model": "gpt-4o"
}

Response

200 - application/json

The prompt was created successfully

id
string
required
version
string
required
revisionId
string
required
templates
object[]
required
toolsParams
object[]
required
tools
object[] | null
params
object | null