Models API

Listing available models

GET /v1/models

Returns all available models in the OpenAI list format.

Model List

cURL
curl https://api.onysoft.com/v1/models \
  -H "Authorization: Bearer sk-ony-your-api-key"

Response Format

The default response uses the OpenAI list format: object: "list" and an array called data. Each item has id, object: "model", created (currently 0) and owned_by, plus the name (name), provider (provider), model type (model_type), context window and pricing (pricing); for image, video and audio models the pricing unit is in pricing.unit and the unit price in pricing.cost_per_unit. The full list comes in a single response; there is no pagination. The OpenAI SDKs and tools that read the data array use this response without extra settings.

JSON
{
  "success": true,
  "object": "list",
  "data": [
    {
      "id": "google/gemini-3.8-flash",
      "object": "model",
      "created": 0,
      "owned_by": "google",
      "name": "Google: Gemini 3.8 Flash",
      "provider": "Google",
      "model_type": "chat",
      "context_window": 1048576,
      "max_output_tokens": 65536,
      "pricing": { "input_per_million_tokens": 1.2375, "output_per_million_tokens": 6.1875, "currency": "USD" }
    },
    {
      "id": "anthropic/claude-sonnet-5.5",
      "object": "model",
      "created": 0,
      "owned_by": "anthropic",
      "name": "Anthropic: Claude Sonnet 5.5",
      "provider": "Anthropic",
      "model_type": "chat",
      "context_window": 1000000,
      "max_output_tokens": 128000,
      "pricing": { "input_per_million_tokens": 3.0000, "output_per_million_tokens": 15.0000, "currency": "USD" }
    }
  ]
}

To list only one kind of model, add ?type=: chat returns every model you can send to the chat endpoint (POST /v1/chat/completions); values such as image, video, embedding or tts return the models of that type. An unknown type returns a 400 invalid_parameter error whose message lists the valid values.

cURL
curl "https://api.onysoft.com/v1/models?type=chat" \
  -H "Authorization: Bearer sk-ony-your-api-key"

Listing with the OpenAI SDK

With the official OpenAI SDKs (Python, Node.js and tools built on them such as LangChain), client.models.list() works without extra parameters. The SDKs send the X-Stainless-Lang header on every request or use a User-Agent starting with OpenAI/; when no format parameter is given, these requests always get the OpenAI format. Do not add ?format=onysoft to an SDK client (for example in default_query or base_url): an explicit choice takes precedence and returns the previous format, which the SDK cannot read.

Python
from openai import OpenAI

client = OpenAI(
    api_key="sk-ony-your-api-key",
    base_url="https://api.onysoft.com/v1"
)

for model in client.models.list():
    print(model.id, model.owned_by)

Onysoft catalog envelope (?format=onysoft)

The previous default format has not been removed. With ?format=onysoft the model list is in data.models and the total count in data.total. Items have the same fields as above, except the OpenAI-specific object, created and owned_by. The ?type= filter works in this format too. Use this format from your own HTTP client; the OpenAI SDKs expect data to be an array. ?format=openai is also accepted and returns the same response as the default.

cURL
curl "https://api.onysoft.com/v1/models?format=onysoft" \
  -H "Authorization: Bearer sk-ony-your-api-key"
JSON
{
  "success": true,
  "data": {
    "models": [
      {
        "id": "google/gemini-3.8-flash",
        "name": "Google: Gemini 3.8 Flash",
        "provider": "Google",
        "model_type": "chat",
        "context_window": 1048576,
        "max_output_tokens": 65536,
        "pricing": {
          "input_per_million_tokens": 1.2375,
          "output_per_million_tokens": 6.1875,
          "currency": "USD"
        }
      },
      {
        "id": "anthropic/claude-sonnet-5.5",
        "name": "Anthropic: Claude Sonnet 5.5",
        "provider": "Anthropic",
        "model_type": "chat",
        "context_window": 1000000,
        "max_output_tokens": 128000,
        "pricing": {
          "input_per_million_tokens": 3.0000,
          "output_per_million_tokens": 15.0000,
          "currency": "USD"
        }
      }
    ],
    "total": 769
  }
}

Transition period: so that integrations reading the model list in the previous format do not break, requests without parameters keep getting the previous format for a while on some accounts and API keys. These responses carry Deprecation, Sunset and Link headers; after the date in the Sunset header these keys get the OpenAI format as well. To keep using the previous format, add ?format=onysoft to the URL. If you use a tool that expects the OpenAI format (for example goose or Open WebUI) with such a key during this period, add ?format=openai to the URL. Every response names the format it uses in the X-Onysoft-Models-Format header (openai or onysoft).

Model Detail

GET /v1/models/{model_id}

Returns detailed information about a specific model.

The response has the OpenAI Model object fields (id, object: "model", created, owned_by) and the model details at the top level; for backward compatibility the same details are also under data. This response does not depend on the format parameter or the transition period.

cURL
curl https://api.onysoft.com/v1/models/google/gemini-3.8-flash \
  -H "Authorization: Bearer sk-ony-your-api-key"

Anthropic Format (anthropic-version Header)

If the request carries the anthropic-version header, GET /v1/models returns the Anthropic list format: data items with type: "model", id, display_name and created_at, plus has_more, first_id and last_id. limit is 1–1000 (default 20); paginate with before_id and after_id. Only chat models that your key is allowed to use are listed. With this header GET /v1/models/{id} also returns a single Anthropic Model object. These requests accept the x-api-key header too. Without the header the OpenAI format above is returned unchanged. Claude Code uses this format with CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1.

JSON
// GET /v1/models?limit=1  (anthropic-version: 2023-06-01) — sample response; order and ids depend on your key
{
  "data": [
    { "type": "model", "id": "anthropic/claude-sonnet-5.5", "display_name": "Anthropic: Claude Sonnet 5.5", "created_at": "2025-01-01T00:00:00Z" }
  ],
  "has_more": true,
  "first_id": "anthropic/claude-sonnet-5.5",
  "last_id": "anthropic/claude-sonnet-5.5"
}
Want help finding the right model?