---
title: "Discover LLMs"
method: POST
path: "/v2/llms/discover"
tags: ["Large Language Models"]
---

# Discover LLMs

`POST /v2/llms/discover`

Probes an external LLM provider endpoint and returns the model configurations most likely to work. The provider type and API dialect are inferred from the credential and the URI when `type` is omitted.

Nothing is persisted. Combine a returned candidate with a `name` and the credential you supplied here and submit it to `POST /v2/llms`.

Discovery live-tests at most three models per detected endpoint — with both OpenAI dialects probed, at most six upstream generation calls — and returns every usable model the endpoint advertises.

## Headers

- `Request-Timeout` integer
- `Request-Timeout-Millis` integer

## Request body

- DiscoverLLMsRequest — Request to probe an external LLM provider endpoint and return the model configurations most likely to work. Nothing is persisted. Submit a returned candidate to `POST /v2/llms` to create the LLM.
  - `uri` string, uri — The provider endpoint URI: an http or https URL including a host. Accepts a base URL, a full chat/completions URL, or a Vertex `generateContent` URL; each is reduced to the provider's base endpoint. Optional when the credential itself identifies the provider: Anthropic (`sk-ant-…`) and OpenAI (`sk-…`) API keys, Bedrock credentials (endpoint derived from the region), `vertex_service_account`/`vertex_access_token` credentials (endpoint derived from the project and region), and the Gemini `api_key` credential (endpoint defaults to Google AI Studio). Required for any other credential, including the Gemini `service_account` credential, which declares no project or region.
  - `type` 'openai-compatible' | 'openai-responses' | 'vertex-ai' | 'anthropic' — The LLM provider type, identifying which authentication and configuration apply. New values may be added as providers are onboarded; clients should ignore values they do not recognize rather than fail.
  - `auth` union — The authentication configuration for an LLM. It is a union over every variant any LLM provider accepts. In `GET` responses, secret fields contain the literal string `****`.
    - object — Bearer token authentication
      - `type` string, required — Must be "bearer" for bearer token auth
      - `token` string, required — The bearer token to use for authentication
    - object — Custom header-based authentication
      - `type` string, required — Must be "header" for header-based auth
      - `header` string, required — The header name to use (e.g. x-api-key)
      - `value` string, required — The header value to use
    - object — OAuth 2.0 client credentials authentication. The platform acquires an access token from the token endpoint before connecting to the remote service.
      - `type` string, required — Must be "oauth_client_credentials" for OAuth client credentials auth.
      - `client_id` string, required — The OAuth2 client ID.
      - `client_secret` string, required — The OAuth2 client secret.
      - `token_endpoint` string, uri, required — The OAuth2 token endpoint URL where the platform exchanges credentials for an access token.
      - `scopes` string[] — OAuth2 scopes to request when acquiring the access token.
    - object — AWS Bedrock authentication with explicit IAM credentials
      - `type` string, required — Must be "bedrock_static_iam" for static AWS IAM credentials
      - `aws_access_key_id` string, required — AWS access key ID
      - `aws_secret_access_key` string, required — AWS secret access key
      - `region` string, required — AWS region for Bedrock
    - object — AWS Bedrock API key authentication
      - `type` string, required — Must be "bedrock_api_key" for Bedrock API key auth
      - `api_key` string, required — The Bedrock API key
      - `region` string, required — AWS region for Bedrock
    - object — Google Cloud Vertex AI service account authentication
      - `type` string, required — Must be "vertex_service_account" for service account auth
      - `key_json` string, required — The service account key JSON
      - `project` string, required — GCP project ID
      - `region` string, required — GCP region for Vertex AI
    - object — Google Cloud Vertex AI access token authentication
      - `type` string, required — Must be "vertex_access_token" for access token auth
      - `access_token` string, required — The GCP access token
      - `project` string, required — GCP project ID
      - `region` string, required — GCP region for Vertex AI
    - object — API key authentication for Vertex AI
      - `type` string, required — Must be "api_key" for API key authentication
      - `api_key` string, required — The Google Cloud API key for authentication
    - object — Service account authentication for Vertex AI
      - `type` string, required — Must be "service_account" for service account authentication
      - `key_json` string, required — The service account JSON key file contents as a string
  - `headers` object — Additional HTTP headers to send with the probe requests.
  - `test_model_parameters` object — Extra parameters passed to the live verification call (e.g. `max_tokens` for providers that require it).

## Response `200`

The discovered LLM configurations.

- DiscoverLLMsResponse — The model configurations discovered by probing the endpoint, most-likely-to-work first.
  - `candidates` DiscoveredLLM[], required — Discovered configurations, one per (provider type, model). Candidates that were successfully live-tested (`verified: true`) are listed first. Submit any candidate's fields — together with the same credential you passed in — to `POST /v2/llms` to create the LLM.
    - `type` 'openai-compatible' | 'openai-responses' | 'vertex-ai' | 'anthropic', required — The LLM provider type, identifying which authentication and configuration apply. New values may be added as providers are onboarded; clients should ignore values they do not recognize rather than fail.
    - `uri` string, uri, nullable — The endpoint URI to use when creating this LLM, normalized and rebuilt for this candidate's dialect (for example `…/v1/chat/completions` for `openai-compatible` and `…/v1/responses` for `openai-responses`). Absent for providers whose endpoint is derived from the credential rather than a URL — Anthropic on Bedrock (region-derived) and, where no base URI was supplied, Vertex.
    - `model` string, required — The provider-specific model identifier this candidate configures.
    - `capabilities` LLMCapabilities — The capabilities of a Large Language Model. If you do not provide capabilities when you create an LLM, the platform infers them from the model name and provider type. Fields you provide explicitly override the inferred defaults.
      - `image_support` boolean — Whether the model supports image inputs.
      - `context_limit` integer — Maximum context window size in tokens.
      - `tool_calling` boolean — Whether the model supports tool/function calling.
      - `structured_outputs` boolean — Whether the model supports structured output generation.
      - `requires_role_alternation` boolean — Whether the model requires strict role alternation in conversations. When true, the platform groups consecutive messages of the same role together.
    - `verified` boolean, required — Whether a live generation round-trip against this exact `model` succeeded. At most three models per detected endpoint are live-tested; other candidates sharing a healthy endpoint are returned with `verified` false and no `verification_error`, and are expected to work.
    - `verification_error` string, nullable — When `verified` is false, the reason this model's live test failed. When every live test against the candidate's endpoint failed, the endpoint-wide failure is reported instead. Null for an untested candidate on a healthy endpoint.

## Other responses

- `400` — The request body is invalid.
- `403` — Permissions do not allow discovering LLMs.
- `422` — The endpoint could not be probed — no provider type could be determined for the supplied URI and credential, the supplied `type` contradicts what the credential and URI imply, or every detected provider's model listing failed. A reachable endpoint whose live test fails instead returns `200` with `verified` false and a `verification_error`.

## Changes

- **2026-08-27** `0d51a9e3a0b3` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/vectara/apis/vectara-rest-api-v2/changes/v2/llms/discover/post.md)

---

[API](https://skmtc.dev/vectara/apis/vectara-rest-api-v2.md) · [All operations](https://skmtc.dev/vectara/apis/vectara-rest-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/vectara/vectara-rest-api-v2/revisions/abd45fb0c974/schema)
