---
title: "List Provider Models"
method: GET
path: "/v2/ai-credentials/{provider}/models"
tags: ["v2 - AI Credentials"]
---

# List Provider Models

`GET /v2/ai-credentials/{provider}/models`

## Request

- Base URL: `https://api.jubjubapp.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jubjubapp.com/v2/ai-credentials/{provider}/models`
- Auth: HTTP bearer

Models this profile's key can see, plus the authoritative default.

WHY A SEPARATE ENDPOINT rather than widening the connect response. The
validator runs once, at connect time, before anything is stored — but the
user needs this list every time they open the form, including long after
connecting, and when editing a model on an already-connected provider. A
connect-time-only payload cannot serve that, and widening
`tuple[bool, str]` across all four validators would burden every connect
with a list most of them do not need.

NEVER RETURNS ANOTHER USER'S DATA. The caller supplies no key and no
profile id: `profile_id` comes from the authenticated session, and the key
is the one already encrypted under THAT profile's document. There is no
input through which another profile could be named.

ALWAYS 200, NEVER BLOCKS THE USER. The model field is free text and stays
that way, so an unobtainable list is a missing convenience, not an error:

  available=false, reason="no_key"      nothing connected yet
  available=false, reason="unavailable" provider refused or is unreachable
                                        (Claude's /v1/models has 404'd
                                        before — see _validate_claude_key's
                                        fallback path)

`default_model` is returned in every case, including with no key, because
the dashboard needs it for the placeholder before anything is connected.
It is read from core.ai_models, which is env-overridable — the backend is
the single source of truth and the dashboard must not keep its own copy.

## Path parameters

- `provider` string, required

## Headers

- `Authorization` string
- `X-JubJub-Service-Key` string
- `X-JubJub-Agent-Key` string
- `X-JubJub-Platform-Key` string
- `Origin` string
- `Referer` string
- `X-JubJub-Trial-Token` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jubjubapp/apis/jubjub-api.md) - [All operations](https://skmtc.dev/jubjubapp/apis/jubjub-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jubjubapp/apis/jubjub-api/revisions/353157b296f2?raw)
