API reference

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

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringpmpt_ id.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
messagesrequiredarray of object
messages[].rolerequiredstringOne of "system", "developer", "user", "assistant".
messages[].contentrequiredstringText with {{variables}}: two braces, a name, two braces. At most 64000 characters.
modelstring or nullSent when a request that names this version names no model.
notestring or nullAt 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.

Fields of the 201 answer
FieldTypeWhat it is
promptobject
prompt.idstring
prompt.namestring
prompt.descriptionstring or null
prompt.latestVersioninteger
prompt.labelsobjectLabel to version.
prompt.createdAtinteger
prompt.updatedAtinteger
versionsarray of object
versions[].versioninteger
versions[].messagesarray of object
versions[].messages[].rolerequiredstringOne of "system", "developer", "user", "assistant".
versions[].messages[].contentrequiredstringText with {{variables}}: two braces, a name, two braces. At most 64000 characters.
versions[].variablesarray of string
versions[].modelstring or null
versions[].notestring or null
versions[].createdAtintegerEpoch 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.

Antimatter