---
title: "Fetch available models from a provider's API."
method: POST
path: "/agentcc/provider-credentials/fetch_models/"
tags: ["agentcc"]
---

# Fetch available models from a provider's API.

`POST /agentcc/provider-credentials/fetch_models/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/agentcc/provider-credentials/fetch_models/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

Two modes:
- provider_name: look up stored credential by provider name for this org.
- api_key + base_url + api_format: use raw values (for create-mode).

## Request body

- AgentccProviderCredential
  - `id` string, uuid
  - `organization` string, uuid
  - `workspace` string, uuid, nullable
  - `provider_name` string, required
  - `display_name` string
  - `credentials` string
  - `base_url` string, uri
  - `api_format` string
  - `models_list` object
  - `default_timeout_seconds` integer
  - `max_concurrent` integer
  - `conn_pool_size` integer
  - `extra_config` object
  - `is_active` boolean
  - `last_rotated_at` string, date-time, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Response `201`

Created

- AgentccProviderCredential
  - `id` string, uuid
  - `organization` string, uuid
  - `workspace` string, uuid, nullable
  - `provider_name` string, required
  - `display_name` string
  - `credentials` string
  - `base_url` string, uri
  - `api_format` string
  - `models_list` object
  - `default_timeout_seconds` integer
  - `max_concurrent` integer
  - `conn_pool_size` integer
  - `extra_config` object
  - `is_active` boolean
  - `last_rotated_at` string, date-time, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
