Source: https://docs.sogni.ai/api-reference/llm-models/

# LLM Models

Discover the configured LLM catalog and context limits. Model IDs and serving limits can change, so consult the live endpoint rather than hardcoding them. For image, video, and audio generation models, use the [public model catalog](https://docs.sogni.ai/api-reference/model-discovery/).

### GET /v1/models

Lists the LLM models in the current catalog, in the OpenAI list shape. The list is the same for every account.

### [#](https://docs.sogni.ai/api-reference/llm-models/#request)Request

```bash
curl https://api.sogni.ai/v1/models \
  -H "Authorization: Bearer $SOGNI_API_KEY"
```

```javascript
const res = await fetch('https://api.sogni.ai/v1/models', {
  headers: { Authorization: `Bearer ${process.env.SOGNI_API_KEY}` },
});
const { data } = await res.json();
```

```python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.sogni.ai/v1", api_key=os.environ["SOGNI_API_KEY"])
models = client.models.list()
```

### [#](https://docs.sogni.ai/api-reference/llm-models/#response)Response

```json
{
  "object": "list",
  "data": [
    {
      "id": "qwen3.6-35b-a3b-gguf-iq4xs",
      "object": "model",
      "created": 1776384000,
      "owned_by": "qwen",
      "capabilities": { "reasoning": true },
      "context_length": 262144,
      "max_model_len": 262144,
      "sogni": {
        "usable_context_length": 260096,
        "safety_margin_tokens": 2048,
        "max_tokens_behavior": "clamp_to_remaining_context"
      }
    },
    {
      "id": "deepseek-v4-flash-vision-exp-dspark-1m",
      "object": "model",
      "created": 1788998400,
      "owned_by": "deepseek",
      "capabilities": { "reasoning": true },
      "context_length": 1048576,
      "max_model_len": 1048576,
      "sogni": {
        "usable_context_length": 1046528,
        "safety_margin_tokens": 2048,
        "max_tokens_behavior": "clamp_to_remaining_context"
      }
    },
    {
      "id": "qwen3.5-35b-a3b-abliterated-gguf-q4km",
      "object": "model",
      "created": 1772582400,
      "owned_by": "qwen",
      "capabilities": { "reasoning": true },
      "context_length": 131072,
      "max_model_len": 131072,
      "sogni": {
        "usable_context_length": 129024,
        "safety_margin_tokens": 2048,
        "max_tokens_behavior": "clamp_to_remaining_context"
      }
    }
  ]
}
```

### [#](https://docs.sogni.ai/api-reference/llm-models/#context-and-output-limits)Context and output limits

`context_length` and `max_model_len` report the full configured context used by API admission. The `sogni.usable_context_length` allowance covers prepared messages, tool/response schemas and output together after the `sogni.safety_margin_tokens` reserve. These fields are additive provider metadata; OpenAI's model object does not standardize context discovery, and some clients require manual limit settings.

For hosted completions, valid positive integer `max_tokens` or `max_completion_tokens` ceilings are reduced to the remaining estimated space. Smaller ceilings are preserved; input and caller tools are not shortened. If input alone leaves no room for output, the request returns a context error with numeric budget details. See [Context and Output Limits](https://docs.sogni.ai/sogni-intelligence/chat-completions/#context-and-output-limits) for header settings and estimation limits.

### GET /v1/models/:model\_id

Returns the same model record and context metadata as the list endpoint. An unknown id returns `404` with `code: "model_not_found"`. A retired model id that has a replacement returns the replacement's record.

### [#](https://docs.sogni.ai/api-reference/llm-models/#path-parameters)Path parameters

| Name | Type | In | Description |
| --- | --- | --- | --- |
| model\_idrequired | string | path | An ID from `GET /v1/models`. |
