New API Version
Get Model Information
Endpoint:GET https://aihubmix.com/api/v1/models
Description: Fetches detailed information for all available models.
Model Object Field Descriptions
An array of model information objects.
The unique identifier for the model.
A description of the model’s functionality (in English).
Model type. Supported values:
llm (Large Language Model), image_generation, video, tts (Text-to-Speech), stt (Speech-to-Text), embedding, rerank.Supported features. Supported values:
thinking (reasoning), tools (tool use), function_calling, web (web search), deepsearch, long_context, structured_outputs.Supported input modalities. Supported values:
text, image, audio, video, pdf.Maximum number of output tokens.
Context window size (maximum number of input tokens).
Pricing information object.
Input token price (per 1K tokens, in USD).
Output token price (per 1K tokens, in USD).
Cache read price (per 1K tokens, in USD, optional field).
Cache write price (per 1K tokens, in USD, optional field).
Request Examples
Request Parameter Descriptions (for Filtering)
Model type. Supported values:
llm (Large Language Model), image_generation, video, tts (Text-to-Speech), stt (Speech-to-Text), embedding, rerank.Input modalities. Supported values:
text, image, audio, video, pdf. Supports multi-modality queries (comma-separated).Fuzzy search for model name (supports partial matching).
Model features. Supported values:
thinking (reasoning), tools (tool use), function_calling, web (web search), deepsearch, long_context, structured_outputs. Supports multi-feature queries (comma-separated).Sort by field. Supported values:
model_ratio: Sort by cost-effectiveness.context_length: Sort by context length.coding: Prioritize coding models.order: Sort by default order.
Sort order. Supported values:
asc(ascending)desc(descending)
Successful Response Example
Usage Scenario Examples
Note: When using smart sort for coding models, the system will prioritize models tagged with coding, and other models will be listed in the default order.
Performance Optimization
Caching Mechanism
- Cache Policy: HTTP caching, cache duration 300 seconds (5 minutes).
- Cache Control:
Cache-Control: public, max-age=300, stale-while-revalidate=300 - Content Validation: Supports ETag content hash validation.
Cache Usage Example
If the content has not been updated, the server returns a 304 Not Modified status code.
Error Handling
Important Notes
- Data Integrity: This endpoint returns all models that meet the criteria, without pagination.
- Type Compatibility: Supports automatic mapping between new and old type identifiers:
t2t↔llmt2i↔image_generationt2v↔videoreranking↔rerank
- Filtering Logic: Multiple filter conditions are combined with a logical AND.
- Sorting Rule: When no sorting method is specified, models are arranged in the system’s default order.
Legacy API Version
⚠️ Note: The following are legacy API endpoints. It is recommended to use the new API version for better performance and features.
Get Model List
Endpoint:GET /v1/models
- If a user is logged in, it retrieves the list of available models for the user’s group. If no user is logged in, it retrieves the list for the
defaultgroup. - If the header contains an
Authorizationfield, it queries the list of models configured for the corresponding token.
Response
| Status Code | Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | none | Inline |
Response Data Structure
Status Code 200| Name | Type | Required | Description |
|---|---|---|---|
| » data | [object] | true | none |
| »» id | string | true | Model ID |
| »» object | string | true | model |
| »» created | integer | true | Timestamp of creation |
| »» owned_by | string | true | Developer |
| »» permission | [object]¦null | true | none |
| »»» id | string | true | none |
| »»» object | string | true | none |
| »»» created | integer | true | none |
| »»» allow_create_engine | boolean | true | none |
| »»» allow_sampling | boolean | true | none |
| »»» allow_logprobs | boolean | true | none |
| »»» allow_search_indices | boolean | true | none |
| »»» allow_view | boolean | true | none |
| »»» allow_fine_tuning | boolean | true | none |
| »»» organization | string | true | none |
| »»» group | null | true | none |
| »»» is_blocking | boolean | true | none |
| »» root | string | true | Root model name |
| »» parent | null | true | Parent model |
Get Model Information
Endpoint:GET /v1/models/:model
Request Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| model | path | string | true | Model ID |
Response
| Status Code | Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | none | Inline |
Response Data Structure
Status Code 200| Name | Type | Required | Description |
|---|---|---|---|
| id | string | true | Model ID |
| object | string | true | model |
| created | integer | true | Timestamp of creation |
| owned_by | string | true | Developer |
| permission | [object] | true | none |
| » id | string | false | none |
| » object | string | false | none |
| » created | integer | false | none |
| » allow_create_engine | boolean | false | none |
| » allow_sampling | boolean | false | none |
| » allow_logprobs | boolean | false | none |
| » allow_search_indices | boolean | false | none |
| » allow_view | boolean | false | none |
| » allow_fine_tuning | boolean | false | none |
| » organization | string | false | none |
| » group | null | false | none |
| » is_blocking | boolean | false | none |
| root | string | true | Root model name |
| parent | null | true | Parent model |