---
title: "POST /ai/providers/discover"
method: POST
path: "/ai/providers/discover"
tags: ["AI Gateway Admin"]
---

# POST /ai/providers/discover

`POST /ai/providers/discover`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/ai/providers/discover`
- Auth: HTTP bearer

## Request body

- DiscoverProviderModelsRequest
  - `api_key` string, password: API key, if the server requires one
  - `base_url` string, nullable: Base URL of the server (required for "openai_compatible")
  - `provider` string, required: Provider ID, e.g. "openai_compatible"
  - `trust_private_address` boolean: Discover as if the base URL's exact private address were trusted on the key. Requires `settings:write`.

## Response `200`

Models the provider lists

- DiscoverProviderModelsResponse
  - `models` DiscoveredModelResponse[], required: Models the provider lists, sorted by id
    - `id` string, required
    - `name` string, nullable: The model's human-readable name, when the server's listing gives one.
    - `owned_by` string, required
  - `provider` string, required

## Other responses

- `400`: Invalid or blocked base URL, or the provider could not be listed
- `401`: Unauthorized
- `403`: Insufficient permissions

## Changes

- **2026-11-09** `12896146b193`: 3 breaking
  - removed the required property `extensions` from the response with the `400` status
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
- **2026-10-23** `7d41b820a372`: 1 breaking, 1 info
  - the `api_key` request property format changed from no format to `password`
  - added the optional property `models/items/name` to the response with the `200` status
- **2026-10-23** `24af93ff5379`: 1 warning, 1 info
  - removed the optional property `models/items/name` from the response with the `200` status
  - the `api_key` request property format was generalized from `password` to no format
- **2026-10-22** `842d42ed4659`: 1 breaking, 1 info
  - the `api_key` request property format changed from no format to `password`
  - added the optional property `models/items/name` to the response with the `200` status
- **2026-10-22** `1a12a50b75ee`: 1 warning, 1 info
  - removed the optional property `models/items/name` from the response with the `200` status
  - the `api_key` request property format was generalized from `password` to no format

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/ai/providers/discover/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
