Launch Week 02 wrapped — explore all five launches

Ping Connection

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

Calls your LLM application once with a sample test case and reports what came back, including what each configured key path or transformer managed to extract. Use it to confirm a connection works before running an evaluation through it. The verdict replaces the connection's stored active. A ping that fails is still a 200 response: read active and error in the body rather than the status code.

POST/v2/ai-connections/{aiConnectionId}/ping
curl -X POST "https://api.confident-ai.com/v2/ai-connections/{aiConnectionId}/ping" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "multiturn": false
}'
200
{
  "success": true,
  "data": {
    "active": true,
    "error": null,
    "statusCode": 200,
    "timeTaken": 1.42,
    "request": {
      "query": "How tall is Mount Everest?"
    },
    "response": {
      "choices": [
        {
          "message": {
            "content": "Mount Everest is 8,848 metres tall."
          }
        }
      ]
    },
    "rawResponse": null,
    "actualOutput": "Mount Everest is 8,848 metres tall.",
    "retrievalContext": null,
    "toolsCalled": null,
    "state": null,
    "inputTokenCount": 18,
    "outputTokenCount": 9,
    "tokenCost": 0.002,
    "invalidActualOutput": false,
    "invalidRetrievalContext": false,
    "invalidToolsCalled": false,
    "invalidState": false,
    "invalidInputTokenCount": false,
    "invalidOutputTokenCount": false,
    "invalidTokenCost": false
  },
  "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

  • multiturnboolean

    Whether to test the connection over a simulated multi-turn conversation instead of a single call. Defaults to false.

Response

Ping Connection succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    What one test call to your application produced: whether it answered, what it sent back, and what Confident AI managed to extract from it. A ping that failed is reported here with active false rather than as an error status.

    Show 21 propertiesHide 21 properties
    • activeboolean

      Whether your application answered and Confident AI could read the configured values out of its response. This verdict replaces the connection's stored active.

    • errorstring | null

      Why the ping failed, or null when it succeeded. A failed ping is still a 200 response with active false, so read this rather than the status code.

    • statusCodeinteger | null

      The HTTP status your application returned: 408 when it timed out, 500 when the call could not be made at all, and null when no call was attempted.

    • timeTakennumber | null

      How long the call took in seconds, or null when no call was attempted.

    • requestobject | null

      The body that was sent, with the payload placeholders and prompts resolved, or null when no call was attempted.

    • responseobject | null

      Your application's parsed response body. This is where to look for the real response shape behind a key path that read nothing, and it carries the reason when the call itself failed.

    • rawResponsestring | null

      The unparsed response body, for applications that do not answer with JSON. Null when the response parsed.

    • actualOutputstring | null

      What actualOutputKeyPath or the actual output transformer pulled out of the response. Check it to confirm the connection reads the field you expect.

    • retrievalContextarray | null

      What was pulled out as the retrieved context, or null when the connection extracts none.

    • toolsCalledarray | null

      What was pulled out as the tools called, or null when the connection extracts none.

    • stateobject | null

      What was pulled out as the conversation state, or null when the connection extracts none.

    • inputTokenCountnumber | null

      What was pulled out as the prompt token count, or null when the connection extracts none.

    • outputTokenCountnumber | null

      What was pulled out as the completion token count, or null when the connection extracts none.

    • tokenCostnumber | null

      What was pulled out as the cost of the call, or null when the connection extracts none.

    • invalidActualOutputboolean

      Whether the answer was found at its key path but is not a string, which means the path points at the wrong field.

    • invalidRetrievalContextboolean

      Whether the retrieved context was found but is not a list of strings.

    • invalidToolsCalledboolean

      Whether the tools called were found but are not a list of tool calls.

    • invalidStateboolean

      Whether the conversation state was found but could not be read.

    • invalidInputTokenCountboolean

      Whether the prompt token count was found but is not a number.

    • invalidOutputTokenCountboolean

      Whether the completion token count was found but is not a number.

    • invalidTokenCostboolean

      Whether the cost of the call was found but is not a number.

  • linkstring

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

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI