---
title: "Live-test credentials against the provider API"
method: POST
path: "/api/user/model-providers/{provider_id}/test"
tags: ["Model Providers"]
---

# Live-test credentials against the provider API

`POST /api/user/model-providers/{provider_id}/test`

## Request

- Base URL: `https://foresea.ink` (the document declares no server; this is the origin it was published from)
- URL: `https://foresea.ink/api/user/model-providers/{provider_id}/test`
- Auth: none declared

Send a minimal test request to verify API key validity and measure response latency.

## Path parameters

- `provider_id` string, required

## Request body

- TestUserModelProviderRequest
  - `api_key` string, nullable
  - `model_name` string, nullable
  - `custom_base_url` string, nullable

## Response `200`

Successful Response

- TestUserModelProviderResponse
  - `ok` boolean, required
  - `latency_ms` number, nullable
  - `message` string, nullable
  - `model` string, nullable
  - `sample_response` string, nullable
  - `error` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/foresea/apis/foresea-intelligence-api.md) · [All operations](https://skmtc.dev/foresea/apis/foresea-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/foresea/apis/foresea-intelligence-api/revisions/b03e49f4385d?raw)
