Model List

Query the list of available models on the DeepSeek API, retrieving model identifiers and ownership information.

Through the model list API, you can query all available models on the current DeepSeek platform, retrieving each model's identifier and ownership information. This is useful when you need to dynamically select models, build model selector UIs, or validate model availability.

Basic Usage

Get the list of available models via the model instance's list() method:

import { createModel } from 'deepseek-kit'

const model = createModel({ model: 'deepseek-v4-flash' })

const response = await model.list()

console.log(response.data)

The response contains a data array, where each item represents an available model:

[
  { id: 'deepseek-v4-flash', object: 'model', owned_by: 'deepseek' },
  { id: 'deepseek-v4-pro', object: 'model', owned_by: 'deepseek' },
]

Extracting Model Names

Extract all model names from the response for building a model selector:

const response = await model.list()

const modelNames = response.data.map(m => m.id)
console.log(modelNames)
// ['deepseek-v4-flash', 'deepseek-v4-pro']

Validating Model Availability

Check whether a target model is available before creating a model instance:

import { createModel } from 'deepseek-kit'

const model = createModel({ model: 'deepseek-v4-flash' })

const response = await model.list()
const availableModels = response.data.map(m => m.id)

const targetModel = 'deepseek-v4-pro'

if (availableModels.includes(targetModel)) {
  console.log(`${targetModel} is available`)
}
else {
  console.log(`${targetModel} is not available`)
}

Custom Configuration

The list() method supports passing custom configuration to override the default API Key, Base URL, or timeout:

const response = await model.list({
  timeout: 10000,
})

API Reference

model.list() Parameters

apiKeystring
API key. Defaults to the model instance's configuration.
baseURLstring
API base URL. Defaults to the model instance's configuration.
timeoutnumber
Request timeout in milliseconds.

ListModelsResponse

object'list'
Response object type, fixed as 'list'.
dataModelInfo[]
List of available models. Each item contains the following fields:
ModelInfo.idstring
Model identifier, which can be referenced in API requests.
ModelInfo.object'model'
Object type, fixed as 'model'.
ModelInfo.owned_bystring
Model owning organization.