API Reference
Native OpenAI Format
Get a list of currently available models.
Automatically identify the return format based on the request headers:
- Returns Anthropic format when
x-api-keyandanthropic-versionheaders are present - Returns Gemini format when
x-goog-api-keyheader orkeyquery parameter is present - Returns OpenAI format in other cases
GET
/r1/modelsAuthorization
BearerAuth
AuthorizationBearer <token>使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx
In: header
Query Parameters
key?stringGoogle API Key (用于 Gemini 格式)
Header Parameters
x-api-key?stringAnthropic API Key (用于 Claude 格式)
anthropic-version?stringAnthropic API 版本
x-goog-api-key?stringGoogle API Key (用于 Gemini 格式)
Response Body
curl -X GET "https://ai-tokens.space/r1/models"{
"object": "list",
"data": [
{
"id": "gpt-4",
"object": "model",
"created": 0,
"owned_by": "openai"
}
]
}{
"error": {
"message": "string",
"type": "string",
"param": "string",
"code": "string"
}
}