List Models
curl --request GET \
--url https://api.moonshot.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.ai/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.moonshot.ai/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.moonshot.ai/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.moonshot.ai/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.moonshot.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.ai/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": "kimi-k2.5",
"object": "model",
"created": 123,
"owned_by": "moonshot",
"context_length": 123,
"supports_image_in": true,
"supports_video_in": true,
"supports_reasoning": true
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}List Models
List all currently available models.
GET
/
v1
/
models
List Models
curl --request GET \
--url https://api.moonshot.ai/v1/models \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.moonshot.ai/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.moonshot.ai/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.moonshot.ai/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.moonshot.ai/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.moonshot.ai/v1/models")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.moonshot.ai/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": "kimi-k2.5",
"object": "model",
"created": 123,
"owned_by": "moonshot",
"context_length": 123,
"supports_image_in": true,
"supports_video_in": true,
"supports_reasoning": true
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}List all currently available models, including model ID, context length, and capability flags. We recommend querying this endpoint before creating a chat completion to verify the target model is available and supports the required capabilities.
Usage Example
Usage Example
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ.get("MOONSHOT_API_KEY"),
base_url="https://api.moonshot.ai/v1",
)
models = client.models.list()
print(models.data)
curl https://api.moonshot.ai/v1/models \
-H "Authorization: Bearer $MOONSHOT_API_KEY"
const OpenAI = require("openai");
const client = new OpenAI({
apiKey: process.env.MOONSHOT_API_KEY,
baseURL: "https://api.moonshot.ai/v1",
});
async function main() {
const models = await client.models.list();
console.log(models.data);
}
main();
Response Fields
Response Fields
The response is an object containing the following fields:
Each model object in the
| Field | Type | Description |
|---|---|---|
object | string | Object type, always "list" |
data | array[object] | List of models, each element is a model object |
data array has the following fields:| Field | Type | Description |
|---|---|---|
id | string | Model ID, e.g. kimi-k2.5 |
object | string | Object type, always "model" |
created | integer | Unix timestamp when the model was created |
owned_by | string | Model owner identifier, e.g. "moonshot" |
context_length | integer | Maximum context length supported by the model (tokens) |
supports_image_in | boolean | Whether the model supports image input |
supports_video_in | boolean | Whether the model supports video input |
supports_reasoning | boolean | Whether the model supports deep thinking |
The model list and capability flags may change as the platform is updated. If you receive a
resource_not_found_error (404) when creating a chat completion, the model does not exist or your account does not have access to it. Check the model parameter spelling and confirm your account tier.This endpoint requires a valid API Key for authentication. If you receive a 401 error, verify that the
Authorization header is Bearer <MOONSHOT_API_KEY> and that the API Key matches the platform endpoint (Keys from platform.kimi.ai and platform.kimi.com are not interchangeable).Authorizations
The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Was this page helpful?
⌘I