如何列出模型
获取所有可用模型的列表,包含请求参数和价格。
每条记录对应一个「模型 + 运行类型」组合,例如同时支持 text-to-image 和 image-to-image 的模型会出现两次。
接口
GET https://api.get3w.com/v1/models/list查询参数
| 参数 | 必填 | 说明 |
|---|---|---|
type | 否 | 只返回该运行类型的记录,例如 text-to-image,见模型类型 |
请求
bash
curl "https://api.get3w.com/v1/models/list" \
-H "Authorization: Bearer YOUR_API_KEY"python
import requests
response = requests.get(
"https://api.get3w.com/v1/models/list",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"type": "text-to-video"}, # 可选
timeout=(10, 60),
)
response.raise_for_status()
models = response.json()["data"]
print(f"Total: {len(models)}")
for m in models[:5]:
print(f"- {m['model_id']}: ${m['base_price']} / {m['billing_unit']}")响应
json
{
"code": 200,
"message": "success",
"data": [
{
"model_id": "google/nano-banana-2.1/text-to-image",
"name": "Nano Banana 2.1",
"provider_id": "google",
"description": "...",
"type": "text-to-image",
"base_price": 0.0286,
"currency": "USD",
"billing_unit": "image",
"api_schema": {
"api_schemas": [
{
"type": "model_run",
"method": "POST",
"server": "https://api.get3w.com",
"api_path": "/v1/google/nano-banana-2.1/text-to-image",
"request_schema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The positive prompt for the generation."
},
"aspect_ratio": {
"type": "string",
"enum": ["1:1", "16:9", "9:16"],
"default": "16:9"
},
"resolution": {
"type": "string",
"enum": ["1k", "2k", "4k"],
"default": "1k"
}
},
"x-order-properties": ["prompt", "aspect_ratio", "resolution"],
"required": ["prompt"]
}
}
]
}
}
]
}响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 成功时为 200 |
message | string | 状态信息 |
data | array | 模型对象数组 |
模型对象
| 字段 | 类型 | 说明 |
|---|---|---|
model_id | string | 完整 slug {provider_id}/{model_id}/{run_type},与提交路径一致 |
name | string | 展示名称 |
provider_id | string | 提供方,例如 google、kling |
description | string | 模型简介(价格见 base_price,不在此字段中) |
type | string | 运行类型,见模型类型 |
base_price | number|null | 每个 billing_unit 的起步价(美元);未定价时为 null |
currency | string | 固定为 USD |
billing_unit | string|null | 计费单位,例如 image、second、request、1M tokens |
api_schema | object | 调用方式 |
base_price 是该模型的最低价,实际扣费取决于分辨率、时长等参数,详见计费方式。
api_schema 对象
| 字段 | 类型 | 说明 |
|---|---|---|
api_schemas | array | 接口 schema 数组 |
api_schemas[].type | string | 固定为 model_run |
api_schemas[].method | string | HTTP 方法 |
api_schemas[].server | string | API 域名 |
api_schemas[].api_path | string | 接口路径;chat 模型为原生协议路径,见对话 API |
api_schemas[].request_schema | object | 请求体的 JSON Schema |
request_schema.x-order-properties 按推荐的展示顺序列出参数。
模型类型
| 类型 | 说明 |
|---|---|
text-to-image | 文生图 |
image-to-image | 图像编辑 / 图生图 |
text-to-video | 文生视频 |
first-to-video | 首帧生视频 |
first-last-to-video | 首尾帧生视频 |
reference-to-video | 参考图生视频 |
edit-to-video | 视频编辑 |
extend-to-video | 视频延长 |
digital-human | 数字人 |
text-to-3d | 文生 3D |
image-to-3d | 图生 3D |
text-to-panorama | 文生全景图 |
image-to-panorama | 图生全景图 |
text-to-speech | 语音合成 |
speech-to-text | 语音识别 |
text-to-music | 音乐生成 |