Ping AI Connection
(v2)POST
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. A ping that fails is still a 200: read active and error in the body rather than the status code.
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
}'{
"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_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
aiConnectionIdstringRequiredThe id of the AI connection.
Request body
multiturnbooleanWhether to test the connection over a simulated multi-turn conversation instead of a single call. Defaults to
false.
Response
Ping AI Connection succeeded.
successbooleanIndicates if the request was successful.
dataobjectWhat 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
activefalserather than as an error status.Show 21 propertiesHide 21 properties
activebooleanWhether your application answered and Confident AI could read the configured values out of its response. This verdict replaces the connection's stored
active.errorstring | nullWhy the ping failed, or
nullwhen it succeeded. A failed ping is still a 200 response withactivefalse, so read this rather than the status code.statusCodeinteger | nullThe HTTP status your application returned: 408 when it timed out, 500 when the call could not be made at all, and
nullwhen no call was attempted.timeTakennumber | nullHow long the call took in seconds, or
nullwhen no call was attempted.requestobject | nullThe body that was sent, with the payload placeholders and prompts resolved, or
nullwhen no call was attempted.responseobject | nullYour 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 | nullThe unparsed response body, for applications that do not answer with JSON. Null when the response parsed.
actualOutputstring | nullWhat
actualOutputKeyPathor the actual output transformer pulled out of the response. Check it to confirm the connection reads the field you expect.retrievalContextarray | nullWhat was pulled out as the retrieved context, or
nullwhen the connection extracts none.toolsCalledarray | nullWhat was pulled out as the tools called, or
nullwhen the connection extracts none.stateobject | nullWhat was pulled out as the conversation state, or
nullwhen the connection extracts none.inputTokenCountnumber | nullWhat was pulled out as the prompt token count, or
nullwhen the connection extracts none.outputTokenCountnumber | nullWhat was pulled out as the completion token count, or
nullwhen the connection extracts none.tokenCostnumber | nullWhat was pulled out as the cost of the call, or
nullwhen the connection extracts none.invalidActualOutputbooleanWhether the answer was found at its key path but is not a string, which means the path points at the wrong field.
invalidRetrievalContextbooleanWhether the retrieved context was found but is not a list of strings.
invalidToolsCalledbooleanWhether the tools called were found but are not a list of tool calls.
invalidStatebooleanWhether the conversation state was found but could not be read.
invalidInputTokenCountbooleanWhether the prompt token count was found but is not a number.
invalidOutputTokenCountbooleanWhether the completion token count was found but is not a number.
invalidTokenCostbooleanWhether the cost of the call was found but is not a number.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.