Prompts

Get a prompt object by its id

get/v1/prompt/{prompt_id}

Request

  • Base URL
    https://api.braintrust.dev
  • Auth
    • HTTP bearer
    • or none

Path parameters

prompt_idstring uuid required

Prompt id

Query parameters

versionstring

Retrieve prompt at a specific version.

The version id can either be a transaction id (e.g. '1000192656880881099') or a version identifier (e.g. '81cd05ee665fdfb3').

environmentstring

Filter by environment slug. Cannot be used together with version.

For GET /v1/prompt, environment resolution currently requires the request to match a single prompt. If multiple prompts match, the endpoint returns 400 (for example when limit=1 is not set). Use limit=1 or other filters (for example slug, project_id) to narrow results.

Response

Returns the prompt object

idstring uuid required

Unique identifier for the prompt

_xact_idstring required

The transaction id of an event is unique to the network operation that processed the event insertion. Transaction ids are monotonically increasing over time and can be used to retrieve a versioned snapshot of the prompt (see the version parameter)

project_idstring uuid required

Unique identifier for the project that the prompt belongs under

log_id'p' required

A literal 'p' which identifies the object as a project prompt

org_idstring uuid required

Unique identifier for the organization

namestring required

Name of the prompt

slugstring required

Unique identifier for the prompt

descriptionstring nullable

Textual description of the prompt

createdstring date-time nullable

Date of prompt creation

tagsstring[] nullable

A list of tags for the prompt

metadataobject nullable

User-controlled metadata about the prompt

function_type'llm' | 'scorer' | 'task' | 'tool' | 'custom_view' | 'preprocessor' | 'facet' | 'classifier' | 'tag' | 'parameters' | 'sandbox' | 'null' nullable

Changes

    • info

      removed the undefined enum value from the //////// response property for the response status

    • info

      removed the undefined enum value from the ///// response property for the response status

    • info

      added the optional property //// to the response with the status