---
title: "Test an LLM provider connection (owner-only) · 0 credits"
method: POST
path: "/api/v1/llm-providers/{id}/test"
tags: ["BYO-LLM"]
---

# Test an LLM provider connection (owner-only) · 0 credits

`POST /api/v1/llm-providers/{id}/test`

## Request

- Base URL: `https://legal.nexusquantum.legal`
- URL: `https://legal.nexusquantum.legal/api/v1/llm-providers/{id}/test`
- Auth: HTTP bearer

Connectivity health check: resolves + decrypts the config (firm-scoped) and runs a MINIMAL invoke (a ping, short timeout) through the adapter. On success it stamps `last_verified_at`. Returns `{ ok, latency_ms, model, error?, account_issue? }`. `ok:true` means a REAL call reached your provider with that key and model — it is not a format check. `account_issue` tells apart a rejection caused by YOUR account (spent balance, revoked key, model not allowed) from a connectivity failure: retrying only helps in the latter. The error message is sanitized — it NEVER echoes the `api_key`. No charge. Scope: mcp | * (NOT cases).

## Path parameters

- `id` string, uuid, required

## Response `200`

Health check result (ok=true|false, sanitized error on failure).

- LlmProviderTestResult: Connectivity health-check result. The `error` (if any) is sanitized — it never echoes the credential.
  - `ok` boolean: true if the ping to the provider succeeded.
  - `latency_ms` integer: Latency of the minimal invoke in milliseconds.
  - `model` string: Model the test ran against.
  - `error` string: Sanitized error message (only when ok=false).
  - `account_issue` 'credit_exhausted' | 'invalid_key' | 'access_denied' | 'provider_rejected': Present when the provider ANSWERED and rejected the request because of YOUR account, not because of connectivity. `credit_exhausted` = the key authenticated but the balance is spent (top up with the provider; a new key will not help). `invalid_key` = invalid or revoked credential (replace it). `access_denied` = the key is valid but has no access to that model (pick a model your plan allows). `provider_rejected` = rejected without a classifiable reason. Retrying fixes none of them.

## Other responses

- `404`: NOT_FOUND (does not exist or does not belong to your firm)
- `409`: PROVIDER_NOT_RESOLVABLE (the config could not be resolved for the test, e.g. disabled)
- `422`: INVALID_PROVIDER_URL (base_url fails the SSRF filter on re-validation)
- `500`: PROVIDER_RESOLVE_FAILED (the config could not be decrypted/resolved)

---

[API](https://skmtc.dev/nexusquantum/apis/nexus-legal-api.md) · [All operations](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/revisions/4084d8d4eb0b?raw)
