> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.privategpt.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.privategpt.dev/_mcp/server.

# List Models

GET /v1/models

List Models

Reference: https://docs.privategpt.dev/api-reference/models/list-models-v-1-models-get

## Request

### Query parameters

- `before_id` (string, optional, nullable)
- `after_id` (string, optional, nullable)
- `limit` (integer, optional, default: 100)

## Response

### 200

Successful Response

- `data` (list of ModelInfoOutput, required) — List of model objects.
- `first_id` (string, required, nullable) — First model id in page, usable as before_id.
- `has_more` (boolean, required) — Whether more models are available.
- `last_id` (string, required, nullable) — Last model id in page, usable as after_id.

## Errors

### 401 Unauthorized Error

Unauthorized

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional) — detail field.

## Types

### ModelInfoOutput

Model metadata payload.

- `id` (string, required) — Unique model identifier.
- `created_at` (datetime, required) — Model release timestamp (RFC3339).
- `display_name` (string, required) — Human-readable model name.
- `type` ("model", required) — Object type "model".
- `max_tokens` (integer, required, nullable) — Maximum value allowed for max_tokens for this model.
- `max_input_tokens` (integer, required, nullable) — Maximum input context window for this model.
- `capabilities` (ModelCapabilitiesOutput, required, nullable) — Detailed model capability map.
- `embed_dim` (integer, optional, nullable) — Embedding vector dimension for embedding models.

### ValidationError

ValidationError schema.

- `loc` (list of ValidationErrorLocItems, required) — loc field.
- `msg` (string, required) — msg field.
- `type` (string, required) — type field.
- `input` (any, optional) — input field.
- `ctx` (ValidationErrorCtx, optional) — ctx field.

### ModelCapabilitiesOutput

ModelCapabilitiesOutput schema.

- `batch` (CapabilitySupportOutput, required) — Batch API support.
- `citations` (CapabilitySupportOutput, required) — Citation support.
- `code_execution` (CapabilitySupportOutput, required) — Code execution support.
- `context_management` (ContextManagementCapabilityOutput, required) — Context management capabilities.
- `effort` (EffortCapabilityOutput, required) — Reasoning effort capabilities.
- `image_input` (CountCapabilitySupportOutput, required) — Image input support.
- `pdf_input` (CapabilitySupportOutput, required) — PDF input support.
- `structured_outputs` (CapabilitySupportOutput, required) — Structured output support.
- `thinking` (ThinkingCapabilityOutput, required) — Thinking support.
- `audio_input` (CountCapabilitySupportOutput, optional, nullable) — Audio input support.

### ValidationErrorLocItems

### ValidationErrorCtx

ctx field.

### CapabilitySupportOutput

CapabilitySupportOutput schema.

- `supported` (boolean, required) — Whether a capability is supported.

### ContextManagementCapabilityOutput

ContextManagementCapabilityOutput schema.

- `clear_thinking_20251015` (CapabilitySupportOutput, required, nullable) — Support for strategy "clear_thinking_20251015".
- `clear_tool_uses_20250919` (CapabilitySupportOutput, required, nullable) — Support for strategy "clear_tool_uses_20250919".
- `compact_20260112` (CapabilitySupportOutput, required, nullable) — Support for strategy "compact_20260112".
- `supported` (boolean, required) — Whether context management is supported.

### EffortCapabilityOutput

EffortCapabilityOutput schema.

- `supported` (boolean, required) — Whether effort control is supported.
- `low` (CapabilitySupportOutput, required) — Support for effort "low".
- `medium` (CapabilitySupportOutput, required) — Support for effort "medium".
- `high` (CapabilitySupportOutput, required) — Support for effort "high".
- `max` (CapabilitySupportOutput, required) — Support for effort "max".
- `xhigh` (CapabilitySupportOutput, required) — Support for effort "xhigh".

### CountCapabilitySupportOutput

CountCapabilitySupportOutput schema.

- `supported` (boolean, required) — Whether a capability is supported.
- `maximum` (integer, optional, default: 0) — Maximum number of allowed elements.

### ThinkingCapabilityOutput

ThinkingCapabilityOutput schema.

- `supported` (boolean, required) — Whether thinking is supported.
- `types` (ThinkingTypesOutput, required) — Thinking type support configuration.

### ThinkingTypesOutput

ThinkingTypesOutput schema.

- `adaptive` (CapabilitySupportOutput, required) — Support for thinking type "adaptive".
- `enabled` (CapabilitySupportOutput, required) — Support for thinking type "enabled".

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "data": [
    {
      "id": "model-abc123xyz",
      "created_at": "2023-11-20T14:45:00Z",
      "display_name": "Zylon GPT-4 Private",
      "type": "model",
      "max_tokens": 8192,
      "max_input_tokens": 8192,
      "capabilities": {
        "batch": {
          "supported": true
        },
        "citations": {
          "supported": false
        },
        "code_execution": {
          "supported": true
        },
        "context_management": {
          "clear_thinking_20251015": {
            "supported": true
          },
          "clear_tool_uses_20250919": {
            "supported": false
          },
          "compact_20260112": {
            "supported": true
          },
          "supported": true
        },
        "effort": {
          "supported": true,
          "low": {
            "supported": true
          },
          "medium": {
            "supported": true
          },
          "high": {
            "supported": true
          },
          "max": {
            "supported": false
          },
          "xhigh": {
            "supported": false
          }
        },
        "image_input": {
          "supported": true,
          "maximum": 5
        },
        "pdf_input": {
          "supported": true
        },
        "structured_outputs": {
          "supported": true
        },
        "thinking": {
          "supported": true,
          "types": {
            "adaptive": {
              "supported": true
            },
            "enabled": {
              "supported": false
            }
          }
        },
        "audio_input": {
          "supported": false,
          "maximum": 0
        }
      },
      "embed_dim": 1536
    }
  ],
  "first_id": "model-abc123xyz",
  "has_more": false,
  "last_id": "model-abc123xyz"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/models"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/models';
const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/models"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/models")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/models', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/models");
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```