Docs API reference
Markdown Get an API key

API referenceChat and agents

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.

#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"

#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.

#Read a model

GET /v1/models/:model_id Auth required

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.

#Path parameters

NameTypeInDescription
model_idrequiredstringpathAn ID from GET /v1/models.