Get Connection
GEThttps://api.confident-ai.com/v2/ai-connections/{aiConnectionId}
Retrieves an AI connection by id with its full configuration: how Confident AI calls your application, and where in the response each evaluated value is read from. The stored headers, queryParams, authentication and cloudProvider are returned exactly as they were saved, so treat the response as carrying credentials.
curl -X GET "https://api.confident-ai.com/v2/ai-connections/{aiConnectionId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>"{
"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_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
aiConnectionIdstringRequiredThe id of the AI connection.
Response
Get Connection succeeded.
successbooleanIndicates if the request was successful.
dataobjectAn LLM application registered with Confident AI: how to call it, and where in its response each value being evaluated lives.
headers,queryParams,authenticationandcloudProvidercome back exactly as they were stored, credentials included.Show 38 propertiesHide 38 properties
idstringThe id of the AI connection, generated by Confident AI.
namestringThe name of the AI connection, unique within the project.
typeenumHow Confident AI reaches your LLM application: ENDPOINT calls the
endpointyou 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
ENDPOINTRELAY_ENDPOINTAGENT_HANDLER
activebooleanWhether 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 | nullThe URL Confident AI calls, or null when no endpoint has been configured.
responseModeenum | nullHow 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_RESPONSESSE_STREAMINGHTTP_STREAMINGWEBSOCKETPHONESIP
asyncResponsebooleanWhether your application acknowledges the request and posts the result back later instead of answering inline.
timeoutinteger | nullHow many seconds Confident AI waits for your application to answer, or null when no timeout is set.
maxConcurrencyinteger | nullThe most requests Confident AI sends at the same time, or null when it is unbounded.
maxRetriesinteger | nullHow many times a failed request is retried, or null when it is not retried.
defaultNumGenerationsinteger | nullHow many times your application is called per test case, or null when it is called once.
headersarray | nullThe headers sent with every request, returned with their values exactly as stored, or null when none are configured.
Show 2 propertiesHide 2 properties
keystringThe header or query parameter name.
valuestringThe value sent under this name on every request. It is stored as sent and read back as stored.
queryParamsarray | nullThe query parameters appended to every request, returned with their values exactly as stored, or null when none are configured.
Show 2 propertiesHide 2 properties
keystringThe header or query parameter name.
valuestringThe value sent under this name on every request. It is stored as sent and read back as stored.
payloadobject | nullThe request body template sent to your application, with its placeholders unresolved, or null when none is configured.
payloadModeenumWhere the request body sent to your application comes from: JSON when it is the stored
payloadtemplate, CODE when it is built by a code definition authored on the Confident AI platform. Sendingpayloadthrough the API sets this to JSON.Show 2 enum valuesHide 2 enum values
JSONCODE
hyperparametersobject | nullThe settings recorded against every test run made through this connection, or null when none are configured.
authenticationobject | nullThe authentication configuration applied when calling your application, returned exactly as stored, or null when none is configured.
cloudProviderobject | nullThe cloud vault configuration used to pull credentials at call time, returned exactly as stored, or null when none is configured.
actualOutputKeyPathlist of string | integerThe 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 | integerThe 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 | integerThe 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 | integerThe 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 | integerThe 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 | integerThe 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 | integerThe 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 | nullThe id of the transformer that extracts the answer, or null when a key path does it instead.
retrievalContextTransformerIdstring | nullThe id of the transformer that extracts the retrieved context, or null when a key path does it instead.
toolsCalledTransformerIdstring | nullThe id of the transformer that extracts the tools called, or null when a key path does it instead.
stateTransformerIdstring | nullThe id of the transformer that extracts the conversation state, or null when a key path does it instead.
inputTokenCountTransformerIdstring | nullThe id of the transformer that extracts the prompt token count, or null when a key path does it instead.
outputTokenCountTransformerIdstring | nullThe id of the transformer that extracts the completion token count, or null when a key path does it instead.
tokenCostTransformerIdstring | nullThe id of the transformer that extracts the cost of the call, or null when a key path does it instead.
actualOutputEventstring | nullFor a streaming
responseMode, the event whose data carries the answer, or null when the answer is read out of a completed body.retrievalContextEventstring | nullFor a streaming
responseMode, the event whose data carries the retrieved context, or null when it is read out of a completed body.toolsCalledEventstring | nullFor a streaming
responseMode, the event whose data carries the tools called, or null when they are read out of a completed body.stateEventstring | nullFor a streaming
responseMode, the event whose data carries the conversation state, or null when it is read out of a completed body.actualOutputAccumulatebooleanFor a streaming
responseMode, whether the chunks arriving onactualOutputEventare joined into one answer rather than only the last one being kept.promptsobject | nullThe prompts substituted into the request body, keyed by the placeholder they fill, or null when the connection references none.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.