Prompts

Get Prompt

Retrieve the Prompt with the given ID.

By default, the deployed version of the Prompt is returned. Use the query parameters version_id or environment to target a specific version of the Prompt.

get/prompts/{id}

Request

  • Base URL: https://api.humanloop.com/v5
  • URL: https://api.humanloop.com/v5/prompts/{id}
  • Auth: API key in header X-API-KEY

Path parameters

idstring required

Unique identifier for Prompt.

Query parameters

version_idstring

A specific Version ID of the Prompt to retrieve.

environmentstring

Name of the Environment to retrieve a deployed Version from.

Response

Successful Response

pathstring required

Path of the Prompt, including the name, which is used as a unique identifier.

idstring required

Unique identifier for the Prompt.

directory_idstring

ID of the directory that the file is in on Humanloop.

modelstring required

The model instance used, e.g. gpt-4. See supported models

endpoint'complete' | 'chat' | 'edit'

Supported model provider endpoints.

template_language'default' | 'jinja'

Template engine to use for rendering templates.

provider'anthropic' | 'bedrock' | 'cohere' | 'deepseek' | 'google' | 'groq' | 'mock' | 'openai' | 'openai_azure' | 'replicate'

Supported model providers.

max_tokensinteger

The maximum number of tokens to generate. Provide max_tokens=-1 to dynamically calculate the maximum number of tokens to generate given the length of the prompt

temperaturenumber double

What sampling temperature to use when making a generation. Higher values means the model will be more creative.

top_pnumber double

An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.

presence_penaltynumber double

Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the generation so far.

frequency_penaltynumber double

Number between -2.0 and 2.0. Positive values penalize new tokens based on how frequently they appear in the generation so far.

otherobject

Other parameter values to be passed to the provider call.

seedinteger

If specified, model will make a best effort to sample deterministically, but it is not guaranteed.

attributesobject

Additional fields to describe the Prompt. Helpful to separate Prompt versions from each other with details on how they were created or used.

version_namestring

Unique name for the Prompt version. Version names must be unique for a given Prompt.

version_descriptionstring

Description of the version, e.g., the changes made in this version.

descriptionstring

Description of the Prompt.

tagsstring[]

List of tags associated with the file.

readmestring

Long description of the file.

namestring required

Name of the Prompt.

schemaobject

The JSON schema for the Prompt.

version_idstring required

Unique identifier for the specific Prompt Version. If no query params provided, the default deployed Prompt Version is returned.

type'prompt'
created_atstring date-time required
updated_atstring date-time required
created_byunknown
last_used_atstring date-time required
version_logs_countinteger required

The number of logs that have been generated for this Prompt Version

total_logs_countinteger required

The number of logs that have been generated across all Prompt Versions

raw_file_contentstring

The raw content of the Prompt. Corresponds to the .prompt file.

Changes

No recorded changes to this operation across all 1 revision of this API.