---
title: "Test Hosted Provider"
method: POST
path: "/api/v1/hosted-providers/test"
tags: ["hosted-providers"]
---

# Test Hosted Provider

`POST /api/v1/hosted-providers/test`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Otari-Key`
  - API key in header `x-api-key`

Ask a provider what it lists on the given credentials, storing nothing.

Backs the form's "Test connection". With ``name`` naming a stored provider,
a field left out is read from it, so an edit can be tested without typing
the key again; pointing the stored key at another origin still needs it.
Failure comes back in the body.

## Request body

- HostedProviderTestRequest: Credentials to try against a provider without storing them. The fields the create body takes. ``name`` naming an existing stored provider lets a field left out fall back to what it stores, so an edit form can test without re-entering the key; pointing the stored key at another origin still needs the key typed again, as an update does.
  - `api_base` string, nullable
  - `api_key` string, nullable
  - `client_args` object, nullable
  - `name` string, nullable
  - `provider` string, required

## Response `200`

Successful Response

- HostedProviderTestPublic: What a connection test found: whether the provider answered, and how many models it lists. ``discovery_unsupported`` is set for a provider with no model listing, which a test cannot reach that way although it may still serve.
  - `discovery_unsupported` boolean
  - `error` string, nullable
  - `model_count` integer
  - `ok` boolean, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-19** `3d8fba047d0e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/mozilla-ai/apis/otari/changes/api/v1/hosted-providers/test/post.md)

---

[API](https://skmtc.dev/mozilla-ai/apis/otari.md) · [All operations](https://skmtc.dev/mozilla-ai/apis/otari/llms.txt) · [OpenAPI document](https://skmtc.dev/mozilla-ai/apis/otari/revisions/56a84a2d9087?raw)
