---
title: "Test Provider Connection"
method: POST
path: "/llm-providers/test-connection"
---

# Test Provider Connection

`POST /llm-providers/test-connection`

Test connection to an LLM provider with given configuration.

This endpoint allows testing a provider configuration before saving it.

## Request body

- LLMProviderCreateRequest — POST and test-connection body: the key must be supplied, there is nothing stored to keep.
  - `integration_name` string, required — User-friendly name for this integration
  - `provider` string, required — LLM provider name (openai, anthropic, custom)
  - `api_key` string, required — API key for the provider
  - `model_name` string, required — Default model name for this integration
  - `base_url` string, nullable — Custom endpoint URL (required for 'custom' provider, null for cloud)

## Response `200`

Successful Response

- LLMIntegrationResponse — Response for LLM integration operations (CRUD and connection tests).
  - `message` string, required — Human-readable status message
  - `integration_id` string, nullable — Integration ID (present for create/update operations)
  - `status` 'success' | 'error', nullable — Operation status (for connection tests)
  - `provider` string, nullable — Provider name (for connection tests)
  - `models_available` string[], nullable — Available models (for connection tests)

## Other responses

- `422` — Validation Error

## Changes

- **2026-08-30** `11d1e74d88c7` — 1 breaking, 6 warning
  - request property `api_key` list-of-types was narrowed by removing types `null` from media type `application/json`
  - removed the request property `input_cost_per_token`
  - removed the request property `integration_id`
  - removed the request property `is_default`
  - …3 more

[Change history](https://skmtc.dev/discolike/apis/discolike-api/changes/llm-providers/test-connection/post.md)

---

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