Introducing Confident Voice: Watch the Launch Video Now

Push Prompt

(v2)

POST

Creates a new commit for the prompt with the given alias, creating the prompt first when it does not exist. Send text for a text prompt or messages for a messages prompt, not both.

POST/v2/prompts
curl -X POST "https://api.confident-ai.com/v2/prompts" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Hello, {{name}}! How can I help you today?",
  "alias": "greeting",
  "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": {
    "title": "Greeting",
    "type": "object",
    "properties": {
      "greeting": {
        "type": "string"
      }
    },
    "required": [
      "greeting"
    ],
    "additionalProperties": false
  },
  "tools": [
    {
      "id": "<TOOL-ID>",
      "version": "00.00.01"
    }
  ],
  "branch": "main",
  "imagesMapping": {}
}'
200
{
  "success": true,
  "data": {
    "promptId": "<PROMPT-ID>",
    "hash": "bab04ce"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/prompt-studio/<PROMPT-ID>?branch=<BRANCH-NAME>",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • Text Prompt Inputobject

    Pushes a commit to a text prompt. interpolationType defaults to FSTRING when omitted.

    Show 9 propertiesHide 9 properties
    • textstringRequired

      The text content of the prompt.

    • aliasstringRequired

      The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.

    • interpolationTypeenum

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

      Show 5 enum valuesHide 5 enum values
      • MUSTACHE
      • MUSTACHE_WITH_SPACE
      • FSTRING
      • DOLLAR_BRACKETS
      • JINJA
    • modelSettingsobject

      This is the model settings the prompt was authored for.

      Show 11 propertiesHide 11 properties
      • providerenum

        This is the provider of the model.

        Show 21 enum valuesHide 21 enum values
        • OPEN_AI
        • CUSTOM
        • CONFIDENT_AI
        • BEDROCK
        • ANTHROPIC
        • GEMINI
        • X_AI
        • DEEPSEEK
        • MOONSHOT_AI
        • VERTEX_AI
        • AZURE
        • MISTRAL
        • PERPLEXITY
        • OPEN_ROUTER
        • PORTKEY
        • LITE_LLM
        • TRUE_FOUNDRY
        • HUGGING_FACE
        • TYPE_SAFE
        • FAL
        • Z_AI
      • namestring

        This is the name of the model.

      • temperaturenumber

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

      • maxTokensnumber

        This is the maximum number of tokens to generate.

      • topPnumber

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

      • topKnumber

        This limits sampling to the K most likely tokens at each step.

      • 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

      The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.

    • toolslist of objects

      The tools available to the prompt. The commit pins each one at a version.

      Show 6 propertiesHide 6 properties
      • idstring

        The id of an existing tool. Omit it to use name instead.

      • versionstring

        The version to pin. Omit it to use the latest version.

      • namestring

        The name of the tool. Without id, the tool with this name is used or created; with id, a new name renames it.

      • descriptionstring | null

        What the tool does.

      • modeenum

        This 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_ADDITIONAL
        • NO_ADDITIONAL
        • STRICT
      • schemaobject

        The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.

    • branchstring

      The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.

    • imagesMappingobject

      Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.

  • OR
  • Messages Prompt Inputobject

    Pushes a commit to a messages prompt. interpolationType defaults to FSTRING when omitted.

    Show 9 propertiesHide 9 properties
    • messageslist of objectsRequired

      The list of messages that make up the prompt.

      Show 4 propertiesHide 4 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.

      • tool_callslist of objects

        Tool calls made by an assistant message, in the OpenAI chat format.

        Show 3 propertiesHide 3 properties
        • idstringRequired

        • typeenumRequired

          Show 1 enum valueHide 1 enum value
          • function
        • functionobjectRequired

          Show 2 propertiesHide 2 properties
          • namestringRequired

          • argumentsstringRequired

            JSON-encoded arguments passed to the tool.

      • tool_call_idstring

        For tool messages, the id of the assistant tool call this result answers.

    • aliasstringRequired

      The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.

    • interpolationTypeenum

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

      Show 5 enum valuesHide 5 enum values
      • MUSTACHE
      • MUSTACHE_WITH_SPACE
      • FSTRING
      • DOLLAR_BRACKETS
      • JINJA
    • modelSettingsobject

      This is the model settings the prompt was authored for.

      Show 11 propertiesHide 11 properties
      • providerenum

        This is the provider of the model.

        Show 21 enum valuesHide 21 enum values
        • OPEN_AI
        • CUSTOM
        • CONFIDENT_AI
        • BEDROCK
        • ANTHROPIC
        • GEMINI
        • X_AI
        • DEEPSEEK
        • MOONSHOT_AI
        • VERTEX_AI
        • AZURE
        • MISTRAL
        • PERPLEXITY
        • OPEN_ROUTER
        • PORTKEY
        • LITE_LLM
        • TRUE_FOUNDRY
        • HUGGING_FACE
        • TYPE_SAFE
        • FAL
        • Z_AI
      • namestring

        This is the name of the model.

      • temperaturenumber

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

      • maxTokensnumber

        This is the maximum number of tokens to generate.

      • topPnumber

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

      • topKnumber

        This limits sampling to the K most likely tokens at each step.

      • 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

      The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.

    • toolslist of objects

      The tools available to the prompt. The commit pins each one at a version.

      Show 6 propertiesHide 6 properties
      • idstring

        The id of an existing tool. Omit it to use name instead.

      • versionstring

        The version to pin. Omit it to use the latest version.

      • namestring

        The name of the tool. Without id, the tool with this name is used or created; with id, a new name renames it.

      • descriptionstring | null

        What the tool does.

      • modeenum

        This 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_ADDITIONAL
        • NO_ADDITIONAL
        • STRICT
      • schemaobject

        The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.

    • branchstring

      The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.

    • imagesMappingobject

      Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.

Response

Push Prompt succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    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.

    • hashstring

      This is the hash of the commit created by this push, not to be confused with a version number.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI