v2

latestOpenAPI 3.0.3Apache-2.02026-08-07119359591.9 KB
Prompts

Create a prompt version

Create a new version of an existing prompt.

Payload Requirements

  • A commit_message is required.
  • At least one message is required in messages.
  • Do not include system-managed fields on input: id, commit_hash, created_at, created_by_user_id. Requests that contain these fields will be rejected.
  • provider is required. input_variable_format defaults to F_STRING if not provided.

Valid example (create)

{
  "commit_message": "Updated system prompt for better responses",
  "input_variable_format": "F_STRING",
  "provider": "OPEN_AI",
  "model": "gpt-4",
  "messages": [
    {
      "role": "SYSTEM",
      "content": "You are a helpful assistant."
    },
    {
      "role": "USER",
      "content": "Hello, {name}!"
    }
  ]
}

Invalid example (missing required commit_message)

{
  "input_variable_format": "F_STRING",
  "provider": "OPEN_AI",
  "messages": [
    {
      "role": "USER",
      "content": "Hello!"
    }
  ]
}

<Note>This endpoint is in beta, read more here.</Note>

post/v2/prompts/{prompt_id}/versions

Path parameters

prompt_idstring required

A universally unique identifier (base64-encoded opaque string).

Example:RW50aXR5OjEyMzQ1

The unique prompt identifier (base64)

Request body

commit_messagestring required

Commit message describing this version

input_variable_format'F_STRING' | 'MUSTACHE' | 'NONE'

The format for input variables in the prompt messages. Defaults to F_STRING if not provided.

  • F_STRING: Single curly braces ({variable_name})
  • MUSTACHE: Double curly braces ({{variable_name}})
  • NONE: Deprecated. Treated as F_STRING. Will be removed in a future version.
provider'OPEN_AI' | 'AZURE_OPEN_AI' | 'AWS_BEDROCK' | 'VERTEX_AI' | 'ANTHROPIC' | 'CUSTOM' required

The LLM provider to use

modelstring

The model to use for the call. Optional. If omitted, no default model is set on the version.

Response

A prompt version object

idstring required

The prompt version ID

prompt_idstring required

The prompt ID this version belongs to

commit_hashstring required

The commit hash of this version

commit_messagestring required

The commit message describing the changes in this version

input_variable_format'F_STRING' | 'MUSTACHE' | 'NONE' required

The format for input variables in the prompt messages. Defaults to F_STRING if not provided.

  • F_STRING: Single curly braces ({variable_name})
  • MUSTACHE: Double curly braces ({{variable_name}})
  • NONE: Deprecated. Treated as F_STRING. Will be removed in a future version.
provider'OPEN_AI' | 'AZURE_OPEN_AI' | 'AWS_BEDROCK' | 'VERTEX_AI' | 'ANTHROPIC' | 'CUSTOM' required

The LLM provider to use

modelstring required

The model to use for the call

created_atstring date-time required

When the version was created

created_by_user_idstring required

The user ID of the user who created this version

labelsstring[]

Label names currently pointing to this version (e.g., "production", "staging"). Labels are case-sensitive.