模型
列出模型
通过 OMA API 列出模型。
GET
/
v1
/
models
列出模型
curl --request GET \
--url http://localhost:38080/v1/models \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/models"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"capabilities": {
"batch": {
"supported": true
},
"citations": {
"supported": true
},
"code_execution": {
"supported": true
},
"context_management": {
"clear_thinking_20251015": {
"supported": true
},
"clear_tool_uses_20250919": {
"supported": true
},
"compact_20260112": {
"supported": true
},
"supported": true
},
"effort": {
"high": {
"supported": true
},
"low": {
"supported": true
},
"max": {
"supported": true
},
"medium": {
"supported": true
},
"supported": true,
"xhigh": {
"supported": true
}
},
"image_input": {
"supported": true
},
"pdf_input": {
"supported": true
},
"structured_outputs": {
"supported": true
},
"thinking": {
"supported": true,
"types": {
"adaptive": {
"supported": true
},
"enabled": {
"supported": true
}
}
}
},
"created_at": "2026-02-04T00:00:00Z",
"display_name": "Opus 4.6",
"id": "claude-opus-4-6",
"max_input_tokens": 123,
"max_tokens": 123,
"type": "model"
}
],
"first_id": "<string>",
"has_more": true,
"last_id": "<string>"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}返回当前 OMA 部署中已配置的模型。
授权
omaApiKeyomaBearer
OMA 工作区 API 密钥。
请求头
你想使用的 OMA API 版本。
在此处阅读更多关于版本控制和我们版本历史的信息。
用于指定要使用的 beta 版本的可选请求头。
要使用多个 beta,请使用逗号分隔的列表(如 beta1,beta2),或为每个 beta 分别指定该请求头。
查询参数
用作分页游标的对象 ID。提供时,返回紧邻该对象之前的结果页。
用作分页游标的对象 ID。提供时,返回紧随该对象之后的结果页。
每页返回的条目数量。
默认为 20。取值范围为 1 到 1000。
必填范围:
1 <= x <= 1000此页面对您有帮助吗?
⌘I
列出模型
curl --request GET \
--url http://localhost:38080/v1/models \
--header 'X-Api-Key: <api-key>'import requests
url = "http://localhost:38080/v1/models"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('http://localhost:38080/v1/models', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/models"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": [
{
"capabilities": {
"batch": {
"supported": true
},
"citations": {
"supported": true
},
"code_execution": {
"supported": true
},
"context_management": {
"clear_thinking_20251015": {
"supported": true
},
"clear_tool_uses_20250919": {
"supported": true
},
"compact_20260112": {
"supported": true
},
"supported": true
},
"effort": {
"high": {
"supported": true
},
"low": {
"supported": true
},
"max": {
"supported": true
},
"medium": {
"supported": true
},
"supported": true,
"xhigh": {
"supported": true
}
},
"image_input": {
"supported": true
},
"pdf_input": {
"supported": true
},
"structured_outputs": {
"supported": true
},
"thinking": {
"supported": true,
"types": {
"adaptive": {
"supported": true
},
"enabled": {
"supported": true
}
}
}
},
"created_at": "2026-02-04T00:00:00Z",
"display_name": "Opus 4.6",
"id": "claude-opus-4-6",
"max_input_tokens": 123,
"max_tokens": 123,
"type": "model"
}
],
"first_id": "<string>",
"has_more": true,
"last_id": "<string>"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}