Launch Week 02 wrapped — explore all five launches

Update Connection

PUThttps://api.confident-ai.com/v2/ai-connections/{aiConnectionId}

Changes an AI connection and returns it. Only the fields you send are touched, and headers, queryParams and prompts each replace the stored collection rather than merging into it. Changing anything that affects how your application is called re-tests the connection, so active in the response is the fresh verdict.

PUT/v2/ai-connections/{aiConnectionId}
curl -X PUT "https://api.confident-ai.com/v2/ai-connections/{aiConnectionId}" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Production Chatbot",
  "type": "ENDPOINT",
  "endpoint": "https://api.example.com/chat",
  "responseMode": "HTTP_RESPONSE",
  "asyncResponse": false,
  "timeout": 60,
  "maxConcurrency": 5,
  "maxRetries": 3,
  "defaultNumGenerations": 1,
  "headers": [
    {
      "key": "Authorization",
      "value": "Bearer YOUR-TOKEN"
    },
    {
      "key": "Content-Type",
      "value": "application/json"
    }
  ],
  "queryParams": [
    {
      "key": "stream",
      "value": "false"
    }
  ],
  "payload": {
    "query": "{{input}}"
  },
  "hyperparameters": {
    "model": "gpt-4o",
    "temperature": 0.2
  },
  "authentication": {
    "type": "AUTH0",
    "domain": "acme.us.auth0.com",
    "clientId": "YOUR-CLIENT-ID",
    "clientSecret": "YOUR-CLIENT-SECRET"
  },
  "cloudProvider": {
    "provider": "AWS",
    "region": "us-east-1",
    "secretName": "chatbot/api-key"
  },
  "actualOutputKeyPath": [
    "choices",
    0,
    "message",
    "content"
  ],
  "retrievalContextKeyPath": [
    "retrieval",
    "documents"
  ],
  "toolsCalledKeyPath": [
    "tool_calls"
  ],
  "stateKeyPath": [
    "session",
    "state"
  ],
  "inputTokenCountKeyPath": [
    "usage",
    "prompt_tokens"
  ],
  "outputTokenCountKeyPath": [
    "usage",
    "completion_tokens"
  ],
  "tokenCostKeyPath": [
    "usage",
    "cost"
  ],
  "actualOutputEvent": "token",
  "retrievalContextEvent": "retrieval",
  "toolsCalledEvent": "tool_call",
  "stateEvent": "state",
  "actualOutputAccumulate": true,
  "actualOutputTransformerId": "<TRANSFORMER-ID>",
  "retrievalContextTransformerId": "<TRANSFORMER-ID>",
  "toolsCalledTransformerId": "<TRANSFORMER-ID>",
  "stateTransformerId": "<TRANSFORMER-ID>",
  "inputTokenCountTransformerId": "<TRANSFORMER-ID>",
  "outputTokenCountTransformerId": "<TRANSFORMER-ID>",
  "tokenCostTransformerId": "<TRANSFORMER-ID>",
  "prompts": {
    "systemPrompt": {
      "alias": "customer-support",
      "label": "production"
    }
  }
}'
200
{
  "success": true,
  "data": {
    "id": "<AI-CONNECTION-ID>",
    "name": "Production Chatbot",
    "type": "ENDPOINT",
    "active": true,
    "endpoint": "https://api.example.com/chat",
    "responseMode": "HTTP_RESPONSE",
    "asyncResponse": false,
    "timeout": 60,
    "maxConcurrency": 5,
    "maxRetries": 3,
    "defaultNumGenerations": 1,
    "headers": [
      {
        "key": "Authorization",
        "value": "Bearer YOUR-TOKEN"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "queryParams": [
      {
        "key": "stream",
        "value": "false"
      }
    ],
    "payload": {
      "query": "{{input}}"
    },
    "payloadMode": "JSON",
    "hyperparameters": {
      "model": "gpt-4o",
      "temperature": 0.2
    },
    "authentication": {
      "type": "AUTH0",
      "domain": "acme.us.auth0.com",
      "clientId": "YOUR-CLIENT-ID",
      "clientSecret": "YOUR-CLIENT-SECRET"
    },
    "cloudProvider": {
      "provider": "AWS",
      "region": "us-east-1",
      "secretName": "chatbot/api-key"
    },
    "actualOutputKeyPath": [
      "choices",
      0,
      "message",
      "content"
    ],
    "retrievalContextKeyPath": [
      "retrieval",
      "documents"
    ],
    "toolsCalledKeyPath": [
      "tool_calls"
    ],
    "stateKeyPath": [
      "session",
      "state"
    ],
    "inputTokenCountKeyPath": [
      "usage",
      "prompt_tokens"
    ],
    "outputTokenCountKeyPath": [
      "usage",
      "completion_tokens"
    ],
    "tokenCostKeyPath": [
      "usage",
      "cost"
    ],
    "actualOutputTransformerId": null,
    "retrievalContextTransformerId": null,
    "toolsCalledTransformerId": null,
    "stateTransformerId": null,
    "inputTokenCountTransformerId": null,
    "outputTokenCountTransformerId": null,
    "tokenCostTransformerId": null,
    "actualOutputEvent": null,
    "retrievalContextEvent": null,
    "toolsCalledEvent": null,
    "stateEvent": null,
    "actualOutputAccumulate": true,
    "prompts": {
      "systemPrompt": {
        "alias": "customer-support",
        "label": "production"
      }
    }
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/ai-connections/<AI-CONNECTION-ID>",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • aiConnectionIdstringRequired

    The id of the AI connection.

Request body

  • namestring

    The name of the AI connection, unique within the project.

  • typeenum

    How Confident AI reaches your LLM application: ENDPOINT calls the endpoint you registered, RELAY_ENDPOINT calls it through the Confident AI relay so it never leaves your network boundary, and AGENT_HANDLER expects your own runner to pull work rather than being called, so it needs no endpoint. Defaults to ENDPOINT.

    Show 3 enum valuesHide 3 enum values
    • ENDPOINT
    • RELAY_ENDPOINT
    • AGENT_HANDLER
  • endpointstring | null

    The https:// URL Confident AI calls to reach your LLM application, or a wss:// URL when responseMode is WEBSOCKET. An AGENT_HANDLER connection needs none. Send null to clear it.

  • responseModeenum | null

    How your application replies. HTTP_RESPONSE returns one completed body. SSE_STREAMING, HTTP_STREAMING and WEBSOCKET stream the answer, so the values are read from named events as they arrive rather than out of a finished body, and WEBSOCKET requires a wss:// endpoint. PHONE and SIP are voice connections placed over a telephony provider.

    Show 6 enum valuesHide 6 enum values
    • HTTP_RESPONSE
    • SSE_STREAMING
    • HTTP_STREAMING
    • WEBSOCKET
    • PHONE
    • SIP
  • asyncResponseboolean

    Whether your application acknowledges the request and posts the result back later instead of answering inline. Only a non-streaming responseMode supports this.

  • timeoutinteger | null

    How many seconds to wait for your application to answer before giving up on a request. Defaults to 60 when the connection is created. Send null to clear it.

  • maxConcurrencyinteger | null

    The most requests Confident AI sends to your application at the same time. Send null to leave it unbounded.

  • maxRetriesinteger | null

    How many times a failed request is retried before the test case is recorded as errored. Send null to clear it.

  • defaultNumGenerationsinteger

    How many times your application is called per test case, so one unlucky output does not decide the result. At most 50.

  • headersarray | null

    The headers sent with every request. The list replaces the stored headers rather than merging into them, so include every header the connection should keep. Send null to clear them.

    Show 2 propertiesHide 2 properties
    • keystringRequired

      The header or query parameter name.

    • valuestringRequired

      The value sent under this name on every request. It is stored as sent and read back as stored.

  • queryParamsarray | null

    The query parameters appended to every request. The list replaces the stored parameters rather than merging into them. Send null to clear them.

    Show 2 propertiesHide 2 properties
    • keystringRequired

      The header or query parameter name.

    • valuestringRequired

      The value sent under this name on every request. It is stored as sent and read back as stored.

  • payloadobject | null

    The request body template Confident AI sends. Placeholders such as {{input}} are filled from the test case, and any key in prompts is filled with that prompt's text. Send null to clear it.

  • hyperparametersobject | null

    Free-form settings recorded against every test run made through this connection, so results can be compared across configurations. They are not sent to your application. Send null to clear them.

  • authenticationobject | null

    The authentication configuration Confident AI applies when calling your application, such as Auth0, HMAC or Azure AD settings. Its shape follows the scheme you configure, and it is stored as sent and read back as stored. Send null to clear it.

  • cloudProviderobject | null

    The cloud vault configuration Confident AI uses to pull credentials at call time instead of holding them itself. Its shape follows the provider you configure, and it is stored as sent and read back as stored. Send null to clear it.

  • actualOutputKeyPatharray | null

    Where your application's answer sits in its response. Each element is an object key or an array index, walked in order, so ["choices", 0, "message", "content"] reads choices[0].message.content. A connection needs this or actualOutputTransformerId before it can be used. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • retrievalContextKeyPatharray | null

    Where the retrieved context sits in your application's response, walked the same way as actualOutputKeyPath. Set it for RAG applications so retrieval metrics have something to score. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • toolsCalledKeyPatharray | null

    Where the list of tools your application called sits in its response, walked the same way as actualOutputKeyPath. Set it for agents so tool-use metrics have something to score. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • stateKeyPatharray | null

    Where the conversation state sits in your application's response, walked the same way as actualOutputKeyPath. Confident AI reads it after each simulated turn and sends it back on the next one. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • inputTokenCountKeyPatharray | null

    Where the prompt token count sits in your application's response, walked the same way as actualOutputKeyPath. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • outputTokenCountKeyPatharray | null

    Where the completion token count sits in your application's response, walked the same way as actualOutputKeyPath. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • tokenCostKeyPatharray | null

    Where the cost of the call sits in your application's response, walked the same way as actualOutputKeyPath. Send null or an empty list to clear it.

    Show 2 variantsHide 2 variants
    • string

    • OR
    • integer

  • actualOutputEventstring | null

    For a streaming responseMode, the name of the event carrying your application's answer. Confident AI reads the value out of the events with this name instead of out of a completed body, applying actualOutputKeyPath to each one. Send null to clear it.

  • retrievalContextEventstring | null

    For a streaming responseMode, the name of the event carrying the retrieved context, read the same way as actualOutputEvent. Send null to clear it.

  • toolsCalledEventstring | null

    For a streaming responseMode, the name of the event carrying the tools called, read the same way as actualOutputEvent. Send null to clear it.

  • stateEventstring | null

    For a streaming responseMode, the name of the event carrying the conversation state, read the same way as actualOutputEvent. Send null to clear it.

  • actualOutputAccumulateboolean

    For a streaming responseMode, whether the chunks arriving on actualOutputEvent are joined into one answer. Set it to false when each event already carries the whole answer and only the last one counts.

  • actualOutputTransformerIdstring | null

    The id of a transformer that extracts the answer by running your code over the response, for shapes a key path cannot reach. Send this or actualOutputKeyPath, never both. The transformer must belong to this project. Send null to clear it.

  • retrievalContextTransformerIdstring | null

    The id of a transformer that extracts the retrieved context. Send this or retrievalContextKeyPath, never both. Send null to clear it.

  • toolsCalledTransformerIdstring | null

    The id of a transformer that extracts the tools called. Send this or toolsCalledKeyPath, never both. Send null to clear it.

  • stateTransformerIdstring | null

    The id of a transformer that extracts the conversation state. Send this or stateKeyPath, never both. Send null to clear it.

  • inputTokenCountTransformerIdstring | null

    The id of a transformer that extracts the prompt token count. Send this or inputTokenCountKeyPath, never both. Send null to clear it.

  • outputTokenCountTransformerIdstring | null

    The id of a transformer that extracts the completion token count. Send this or outputTokenCountKeyPath, never both. Send null to clear it.

  • tokenCostTransformerIdstring | null

    The id of a transformer that extracts the cost of the call. Send this or tokenCostKeyPath, never both. Send null to clear it.

  • promptsobject | null

    The prompts to substitute into the request body, keyed by the placeholder they fill in payload. The map replaces the connection's current prompts rather than merging into them.

Response

Update Connection succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    An LLM application registered with Confident AI: how to call it, and where in its response each value being evaluated lives. headers, queryParams, authentication and cloudProvider come back exactly as they were stored, credentials included.

    Show 38 propertiesHide 38 properties
    • idstring

      The id of the AI connection, generated by Confident AI.

    • namestring

      The name of the AI connection, unique within the project.

    • typeenum

      How Confident AI reaches your LLM application: ENDPOINT calls the endpoint you registered, RELAY_ENDPOINT calls it through the Confident AI relay so it never leaves your network boundary, and AGENT_HANDLER expects your own runner to pull work rather than being called, so it needs no endpoint. Defaults to ENDPOINT.

      Show 3 enum valuesHide 3 enum values
      • ENDPOINT
      • RELAY_ENDPOINT
      • AGENT_HANDLER
    • activeboolean

      Whether Confident AI could last reach your application and read an answer out of its response. Computed by Confident AI whenever the configuration changes or the connection is pinged, not writable.

    • endpointstring | null

      The URL Confident AI calls, or null when no endpoint has been configured.

    • responseModeenum | null

      How your application replies. HTTP_RESPONSE returns one completed body. SSE_STREAMING, HTTP_STREAMING and WEBSOCKET stream the answer, so the values are read from named events as they arrive rather than out of a finished body, and WEBSOCKET requires a wss:// endpoint. PHONE and SIP are voice connections placed over a telephony provider.

      Show 6 enum valuesHide 6 enum values
      • HTTP_RESPONSE
      • SSE_STREAMING
      • HTTP_STREAMING
      • WEBSOCKET
      • PHONE
      • SIP
    • asyncResponseboolean

      Whether your application acknowledges the request and posts the result back later instead of answering inline.

    • timeoutinteger | null

      How many seconds Confident AI waits for your application to answer, or null when no timeout is set.

    • maxConcurrencyinteger | null

      The most requests Confident AI sends at the same time, or null when it is unbounded.

    • maxRetriesinteger | null

      How many times a failed request is retried, or null when it is not retried.

    • defaultNumGenerationsinteger | null

      How many times your application is called per test case, or null when it is called once.

    • headersarray | null

      The headers sent with every request, returned with their values exactly as stored, or null when none are configured.

      Show 2 propertiesHide 2 properties
      • keystring

        The header or query parameter name.

      • valuestring

        The value sent under this name on every request. It is stored as sent and read back as stored.

    • queryParamsarray | null

      The query parameters appended to every request, returned with their values exactly as stored, or null when none are configured.

      Show 2 propertiesHide 2 properties
      • keystring

        The header or query parameter name.

      • valuestring

        The value sent under this name on every request. It is stored as sent and read back as stored.

    • payloadobject | null

      The request body template sent to your application, with its placeholders unresolved, or null when none is configured.

    • payloadModeenum

      Where the request body sent to your application comes from: JSON when it is the stored payload template, CODE when it is built by a code definition authored on the Confident AI platform. Sending payload through the API sets this to JSON.

      Show 2 enum valuesHide 2 enum values
      • JSON
      • CODE
    • hyperparametersobject | null

      The settings recorded against every test run made through this connection, or null when none are configured.

    • authenticationobject | null

      The authentication configuration applied when calling your application, returned exactly as stored, or null when none is configured.

    • cloudProviderobject | null

      The cloud vault configuration used to pull credentials at call time, returned exactly as stored, or null when none is configured.

    • actualOutputKeyPathlist of string | integer

      The path walked through your application's response to find its answer, each element an object key or an array index. Empty when a transformer extracts the answer instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • retrievalContextKeyPathlist of string | integer

      The path walked to find the retrieved context. Empty when a transformer extracts it instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • toolsCalledKeyPathlist of string | integer

      The path walked to find the tools your application called. Empty when a transformer extracts them instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • stateKeyPathlist of string | integer

      The path walked to find the conversation state carried between simulated turns. Empty when a transformer extracts it instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • inputTokenCountKeyPathlist of string | integer

      The path walked to find the prompt token count. Empty when a transformer extracts it instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • outputTokenCountKeyPathlist of string | integer

      The path walked to find the completion token count. Empty when a transformer extracts it instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • tokenCostKeyPathlist of string | integer

      The path walked to find the cost of the call. Empty when a transformer extracts it instead, or when nothing is configured.

      Show 2 variantsHide 2 variants
      • string

      • OR
      • integer

    • actualOutputTransformerIdstring | null

      The id of the transformer that extracts the answer, or null when a key path does it instead.

    • retrievalContextTransformerIdstring | null

      The id of the transformer that extracts the retrieved context, or null when a key path does it instead.

    • toolsCalledTransformerIdstring | null

      The id of the transformer that extracts the tools called, or null when a key path does it instead.

    • stateTransformerIdstring | null

      The id of the transformer that extracts the conversation state, or null when a key path does it instead.

    • inputTokenCountTransformerIdstring | null

      The id of the transformer that extracts the prompt token count, or null when a key path does it instead.

    • outputTokenCountTransformerIdstring | null

      The id of the transformer that extracts the completion token count, or null when a key path does it instead.

    • tokenCostTransformerIdstring | null

      The id of the transformer that extracts the cost of the call, or null when a key path does it instead.

    • actualOutputEventstring | null

      For a streaming responseMode, the event whose data carries the answer, or null when the answer is read out of a completed body.

    • retrievalContextEventstring | null

      For a streaming responseMode, the event whose data carries the retrieved context, or null when it is read out of a completed body.

    • toolsCalledEventstring | null

      For a streaming responseMode, the event whose data carries the tools called, or null when they are read out of a completed body.

    • stateEventstring | null

      For a streaming responseMode, the event whose data carries the conversation state, or null when it is read out of a completed body.

    • actualOutputAccumulateboolean

      For a streaming responseMode, whether the chunks arriving on actualOutputEvent are joined into one answer rather than only the last one being kept.

    • promptsobject | null

      The prompts substituted into the request body, keyed by the placeholder they fill, or null when the connection references none.

  • linkstring

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

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI