#List models
GET
/v1/models
Auth required
Lists the LLM models in the current catalog, in the OpenAI list shape. The list is the same for every account.
#Request
curl https://api.sogni.ai/v1/models \
-H "Authorization: Bearer $SOGNI_API_KEY"
const res = await fetch('https://api.sogni.ai/v1/models', {
headers: { Authorization: `Bearer ${process.env.SOGNI_API_KEY}` },
});
const { data } = await res.json();
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()
#Response
{
"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"
}
}
]
}
#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 for header settings and estimation limits.