Pull By Commit
GEThttps://api.confident-ai.com/v2/prompts/{promptId}/commits/{hash}
Retrieves the prompt commit with the given hash. The commit is looked up on main unless a branch is given.
curl -X GET "https://api.confident-ai.com/v2/prompts/{promptId}/commits/{hash}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"success": true,
"data": {
"text": "Hello, {{name}}! How can I help you today?",
"id": "<COMMIT-ID>",
"hash": "bab04ce",
"version": "00.00.01",
"label": "production",
"type": "TEXT",
"interpolationType": "MUSTACHE",
"modelSettings": {
"provider": "OPEN_AI",
"name": "gpt-4o",
"temperature": 0.7,
"maxTokens": 1024,
"topP": 1,
"topK": 40,
"frequencyPenalty": 0,
"presencePenalty": 0,
"stopSequence": [
"\n\nHuman:",
"###"
],
"reasoningEffort": "MINIMAL",
"verbosity": "LOW"
},
"outputType": "TEXT",
"outputSchema": {
"name": "Greeting",
"fields": [
{
"id": "<FIELD-ID>",
"name": "greeting",
"type": "OBJECT",
"required": true,
"parentId": null
}
]
},
"tools": [
{
"id": "<TOOL-ID>",
"name": "get_customer_name",
"description": "Looks up the customer's name by id.",
"mode": "ALLOW_ADDITIONAL",
"structuredSchema": {
"id": "<STRUCTURED-SCHEMA-ID>",
"name": "GetCustomerNameInput",
"fields": [
{
"id": "<FIELD-ID>",
"name": "customerId",
"description": "The id of the customer to look up.",
"type": "OBJECT",
"required": true,
"parentId": null
}
]
}
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
promptIdstringRequiredThe unique id of the prompt.
hashstringRequiredThe hash of the commit to pull.
Query parameters
branchstringThe name of the branch to read from. Defaults to
mainwhen omitted.
Response
Pull By Commit succeeded.
successbooleanIndicates if the request was successful.
dataobject | objectA single commit of a prompt, as pulled by version, commit hash, or label. It carries
textwhen the prompt is a text prompt andmessageswhen it is a messages prompt, never both.Show 2 variantsHide 2 variants
Text PromptobjectA pulled prompt whose content is a single text template.
Show 11 propertiesHide 11 properties
textstringThis is the text content of the prompt.
idstringThis is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
hashstringThis is the commit hash of the prompt pulled.
versionstringThe version number of the prompt, present when the commit pulled has been released as a version.
labelstringThe user-defined label of the version pulled, present when the version carries one.
typeenumThis is the type of the prompt, which can be either a simple text or a list of messages.
Show 2 enum valuesHide 2 enum values
TEXTLIST
interpolationTypeenumThe type of interpolation format used in the prompt to insert dynamic variables.
Show 5 enum valuesHide 5 enum values
MUSTACHEMUSTACHE_WITH_SPACEFSTRINGDOLLAR_BRACKETSJINJA
modelSettingsobjectThis is the model settings the prompt was authored for.
Show 11 propertiesHide 11 properties
providerenumThis is the provider of the model.
Show 18 enum valuesHide 18 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACE
namestringThis is the name of the model.
temperaturenumberThis controls randomness in the model's output. Higher values make output more random.
maxTokensnumberThis is the maximum number of tokens to generate.
topPnumberThis controls diversity via nucleus sampling. Lower values focus on more likely tokens.
topKnumberThis limits sampling to the K most likely tokens at each step.
frequencyPenaltynumberThis is the penalty for tokens based on their frequency in the text so far.
presencePenaltynumberThis is the penalty for tokens based on whether they appear in the text so far.
stopSequencelist of stringsThis is the sequences where the model will stop generating further tokens.
reasoningEffortenumThis is the level of reasoning effort for the model.
Show 4 enum valuesHide 4 enum values
MINIMALLOWMEDIUMHIGH
verbosityenumThis is the verbosity level for model output.
Show 3 enum valuesHide 3 enum values
LOWMEDIUMHIGH
outputTypeenumThe type of output expected from the prompt.
Show 3 enum valuesHide 3 enum values
TEXTJSONSCHEMA
outputSchemaobjectThis is the output schema definition, used when
outputTypeis SCHEMA.Show 2 propertiesHide 2 properties
namestringThis is the name of the output schema.
fieldslist of objectsThis is the array of fields that define the output schema structure.
Show 5 propertiesHide 5 properties
idstringThis is the unique identifier for the schema field. Use it as the
parentIdof nested fields.namestringThis is the name of the schema field.
typeenumThis is the data type of a schema field.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANNULL
requiredbooleanThis indicates whether the field is required in the output.
parentIdstring | nullThis is the id of the parent field for nested structures, or null for a top-level field.
toolslist of objectsThis is the list of tools available to the prompt.
Show 5 propertiesHide 5 properties
idstringThis is the id of the tool assigned by Confident AI.
namestringThis is the name of the tool.
descriptionstring | nullThis is the description of the tool.
modeenumThis is the mode for your tool input fields, which controls whether fields outside the schema are allowed.
Show 3 enum valuesHide 3 enum values
ALLOW_ADDITIONALNO_ADDITIONALSTRICT
structuredSchemaobjectThis is the schema for your tool's input.
Show 3 propertiesHide 3 properties
idstringThis is the id of the schema assigned by Confident AI.
namestring | nullThis is the name of the schema.
fieldslist of objectsThis is the array of fields that define the tool's input structure.
Show 6 propertiesHide 6 properties
idstringThis is the unique identifier for the schema field. Use it as the
parentIdof nested fields.namestring | nullThis is the name of the schema field.
descriptionstring | nullThis is the description of the schema field.
typeenumThis is the data type of a schema field.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANNULL
requiredbooleanThis indicates whether the field is required in the input.
parentIdstring | nullThis is the id of the parent field for nested structures, or null for a top-level field.
- OR
Messages PromptobjectA pulled prompt whose content is a list of messages.
Show 11 propertiesHide 11 properties
messageslist of objectsThis is the list of messages that make up the prompt.
Show 2 propertiesHide 2 properties
rolestringThis is the role of the message, which can be user, assistant, system, or developer.
contentstringThis is the text content of the message.
idstringThis is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
hashstringThis is the commit hash of the prompt pulled.
versionstringThe version number of the prompt, present when the commit pulled has been released as a version.
labelstringThe user-defined label of the version pulled, present when the version carries one.
typeenumThis is the type of the prompt, which can be either a simple text or a list of messages.
Show 2 enum valuesHide 2 enum values
TEXTLIST
interpolationTypeenumThe type of interpolation format used in the prompt to insert dynamic variables.
Show 5 enum valuesHide 5 enum values
MUSTACHEMUSTACHE_WITH_SPACEFSTRINGDOLLAR_BRACKETSJINJA
modelSettingsobjectThis is the model settings the prompt was authored for.
Show 11 propertiesHide 11 properties
providerenumThis is the provider of the model.
Show 18 enum valuesHide 18 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACE
namestringThis is the name of the model.
temperaturenumberThis controls randomness in the model's output. Higher values make output more random.
maxTokensnumberThis is the maximum number of tokens to generate.
topPnumberThis controls diversity via nucleus sampling. Lower values focus on more likely tokens.
topKnumberThis limits sampling to the K most likely tokens at each step.
frequencyPenaltynumberThis is the penalty for tokens based on their frequency in the text so far.
presencePenaltynumberThis is the penalty for tokens based on whether they appear in the text so far.
stopSequencelist of stringsThis is the sequences where the model will stop generating further tokens.
reasoningEffortenumThis is the level of reasoning effort for the model.
Show 4 enum valuesHide 4 enum values
MINIMALLOWMEDIUMHIGH
verbosityenumThis is the verbosity level for model output.
Show 3 enum valuesHide 3 enum values
LOWMEDIUMHIGH
outputTypeenumThe type of output expected from the prompt.
Show 3 enum valuesHide 3 enum values
TEXTJSONSCHEMA
outputSchemaobjectThis is the output schema definition, used when
outputTypeis SCHEMA.Show 2 propertiesHide 2 properties
namestringThis is the name of the output schema.
fieldslist of objectsThis is the array of fields that define the output schema structure.
Show 5 propertiesHide 5 properties
idstringThis is the unique identifier for the schema field. Use it as the
parentIdof nested fields.namestringThis is the name of the schema field.
typeenumThis is the data type of a schema field.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANNULL
requiredbooleanThis indicates whether the field is required in the output.
parentIdstring | nullThis is the id of the parent field for nested structures, or null for a top-level field.
toolslist of objectsThis is the list of tools available to the prompt.
Show 5 propertiesHide 5 properties
idstringThis is the id of the tool assigned by Confident AI.
namestringThis is the name of the tool.
descriptionstring | nullThis is the description of the tool.
modeenumThis is the mode for your tool input fields, which controls whether fields outside the schema are allowed.
Show 3 enum valuesHide 3 enum values
ALLOW_ADDITIONALNO_ADDITIONALSTRICT
structuredSchemaobjectThis is the schema for your tool's input.
Show 3 propertiesHide 3 properties
idstringThis is the id of the schema assigned by Confident AI.
namestring | nullThis is the name of the schema.
fieldslist of objectsThis is the array of fields that define the tool's input structure.
Show 6 propertiesHide 6 properties
idstringThis is the unique identifier for the schema field. Use it as the
parentIdof nested fields.namestring | nullThis is the name of the schema field.
descriptionstring | nullThis is the description of the schema field.
typeenumThis is the data type of a schema field.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANNULL
requiredbooleanThis indicates whether the field is required in the input.
parentIdstring | nullThis is the id of the parent field for nested structures, or null for a top-level field.
deprecatedbooleanIndicates if this endpoint is deprecated.