新版本接口
获取模型信息平台
接口地址:GET https://aihubmix.com/api/v1/models
功能描述:获取所有可用模型的详细信息。
模型对象字段说明
模型信息列表数组
模型唯一标识符
模型功能描述(英文)
模型类型,支持值:
llm(大语言模型)、image_generation(图片生成模型)、video(视频生成模型)、tts(语音合成模型)、stt(语音转文本模型)、embedding(嵌入模型)、rerank(排序模型)支持的功能特性,支持值:
thinking(支持思考推理)、tools(支持工具调用)、function_calling(支持函数调用)、web(支持搜索)、deepsearch(支持深度搜索)、long_context(长上下文模型)、structured_outputs(结构化输出)支持的输入模态,支持值:
text(文本)、image(图像)、audio(音频) 、video(视频)、pdf最大输出Token数量
上下文窗口大小(最大输入Token数量)
价格信息对象
输入Token价格(每1K Token,美元)
输出Token价格(每1K Token,美元)
缓存读取价格(每1K Token,美元,可选字段)
缓存写入价格(每1K Token,美元,可选字段)
请求示例
请求参数说明(可用于筛选)
模型类型。支持值:
llm(大语言模型)、image_generation(图片生成模型)、video(视频生成模型)、tts(语音合成模型)、stt(语音转文本模型)、embedding(嵌入模型)、rerank(排序模型)输入模态。支持值:
text(文本)、image(图像)、audio (音频)、video(视频)、pdf,支持多模态查询(逗号分隔)模型名称模糊搜索(支持部分匹配)
模型功能特性。支持值:
thinking(支持思考推理)、tools(支持工具调用)、function_calling(支持函数调用)、web(支持搜索)、deepsearch(支持深度搜索)、long_context(长上下文模型)、structured_outputs(结构化输出),支持多功能查询(逗号分隔)排序字段。支持值:
•
•
•
•
•
model_ratio:按性价比排序•
context_length:按上下文长度排序•
coding:编程模型优先排序•
order:按默认顺序排序排序方向。支持值:
•
•
•
asc(升序) •
desc(降序)响应成功示例
使用场景示例
说明:在使用编程模型智能排序时,系统会优先展示包含 coding 标签的模型,其他模型按默认顺序排列。
性能优化
缓存机制
- 缓存策略:HTTP缓存,缓存时长300秒(5分钟)
- 缓存控制:
Cache-Control: public, max-age=300, stale-while-revalidate=300 - 内容验证:支持ETag内容哈希验证
缓存使用示例
如果内容未更新,服务器返回 304 Not Modified 状态码。
错误处理
重要说明
- 数据完整性:此接口返回所有符合条件的模型,不进行分页处理
- 类型兼容性:支持新旧类型标识的自动映射
t2t↔llmt2i↔image_generationt2v↔videoreranking↔rerank
- 筛选逻辑:多个筛选条件之间为逻辑与(AND)关系
- 排序规则:未指定排序方式时,默认按系统预设顺序排列
旧版本接口
⚠️ 注意:以下为旧版本接口,建议优先使用新版本接口以获得更好的性能和功能体验。
获取模型列表
端点(Endpoint):GET /v1/models
- 有用户登录获取用户分组下的可用列表,无用户登录获取 default 分组下的可用列表。
- header 中有 Authorization 字段则查询 key 对应的 token 下配置的模型列表。
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » data | [object] | true | none | none | |
| »» id | string | true | none | 模型 ID | none |
| »» object | string | true | none | model | none |
| »» created | integer | true | none | 创建时间 | none |
| »» owned_by | string | true | none | 开发者 | none |
| »» permission | [object]¦null | true | none | none | |
| »»» id | string | true | none | none | |
| »»» object | string | true | none | none | |
| »»» created | integer | true | none | none | |
| »»» allow_create_engine | boolean | true | none | none | |
| »»» allow_sampling | boolean | true | none | none | |
| »»» allow_logprobs | boolean | true | none | none | |
| »»» allow_search_indices | boolean | true | none | none | |
| »»» allow_view | boolean | true | none | none | |
| »»» allow_fine_tuning | boolean | true | none | none | |
| »»» organization | string | true | none | none | |
| »»» group | null | true | none | none | |
| »»» is_blocking | boolean | true | none | none | |
| »» root | string | true | none | 模型名称 | none |
| »» parent | null | true | none | 父节点 | none |
获取模型信息
端点(Endpoint):GET /v1/models/:model
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| model | path | string | 是 | 模型 ID |
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| id | string | true | none | 模型 ID | none |
| object | string | true | none | model | none |
| created | integer | true | none | 创建时间 | none |
| owned_by | string | true | none | 开发者 | none |
| permission | [object] | true | none | none | |
| » id | string | false | none | none | |
| » object | string | false | none | none | |
| » created | integer | false | none | none | |
| » allow_create_engine | boolean | false | none | none | |
| » allow_sampling | boolean | false | none | none | |
| » allow_logprobs | boolean | false | none | none | |
| » allow_search_indices | boolean | false | none | none | |
| » allow_view | boolean | false | none | none | |
| » allow_fine_tuning | boolean | false | none | none | |
| » organization | string | false | none | none | |
| » group | null | false | none | none | |
| » is_blocking | boolean | false | none | none | |
| root | string | true | none | 模型名称 | none |
| parent | null | true | none | 父节点 | none |