Skip to main content
REST API 现已经过版本控制。 有关详细信息,请参阅“关于 API 版本控制”。

用于模型目录的 REST API 终结点

可以使用 REST API 获取可用模型的列表,包括模型的 ID、支持的输入/输出形式、速率限制等详细信息。

关于 GitHub Models 目录

可使用 REST API 浏览 GitHub Models 目录中的可用模型。

List all models

Get a list of models available for use, including details like supported input/output modalities, publisher, and rate limits.

“List all models”的 HTTP 响应状态代码

状态代码说明
200

OK

“List all models”的示例代码

请求示例

get/catalog/models
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://models.github.ai/catalog/models

响应

Status: 200
[ { "id": "openai/gpt-4.1", "name": "OpenAI GPT-4.1", "publisher": "OpenAI", "registry": "azure-openai", "summary": "gpt-4.1 outperforms gpt-4o across the board, with major gains in coding, instruction following, and long-context understanding", "html_url": "https://github.com/marketplace/models/azure-openai/gpt-4-1", "version": "2025-04-14", "capabilities": [ "streaming", "tool-calling" ], "limits": { "max_input_tokens": 1048576, "max_output_tokens": 32768 }, "rate_limit_tier": "high", "supported_input_modalities": [ "text", "image", "audio" ], "supported_output_modalities": [ "text" ], "tags": [ "multipurpose", "multilingual", "multimodal" ] } ]