---
title: "Get Used Models"
method: GET
path: "/v1/analytics/used-models"
tags: ["analytics"]
---

# Get Used Models

`GET /v1/analytics/used-models`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/analytics/used-models`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/analytics/used-models/get.ts> (a function with typed inputs; its response is checked against the schema)

Return the distinct models the user has run inference against.

One entry per distinct ``inferences.model_id`` for the authenticated
user, ordered by most-recently-used first and carrying the last-used
timestamp plus a lifetime call count. LLM-as-Judge calls
(``source = 'llmaj'``) are excluded so the list reflects user-driven
usage. The service filters ``inferences.user_id`` explicitly because
the ``service_role`` async engine bypasses Postgres RLS.

Args:
    limit: Maximum number of models to return.
    auth: Authentication result carrying the user id used to scope
        the aggregate.

Returns:
    ``UsedModelsResponse`` with the recency-ordered model list. Empty
    when the user has no qualifying inferences.

Raises:
    HTTPException: 503 when the aggregate fails; the cause is logged
        server-side rather than returned to the caller.

## Query parameters

- `limit` integer: Maximum number of distinct models to return, ordered by most-recently-used first.

## Response `200`

Successful Response

- UsedModelsResponse: Distinct models a user has used, most-recently-used first. Excludes LLM-as-Judge (``source = 'llmaj'``) calls so the list only reflects models the user actually invoked. Scoped to the requesting user — the ``service_role`` engine bypasses RLS, so the service filters ``inferences.user_id`` explicitly.
  - `models` UsedModel[]: Used models ordered by ``last_used_at`` descending.
    - `model_id` string, required: Identifier the caller used for inference (base catalog id or fine-tuned model id). Stable grouping key for this row.
    - `model_name` string, nullable: Human-readable model name recorded on the inference, when set.
    - `base_model` string, nullable: HuggingFace base model id for fine-tuned models; null for direct base-model calls.
    - `project_id` string, nullable: Project the model belongs to (fine-tunes only); null for base-model calls. Lets the client route a click to the project page.
    - `training_job_id` string, nullable: Training job that produced the model (fine-tunes only); null for base-model calls.
    - `last_used_at` string, date-time, required: Most recent ``created_at`` for this model across the user's inferences (excluding LLM-as-Judge calls).
    - `inference_count` integer: Lifetime count of the user's inferences against this model (excluding LLM-as-Judge calls).

## Other responses

- `422`: Validation Error
- `503`: Used models dependency is temporarily unavailable.

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/analytics/used-models/get.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
