Skip to main content
The ax prompts commands let you create and manage prompt templates and their versions on the Arize platform.

ax prompts list

List prompts in a space.
ax prompts list [--space-id <id>] [--limit <n>] [--cursor <cursor>]
OptionDescription
--space-idSpace ID to filter prompts
--limitMaximum number of results to return (default: 15)
--cursorPagination cursor for the next page
Examples:
ax prompts list --space-id sp_abc123
ax prompts list --space-id sp_abc123 --output prompts.json

ax prompts get

Get a prompt by ID. Optionally resolve a specific version via --version-id or --label. If neither is supplied, the latest version is returned.
ax prompts get <prompt-id> [--version-id <id>] [--label <label>]
OptionDescription
--version-idSpecific version ID to retrieve
--labelLabel name to resolve to a version (e.g. production)
Examples:
ax prompts get pr_abc123
ax prompts get pr_abc123 --version-id prv_xyz789
ax prompts get pr_abc123 --label production

ax prompts create

Create a prompt with an initial version. Pass messages as a path to a JSON file or inline JSON.
ax prompts create \
  --name <name> \
  --space-id <id> \
  --provider <provider> \
  --input-variable-format <format> \
  --messages <json-or-path>
OptionDescription
--namePrompt name (must be unique within the space)
--space-idSpace ID to create the prompt in
--providerLLM provider: openAI, azureOpenAI, awsBedrock, vertexAI, custom
--input-variable-formatVariable interpolation format: f_string, mustache, none
--messagesPath to a JSON file, or inline JSON array of message objects
--commit-messageCommit message for the initial version (default: "Initial version")
--descriptionOptional prompt description
--modelDefault model name for this version
Messages must be a non-empty JSON array. Each message object needs a role and optionally content, tool_call_id, or tool_calls:
[
  {"role": "system", "content": "You are a helpful assistant for {company}."},
  {"role": "user", "content": "Answer the question: {question}"}
]
Examples:
# From a JSON file
ax prompts create \
  --name "support-agent" \
  --space-id sp_abc123 \
  --provider openAI \
  --input-variable-format f_string \
  --messages ./messages.json \
  --model gpt-4o

# Inline JSON
ax prompts create \
  --name "summarizer" \
  --space-id sp_abc123 \
  --provider openAI \
  --input-variable-format f_string \
  --messages '[{"role":"user","content":"Summarize: {text}"}]' \
  --model gpt-4o-mini

ax prompts update

Update a prompt’s description.
ax prompts update <prompt-id> --description <desc>
Example:
ax prompts update pr_abc123 --description "Updated description for customer support prompt"

ax prompts delete

Delete a prompt and all its versions. This operation is irreversible.
ax prompts delete <prompt-id> [--force]
OptionDescription
--forceSkip the confirmation prompt
Examples:
ax prompts delete pr_abc123
ax prompts delete pr_abc123 --force

ax prompts list-versions

List versions for a prompt.
ax prompts list-versions <prompt-id> [--limit <n>] [--cursor <cursor>]
OptionDescription
--limitMaximum number of versions to return (default: 15)
--cursorPagination cursor for the next page
Example:
ax prompts list-versions pr_abc123

ax prompts create-version

Create a new version for an existing prompt. Pass messages as a path to a JSON file or inline JSON.
ax prompts create-version <prompt-id> \
  --provider <provider> \
  --input-variable-format <format> \
  --messages <json-or-path>
OptionDescription
--providerLLM provider: openAI, azureOpenAI, awsBedrock, vertexAI, custom
--input-variable-formatVariable interpolation format: f_string, mustache, none
--messagesPath to a JSON file, or inline JSON array of message objects
--commit-messageCommit message describing this version (default: "New version")
--modelDefault model name for this version
Example:
ax prompts create-version pr_abc123 \
  --provider openAI \
  --input-variable-format f_string \
  --messages ./updated_messages.json \
  --commit-message "Improved tone for edge cases" \
  --model gpt-4o

ax prompts get-version-by-label

Resolve a label to the prompt version it points to.
ax prompts get-version-by-label <prompt-id> --label <label>
Example:
ax prompts get-version-by-label pr_abc123 --label production

ax prompts set-version-labels

Set labels on a prompt version. Replaces all existing labels on the version with the provided list.
ax prompts set-version-labels <version-id> --label <label> [--label <label> ...]
Examples:
ax prompts set-version-labels prv_xyz789 --label production
ax prompts set-version-labels prv_xyz789 --label production --label staging

ax prompts remove-version-label

Remove a label from a prompt version. This does not delete the version itself.
ax prompts remove-version-label <version-id> --label <label>
Example:
ax prompts remove-version-label prv_xyz789 --label staging