Launch Week 02 wrapped — explore all five launches

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.

POST/v1/prompts
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"
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • aliasstringRequired

    The unique alias of the prompt.

  • textstring

    The text content of the prompt. Supply this only if you are creating a text-based prompt.

  • messageslist of objects

    The list of messages that make up the prompt. Supply this only if you are creating a list-based prompt.

    Show 2 propertiesHide 2 properties
    • rolestringRequired

      This is the role of the message, which can be user, assistant, system, or developer.

    • contentstringRequired

      This is the text content of the message.

  • interpolationTypeenum

    The type of interpolation format used in the prompt to insert dynamic variables.

    Show 4 enum valuesHide 4 enum values
    • MUSTACHE
    • MUSTACHE_WITH_SPACE
    • FSTRING
    • DOLLAR_BRACKETS
  • modelSettingsobject

    This is the model settings for the prompt.

    Show 10 propertiesHide 10 properties
    • providerenum

      This is the model provider for evaluation.

      Show 2 enum valuesHide 2 enum values
      • OPEN_AI
      • ANTHROPIC
    • namestring

      This is the name of the model.

    • temperaturenumber

      This controls randomness in the model's output. Higher values make output more random.

    • maxTokensinteger

      This is the maximum number of tokens to generate.

    • topPnumber

      This controls diversity via nucleus sampling. Lower values focus on more likely tokens.

    • frequencyPenaltynumber

      This is the penalty for tokens based on their frequency in the text so far.

    • presencePenaltynumber

      This is the penalty for tokens based on whether they appear in the text so far.

    • stopSequencelist of strings

      This is the sequences where the model will stop generating further tokens.

    • reasoningEffortenum

      This is the level of reasoning effort for the model.

      Show 4 enum valuesHide 4 enum values
      • MINIMAL
      • LOW
      • MEDIUM
      • HIGH
    • verbosityenum

      This is the verbosity level for model output.

      Show 3 enum valuesHide 3 enum values
      • LOW
      • MEDIUM
      • HIGH
  • outputTypeenum

    The type of output expected from the prompt.

    Show 3 enum valuesHide 3 enum values
    • TEXT
    • JSON
    • SCHEMA
  • outputSchemaobject

    This is the output schema definition when outputType is SCHEMA.

    Show 2 propertiesHide 2 properties
    • namestringRequired

      This is the name of the output schema.

    • fieldslist of objectsRequired

      This is the array of fields that define the output schema structure.

      Show 5 propertiesHide 5 properties
      • idstringRequired

        This is the unique identifier for the schema field.

      • namestringRequired

        This is the name of the schema field.

      • typeenumRequired

        This is the data type for schema fields.

        Show 7 enum valuesHide 7 enum values
        • OBJECT
        • ARRAY
        • STRING
        • FLOAT
        • INTEGER
        • BOOLEAN
        • null
      • requiredboolean

        This indicates whether the field is required in the output.

      • parentIdstring

        This is the ID of the parent field for nested structures.

  • toolslist of objects

    Show 5 propertiesHide 5 properties
    • idstring

      This is the unique identifier for the schema field.

    • namestringRequired

      This is the name of the tool

    • descriptionstringRequired

      This is the description of the tool

    • modeenumRequired

      This is the mode for your tool input fields

      Show 3 enum valuesHide 3 enum values
      • STRICT
      • ADDITIONAL
      • NO_ADDITIONAL
    • structuredSchemaobject

      This is the schema for your tool input

      Show 2 propertiesHide 2 properties
      • namestringRequired

        This is the name of the output schema.

      • fieldslist of objectsRequired

        This is the array of fields that define the output schema structure.

        Show 5 propertiesHide 5 properties
        • idstringRequired

          This is the unique identifier for the schema field.

        • namestringRequired

          This is the name of the schema field.

        • typeenumRequired

          This is the data type for schema fields.

          Show 7 enum valuesHide 7 enum values
          • OBJECT
          • ARRAY
          • STRING
          • FLOAT
          • INTEGER
          • BOOLEAN
          • null
        • requiredboolean

          This indicates whether the field is required in the output.

        • parentIdstring

          This is the ID of the parent field for nested structures.

  • branchstring

    The name of the branch you want to push the new commit to. Defaults to "main" if not specified.

Response

  • successboolean

    This is true if the prompt was successfully created.

  • dataobject

    This maps to the prompt version id.

    Show 2 propertiesHide 2 properties
    • promptIdstring

      This is the id of the prompt generated by Confident AI, not to be confused with the alias you supplied or version number.

    • hashstring

      This is the hash of the commit created by Confident AI for pushing this prompt, not to be confused with version number.

  • linkstring

    This is the URL to redirect to after the prompt is created.

  • deprecatedboolean

    This is true if this endpoint is deprecated.

Built byConfident AI