API reference · Prompts
Write a new version
POST/api/account/prompts/{id}/versionsSigned in session
Versions are never changed once written; a new text is the next number. At most 500 versions a prompt. Same origin.
Parameters
| Field | Type | What it is |
|---|---|---|
| id (path)required | string | pmpt_ id. |
Request body
application/json, required
| Field | Type | What it is |
|---|---|---|
| messagesrequired | array of object | |
| messages[] | string | One of "system", "developer", "user", "assistant". |
| messages[] | string | Text with {{variables}}: two braces, a name, two braces. At most 64000 characters. |
| model | string or null | Sent when a request that names this version names no model. |
| note | string or null | At most 500 characters. |
Example
{
"messages": [
{
"role": "user",
"content": "Say hello in five words."
}
],
"model": "antimatter/auto",
"note": "string"
}Answer 201
The prompt, with version naming the new number.
| Field | Type | What it is |
|---|---|---|
| prompt | object | |
| prompt. | string | |
| prompt. | string | |
| prompt. | string or null | |
| prompt. | integer | |
| prompt. | object | Label to version. |
| prompt. | integer | |
| prompt. | integer | |
| versions | array of object | |
| versions[] | integer | |
| versions[] | array of object | |
| versions[] | string | One of "system", "developer", "user", "assistant". |
| versions[] | string | Text with {{variables}}: two braces, a name, two braces. At most 64000 characters. |
| versions[] | array of string | |
| versions[] | string or null | |
| versions[] | string or null | |
| versions[] | integer | Epoch ms. |
Errors
- 400OpenAI shaped error.
- 401OpenAI shaped error.
- 404OpenAI shaped error.
- 409OpenAI shaped error.
Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.