Skip to main content
The ax prompts commands are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
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>] [--name <filter>] [--limit <n>] [--cursor <cursor>]
OptionDescription
--spaceSpace name or ID to filter prompts
--nameCase-insensitive substring filter on prompt name
--limitMaximum number of results to return (default: 15)
--cursorPagination cursor for the next page
Examples:
ax prompts list --space sp_abc123
ax prompts list --space sp_abc123 --output prompts.json

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> \
  --provider <provider> \
  --input-variable-format <format> \
  --messages <json-or-path>
OptionDescription
--namePrompt name (must be unique within the space)
--spaceSpace name or 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 sp_abc123 \
  --provider openAI \
  --input-variable-format f_string \
  --messages ./messages.json \
  --model gpt-4o

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

ax prompts get

Get a prompt by name or ID. Optionally resolve a specific version via --version-id or --label. If neither is supplied, the latest version is returned.
ax prompts get <name-or-id> [--space <id>] [--version-id <id>] [--label <label>]
OptionDescription
--spaceSpace name or ID (required when using prompt name instead of ID)
--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 "support-agent" --space sp_abc123
ax prompts get pr_abc123 --version-id prv_xyz789
ax prompts get pr_abc123 --label production

ax prompts update

Update a prompt’s description.
ax prompts update <name-or-id> [--space <id>] --description <desc>
OptionDescription
--spaceSpace name or ID (required when using prompt name instead of ID)
--descriptionUpdated description for the prompt
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 <name-or-id> [--space <id>] [--force]
OptionDescription
--spaceSpace name or ID (required when using prompt name instead of ID)
--forceSkip the confirmation prompt
Examples:
ax prompts delete pr_abc123
ax prompts delete pr_abc123 --force
ax prompts delete "support-agent" --space sp_abc123 --force

ax prompts list-versions

List versions for a prompt.
ax prompts list-versions <name-or-id> [--space <id>] [--limit <n>] [--cursor <cursor>]
OptionDescription
--spaceSpace name or ID (required when using prompt name instead of ID)
--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 <name-or-id> \
  --provider <provider> \
  --input-variable-format <format> \
  --messages <json-or-path>
OptionDescription
--spaceSpace name or ID (required when using prompt name instead of ID)
--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 <name-or-id> --label <label> [--space <id>]
OptionDescription
--labelLabel name to resolve (e.g. production, staging)
--spaceSpace name or ID (required when using prompt name instead of ID)
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