---
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

- LLMProviderConfig — Model representing LLM provider configuration.
  - `integration_id` string, uuid, nullable — Unique integration ID (auto-generated)
  - `integration_name` string, required — User-friendly name for this integration
  - `provider` string, required — LLM provider name (openai, anthropic, custom)
  - `api_key` string, nullable, required — API key for the provider (null to keep existing when updating)
  - `model_name` string, required — Default model name for this integration (required)
  - `base_url` string, nullable — Custom endpoint URL (required for 'custom' provider, null for cloud)
  - `supports_web_search` boolean — Whether model supports web search
  - `input_cost_per_token` number, nullable — Estimated input token cost for this model
  - `output_cost_per_token` number, nullable — Estimated output token cost for this model
  - `is_default` boolean — Whether this is the default provider
  - `model_deprecated` boolean — Whether model is no longer supported and needs updating

## 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

---

[API](https://skmtc.net/discolike/apis/discolike-api.md) · [All operations](https://skmtc.net/discolike/apis/discolike-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/discolike/discolike-api/versions/3248fc62024c/schema)
