Test an LLM connection
const url = 'http://localhost:8080/api/v1/orgs/example/llm-connections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/test';const options = { method: 'POST', headers: { cookie: 'cetra_session=<cetra_session>', 'Content-Type': 'application/json' }, body: '{"adapter":"openai","api_key":"example","base_url":"example","embedding_model":"example","extra_headers":{"additionalProperty":"example"},"model":"example","structured_output":"native"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/orgs/example/llm-connections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/test \ --header 'Content-Type: application/json' \ --cookie cetra_session=<cetra_session> \ --data '{ "adapter": "openai", "api_key": "example", "base_url": "example", "embedding_model": "example", "extra_headers": { "additionalProperty": "example" }, "model": "example", "structured_output": "native" }'Organization admins and owners. Draft fields test values that are not saved; such a test stores nothing.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Org UUID or slug.
Connection id.
Request Bodyrequired
Section titled “Request Bodyrequired”POST /api/v1/orgs/{org}/llm-connections/{id}/test body. The draft fields (adapter,
api_key, base_url, structured_output, extra_headers) have PATCH semantics: absent means
the saved value, including the saved key, which a draft base_url or adapter also uses
when api_key is absent. A test with a draft field that differs from the saved
value, or with api_key or extra_headers, stores nothing (D-I-53).
object
Draft provider API.
Draft API key. Write-only. Absent: the saved key, whatever the draft base_url.
Draft provider endpoint. An empty string means the provider’s default.
Embedding model to test instead: the test embeds "ping" and does not ask for a
judgement. Not for an Anthropic connection, which has no embeddings API.
Draft extra headers, replacing the saved ones. Values are write-only.
object
Model to call. Default: the connection’s default_model.
Draft structured output mode.
Responses
Section titled “Responses”The outcome. A provider failure is ok: false, not an error status.
POST /api/v1/orgs/{org}/llm-connections/{id}/test response.
object
The failure. Omitted when ok is true.
object
What the caller should do with the failure.
Provider or transport error text, without secrets.
Round-trip time of the call.
The model the test called.
Whether one boolean judge call succeeded.
Example
{ "error": { "class": "retryable" }}The request is malformed or a filter is invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}