List models
curl --request GET \
--url https://api-direct.dimilinks.com/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-direct.dimilinks.com/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-direct.dimilinks.com/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-direct.dimilinks.com/v1/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-direct.dimilinks.com/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-direct.dimilinks.com/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-direct.dimilinks.com/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "claude-sonnet-5",
"object": "model",
"created": 1777080000,
"owned_by": ""
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>"
}
}基础
List models
查询当前 API Key 可用的模型。
GET
/
models
List models
curl --request GET \
--url https://api-direct.dimilinks.com/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-direct.dimilinks.com/v1/models"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-direct.dimilinks.com/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-direct.dimilinks.com/v1/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-direct.dimilinks.com/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-direct.dimilinks.com/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-direct.dimilinks.com/v1/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "claude-sonnet-5",
"object": "model",
"created": 1777080000,
"owned_by": ""
}
]
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"code": "<string>"
}
}查询当前密钥可以调用的模型列表。返回的
data[] 同时包含文本、图片、视频模型,可按 id 命名前缀区分。
请求
curl "https://api-direct.dimilinks.com/v1/models" \
-H "Authorization: Bearer $DIMILINKS_API_KEY"
响应
{
"object": "list",
"data": [
{ "id": "claude-opus-4-8", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "claude-sonnet-5", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "claude-haiku-4-5", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "gpt-5.5", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "gpt-5.6-terra", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "kimi-k2.7-code", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "qwen3.7-max", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "gpt-image-2", "object": "model", "created": 1777080000, "owned_by": "" },
{ "id": "grok-imagine-video", "object": "model", "created": 1777080000, "owned_by": "" }
]
}
推荐模型
| 用途 | 推荐模型 |
|---|---|
| 通用对话、写作、长文档处理 | claude-sonnet-5、claude-opus-4-8、gpt-5.5 |
| 复杂推理 / 编码 | claude-opus-4-8、kimi-k2.7-code、gpt-5.6-terra |
| 低成本批量任务 | claude-haiku-4-5、gpt-5.4-mini、deepseek-v4-flash |
| 图片生成 / 编辑 | gpt-image-2 |
| 视频生成 | grok-imagine-video |
使用建议
- 模型清单会随线上能力调整,请把
/v1/models作为运行时来源,不要写死硬编码。 - 查看近期型号和能力字段的选择方法,请继续阅读 模型选择与更新。
- 不同模型属于不同分组,分组直接决定计费倍率,详见 Model groups & pricing。
- 如果返回
403 model_not_allowed,请检查这把密钥是否被授权调用该模型;多数情况是 API Key 可用分组与目标模型enable_groups没有交集。 - 文本模型默认走
/v1/chat/completions或/v1/messages;图片走/v1/images/*;视频走/v1/videos/*。