Push Prompts
POSThttps://api.confident-ai.com/v1/prompts
Creates a new commit for an existing prompt, or creates a new prompt with the given alias otherwise.
curl -X POST "https://api.confident-ai.com/v1/prompts" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"alias": "Prompt Name",
"text": "Hello, {{name}}!",
"interpolationType": "FSTRING",
"outputType": "TEXT"
}'{
"success": true,
"data": {
"promptId": "prm_xyz456",
"hash": "bab04ce"
},
"link": "https://app.confident-ai.com/project/<PROJECT_ID>/prompt-studio/editor/prm_xyz456",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
aliasstringRequiredThe unique alias of the prompt.
textstringThe text content of the prompt. Supply this only if you are creating a text-based prompt.
messageslist of objectsThe list of messages that make up the prompt. Supply this only if you are creating a list-based prompt.
Show 2 propertiesHide 2 properties
rolestringRequiredThis is the role of the message, which can be user, assistant, system, or developer.
contentstringRequiredThis is the text content of the message.
interpolationTypeenumThe type of interpolation format used in the prompt to insert dynamic variables.
Show 4 enum valuesHide 4 enum values
MUSTACHEMUSTACHE_WITH_SPACEFSTRINGDOLLAR_BRACKETS
modelSettingsobjectThis is the model settings for the prompt.
Show 10 propertiesHide 10 properties
providerenumThis is the model provider for evaluation.
Show 2 enum valuesHide 2 enum values
OPEN_AIANTHROPIC
namestringThis is the name of the model.
temperaturenumberThis controls randomness in the model's output. Higher values make output more random.
maxTokensintegerThis is the maximum number of tokens to generate.
topPnumberThis controls diversity via nucleus sampling. Lower values focus on more likely tokens.
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 when outputType is SCHEMA.
Show 2 propertiesHide 2 properties
namestringRequiredThis is the name of the output schema.
fieldslist of objectsRequiredThis is the array of fields that define the output schema structure.
Show 5 propertiesHide 5 properties
idstringRequiredThis is the unique identifier for the schema field.
namestringRequiredThis is the name of the schema field.
typeenumRequiredThis is the data type for schema fields.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANnull
requiredbooleanThis indicates whether the field is required in the output.
parentIdstringThis is the ID of the parent field for nested structures.
toolslist of objectsShow 5 propertiesHide 5 properties
idstringThis is the unique identifier for the schema field.
namestringRequiredThis is the name of the tool
descriptionstringRequiredThis is the description of the tool
modeenumRequiredThis is the mode for your tool input fields
Show 3 enum valuesHide 3 enum values
STRICTADDITIONALNO_ADDITIONAL
structuredSchemaobjectThis is the schema for your tool input
Show 2 propertiesHide 2 properties
namestringRequiredThis is the name of the output schema.
fieldslist of objectsRequiredThis is the array of fields that define the output schema structure.
Show 5 propertiesHide 5 properties
idstringRequiredThis is the unique identifier for the schema field.
namestringRequiredThis is the name of the schema field.
typeenumRequiredThis is the data type for schema fields.
Show 7 enum valuesHide 7 enum values
OBJECTARRAYSTRINGFLOATINTEGERBOOLEANnull
requiredbooleanThis indicates whether the field is required in the output.
parentIdstringThis is the ID of the parent field for nested structures.
branchstringThe name of the branch you want to push the new commit to. Defaults to "main" if not specified.
Response
successbooleanThis is true if the prompt was successfully created.
dataobjectThis maps to the prompt version id.
Show 2 propertiesHide 2 properties
promptIdstringThis is the id of the prompt generated by Confident AI, not to be confused with the alias you supplied or version number.
hashstringThis is the hash of the commit created by Confident AI for pushing this prompt, not to be confused with version number.
linkstringThis is the URL to redirect to after the prompt is created.
deprecatedbooleanThis is true if this endpoint is deprecated.