Skip to main content
Cohere

Search documentation

Type to search this documentation.

List Models

GET/v1/modelsList Models

Returns a list of models available for use.

Parameters

page_sizenumberquery

Maximum number of models to include in a page Defaults to `20`, min value of `1`, max value of `1000`.

page_tokenstringquery

Page token provided in the `next_page_token` field of a previous response.

endpointstringquery

When provided, filters the list of models to only those that are compatible with the specified endpoint.

one of "chat", "embed", "classify", "summarize", "rerank", "rate", "generate"

one of "chat", "embed", "classify", "summarize", "rerank", "rate", "generate"

default_onlybooleanquery

When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided.

Responses

200OKapplication/json
objectListModelsResponse
modelsarray of objectrequired
Show child attributes
Show array items

Contains information about the model and which API endpoints it can be used with.

context_lengthnumber

The maximum number of tokens that the model can process in a single request. Note that not all of these tokens are always available due to special tokens and preambles that Cohere has added by default.

default_endpointsarray of string

The API endpoints that the model is default to.

Show child attributes
endpointsarray of string

The API endpoints that the model is compatible with.

Show child attributes
featuresarray of string

The features that the model supports.

Show child attributes
finetunedboolean

Whether the model has been fine-tuned or not.

is_deprecatedboolean

Whether the model is deprecated or not.

namestring

Specify this name in the `model` parameter of API requests to use your chosen model.

sampling_defaultsobject

Default sampling parameters for this model when omitted from API requests.

Show child attributes
frequency_penaltynumber · float
kinteger · int32
max_tokens_per_docinteger · int32
pnumber · float
presence_penaltynumber · float
temperaturenumber · float
tokenizer_urlstring

Public URL to the tokenizer's configuration file.

next_page_tokenstring

A token to retrieve the next page of results. Provide in the page_token parameter of the next request.

Example response
{
  "models": [
    {
      "context_length": 0,
      "default_endpoints": [
        "chat"
      ],
      "endpoints": [
        "chat"
      ],
      "features": [
        "string"
      ],
      "finetuned": true,
      "is_deprecated": true,
      "name": "string",
      "sampling_defaults": {
        "frequency_penalty": 0,
        "k": 0,
        "max_tokens_per_doc": 0,
        "p": 0,
        "presence_penalty": 0,
        "temperature": 0
      },
      "tokenizer_url": "string"
    }
  ],
  "next_page_token": "string"
}
400This error is returned when the request is not well formed. This could be because: - JSON is invalid - The request is missing required fields - The request contains an invalid combination of fields application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
401This error indicates that the operation attempted to be performed is not allowed. This could be because: - The api token is invalid - The user does not have the necessary permissions application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
403This error indicates that the operation attempted to be performed is not allowed. This could be because: - The api token is invalid - The user does not have the necessary permissions application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
404This error is returned when a resource is not found. This could be because: - The endpoint does not exist - The resource does not exist eg model id, dataset id application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
422This error is returned when the request is not well formed. This could be because: - JSON is invalid - The request is missing required fields - The request contains an invalid combination of fields application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
429Too many requestsapplication/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
498This error is returned when a request or response contains a deny-listed token. application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
499This error is returned when a request is cancelled by the user. application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
500This error is returned when an uncategorised internal server error occurs. application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
501This error is returned when the requested feature is not implemented. application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
503This error is returned when the service is unavailable. This could be due to: - Too many users trying to access the service at the same time application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
504This error is returned when a request to the server times out. This could be due to: - An internal services taking too long to respond application/json
object
idstring
messagestring
Example response
{
  "id": "string",
  "message": "string"
}
Documentation menu