> This page is for version v1 API.
> For other versions, use one of these documentation indexes:
> - v2 API (default): https://docs.cohere.com/v2/llms.txt
> - v1 API: https://docs.cohere.com/v1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cohere.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cohere.com/_mcp/server.

# List Models

GET https://api.cohere.com/v1/models

Returns a list of models available for use.

Reference: https://docs.cohere.com/reference/list-models

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Query parameters

- `page_size` (double, optional) — Maximum number of models to include in a page Defaults to `20`, min value of `1`, max value of `1000`.
- `page_token` (string, optional) — Page token provided in the `next_page_token` field of a previous response.
- `endpoint` (enum, optional) — When provided, filters the list of models to only those that are compatible with the specified endpoint.
  - Allowed values: `chat`, `embed`, `classify`, `summarize`, `rerank`, `rate`, `generate`
- `default_only` (boolean, optional) — When provided, filters the list of models to only the default model to the endpoint. This parameter is only valid when `endpoint` is provided.

## Response

### 200

OK

- `models` (list of GetModelResponse, required)
- `next_page_token` (string, optional) — A token to retrieve the next page of results. Provide in the page_token parameter of the next request.

## Errors

### 400 Bad Request Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 401 Unauthorized Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 403 Forbidden Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 404 Not Found Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 422 Unprocessable Entity Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 429 Too Many Requests Error

Too many requests

- `message` (string, optional)
- `id` (string, optional)

### 498 Invalid Token Error

This error is returned when a request or response contains a deny-listed token.

- `message` (string, optional)
- `id` (string, optional)

### 499 Client Closed Request Error

This error is returned when a request is cancelled by the user.

- `message` (string, optional)
- `id` (string, optional)

### 500 Internal Server Error

This error is returned when an uncategorised internal server error occurs.

- `message` (string, optional)
- `id` (string, optional)

### 501 Not Implemented Error

This error is returned when the requested feature is not implemented.

- `message` (string, optional)
- `id` (string, optional)

### 503 Service Unavailable Error

This 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

- `message` (string, optional)
- `id` (string, optional)

### 504 Gateway Timeout Error

This error is returned when a request to the server times out. This could be due to: - An internal services taking too long to respond

- `message` (string, optional)
- `id` (string, optional)

## Types

### GetModelResponse

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

- `name` (string, optional) — Specify this name in the `model` parameter of API requests to use your chosen model.
- `is_deprecated` (boolean, optional) — Whether the model is deprecated or not.
- `endpoints` (list of enum, optional) — The API endpoints that the model is compatible with.
  - Allowed values: `chat`, `embed`, `classify`, `summarize`, `rerank`, `rate`, `generate`
- `finetuned` (boolean, optional) — Whether the model has been fine-tuned or not.
- `context_length` (double, optional) — 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.
- `tokenizer_url` (string, optional) — Public URL to the tokenizer's configuration file.
- `default_endpoints` (list of enum, optional) — The API endpoints that the model is default to.
  - Allowed values: `chat`, `embed`, `classify`, `summarize`, `rerank`, `rate`, `generate`
- `features` (list of string, optional) — The features that the model supports.
- `sampling_defaults` (GetModelResponseSamplingDefaults, optional) — Default sampling parameters for this model when omitted from API requests.

### GetModelResponseSamplingDefaults

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

- `temperature` (double, optional)
- `k` (integer, optional)
- `p` (double, optional)
- `frequency_penalty` (double, optional)
- `presence_penalty` (double, optional)
- `max_tokens_per_doc` (integer, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "models": [
    {
      "name": "command-xlarge-nightly",
      "is_deprecated": false,
      "endpoints": [
        "generate",
        "chat"
      ],
      "finetuned": false,
      "context_length": 2048,
      "tokenizer_url": "https://cohere.com/tokenizer/command-xlarge-nightly.json",
      "default_endpoints": [
        "generate"
      ],
      "features": [
        "text-generation",
        "chat-completions"
      ],
      "sampling_defaults": {
        "temperature": 0.75,
        "k": 40,
        "p": 0.9,
        "frequency_penalty": 0,
        "presence_penalty": 0,
        "max_tokens_per_doc": 300
      }
    }
  ],
  "next_page_token": "eyJwYWdlIjoxfQ=="
}
```

**SDK Code**

```python Sync
import cohere

co = cohere.Client()
response = co.models.list()
print(response)

```

```python Async
import cohere
import asyncio

co = cohere.AsyncClient()


async def main():
    response = await co.models.list()
    print(response)


asyncio.run(main())

```

```java Cohere java SDK
/* (C)2024 */
import com.cohere.api.Cohere;
import com.cohere.api.types.ListModelsResponse;

public class ModelsListGet {
  public static void main(String[] args) {
    Cohere cohere = Cohere.builder().clientName("snippet").build();

    ListModelsResponse response = cohere.models().list();

    System.out.println(response);
  }
}

```

```typescript Cohere TypeScript SDK
import { CohereClient } from 'cohere-ai';

const cohere = new CohereClient({});

(async () => {
  const models = await cohere.models.list();

  console.log(models);
})();

```

```go Cohere Go SDK
package main

import (
	"context"
	"log"
	"os"

	cohere "github.com/cohere-ai/cohere-go/v2"
	client "github.com/cohere-ai/cohere-go/v2/client"
)

func main() {
	co := client.NewClient(client.WithToken(os.Getenv("CO_API_KEY")))

	resp, err := co.Models.List(context.TODO(), &cohere.ModelsListRequest{})

	if err != nil {
		log.Fatal(err)
	}

	log.Printf("%+v", resp)
}

```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.cohere.com/v1/models")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cohere.com/v1/models', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.cohere.com/v1/models");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.cohere.com/v1/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```