Prompts

Update a prompt

Update a prompt by ID with the provided fields.

patch/v2/prompts/{id}

Path parameters

idstring required

Unique identifier of the prompt

Unique identifier of the prompt

Request body

ownerstring
domain_idstring uuid
createdstring
updatedstring
created_by_idstring uuid nullable
updated_by_idstring uuid nullable
display_namestring

The prompt’s name, meant to be displayable in the UI.

descriptionstring nullable

The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose

pathstring

Entity storage path.

With workspace-level API keys, use the format project/folder/subfolder/.... The first element must be the display name of an existing project, followed by nested folders (auto-created as needed). Example: Default Project/agents.

With project-level API keys, the project is predetermined by the API key, so the path is relative to that project. Example: agents. For backward compatibility, a leading project name is ignored when it matches the scoped project.

Example request

{
  "prompt": {
    "model": "anthropic/claude-3-5-sonnet-20241022",
    "messages": [
      {
        "role": "system",
        "content": "You are a helpful assistant"
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ],
    "temperature": 0.5
  },
  "path": "Default Project"
}

Response

Prompt updated.

_idstring required
type'prompt' required
ownerstring required
domain_idstring uuid required
createdstring required
updatedstring required
created_by_idstring uuid nullable
updated_by_idstring uuid nullable
display_namestring required

The prompt’s name, meant to be displayable in the UI.

descriptionstring nullable

The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose

Example response

{
  "prompt_config": {
    "messages": [
      {
        "content": [
          {
            "image_url": {
              "url": "https://picsum.photos/id/1/200/300"
            }
          }
        ]
      }
    ]
  },
  "prompt": {
    "fallbacks": [
      {
        "model": "openai/gpt-4o-mini"
      }
    ],
    "retry": {
      "count": 3,
      "on_codes": [
        429,
        500,
        502,
        503,
        504
      ]
    },
    "cache": {
      "ttl": 3600
    },
    "load_balancer": {
      "type": "weight_based",
      "models": [
        {
          "model": "openai/gpt-4o",
          "weight": 0.7
        },
        {
          "model": "anthropic/claude-3-5-sonnet",
          "weight": 0.3
        }
      ]
    },
    "timeout": {
      "call_timeout": 30000
    },
    "model": "openai/gpt-4o"
  }
}

Changes

Changed in 38 of the 251 revisions of this API.3047101

    • added the new greenpt enum value to the prompt_config/provider response property for the response status 200

      response-property-enum-value-added

    This revision also has 16 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new meta enum value to the prompt_config/provider response property for the response status 200

      response-property-enum-value-added

    This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added TraceScrubbingPlugin to the prompt/plugins/items/ request property anyOf list

      request-property-any-of-added

    • added TraceScrubbingPlugin to the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-added

    This revision also has 31 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • 1586760a252f11See the full diff
    • removed TraceScrubbingPlugin from the prompt/plugins/items/ request property anyOf list

      request-property-any-of-removed

    • removed TraceScrubbingPlugin from the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-removed

    This revision also has 173 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added TraceScrubbingPlugin to the prompt/plugins/items/ request property anyOf list

      request-property-any-of-added

    • added TraceScrubbingPlugin to the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-added

    This revision also has 31 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • be3fe58ce38911See the full diff
    • removed TraceScrubbingPlugin from the prompt/plugins/items/ request property anyOf list

      request-property-any-of-removed

    • removed TraceScrubbingPlugin from the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-removed

    This revision also has 175 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added TraceScrubbingPlugin to the prompt/plugins/items/ request property anyOf list

      request-property-any-of-added

    • added TraceScrubbingPlugin to the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-added

    This revision also has 31 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • ed68e8b009d711See the full diff
    • removed TraceScrubbingPlugin from the prompt/plugins/items/ request property anyOf list

      request-property-any-of-removed

    • removed TraceScrubbingPlugin from the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-removed

    This revision also has 173 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added TraceScrubbingPlugin to the prompt/plugins/items/ request property anyOf list

      request-property-any-of-added

    • added TraceScrubbingPlugin to the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-added

    This revision also has 29 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

  • f459ad9381eb11See the full diff
    • removed TraceScrubbingPlugin from the prompt/plugins/items/ request property anyOf list

      request-property-any-of-removed

    • removed TraceScrubbingPlugin from the prompt/plugins/items/ response property anyOf list for the response status 200

      response-property-any-of-removed

    This revision also has 42 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

Of the 251 revisions, 71 have no diff computed.