跳到主要内容

aiProfilesTestConnection

aiProfilesTestConnection_200_response aiProfilesTestConnection(AiProfilesTestConnectionRequest)

POST /api/2.0/ai/profiles/test-connection

Test a profile's provider

Probes a stored profile's credentials against its provider and reports the outcome in the answer, writing nothing - this is what a Test button calls so that a failure does not commit anything. profileId is required and may be sent in the body or as a query parameter. The result is carried in the body rather than in the status, so a failed probe still answers 200 and the caller has to read the payload. To validate credentials that are not stored yet, use POST api/2.0/ai/profiles/list-provider-models.

Parameters​

NameInTypeDescriptionNotes
AiProfilesTestConnectionRequestbodyStringThe ID of the profile to probe, as a bare JSON string.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The outcome of the probe. A failed probe is reported here, not as a status.aiProfilesTestConnection_200_response-
400profileId is missing.AiErrorResponse-
401Missing asc_auth_key cookie or Authorization header.AiErrorResponse-
403AI is disabled for this portal, the caller is a guest, or the room named by entityId is one the caller cannot open. Relayed from the DocSpace AI service or the Files API.AiErrorResponse-
413The request body is larger than 100 KB, the JSON parser's limit on this route.AiErrorResponse-
500Unhandled failure. The reason is logged server-side and never echoed back.AiErrorResponse-

Return type​

aiProfilesTestConnection_200_response

Authorization​

cookieAuth, bearerAuth

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json