For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
Guides and conceptsAPI ReferenceRelease NotesLLMUCookbooks
  • Cohere API
    • About
    • Teams and Roles
    • Errors
    • Migrating From API v1 to API v2
    • Using the OpenAI SDK
  • Endpoints
      • GETGet a Model
      • GETList Models
  • Deprecated
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Endpointsv1/models

List Models

GET
https://api.cohere.com/v1/models
GET
/v1/models
1import cohere
2
3co = cohere.Client()
4response = co.models.list()
5print(response)
1{
2 "models": [
3 {
4 "name": "command-xlarge-nightly",
5 "is_deprecated": false,
6 "endpoints": [
7 "generate",
8 "chat"
9 ],
10 "finetuned": false,
11 "context_length": 2048,
12 "tokenizer_url": "https://cohere.com/tokenizer/command-xlarge-nightly.json",
13 "default_endpoints": [
14 "generate"
15 ],
16 "features": [
17 "text-generation",
18 "chat-completions"
19 ],
20 "sampling_defaults": {
21 "temperature": 0.75,
22 "k": 40,
23 "p": 0.9,
24 "frequency_penalty": 0,
25 "presence_penalty": 0,
26 "max_tokens_per_doc": 300
27 }
28 }
29 ],
30 "next_page_token": "eyJwYWdlIjoxfQ=="
31}
Returns a list of models available for use.
Was this page helpful?
Previous

Classify

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Query parameters

page_sizedoubleOptional

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

page_tokenstringOptional

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

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

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

OK
modelslist of objects
next_page_tokenstring

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

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
498
Invalid Token Error
499
Client Closed Request Error
500
Internal Server Error
501
Not Implemented Error
503
Service Unavailable Error
504
Gateway Timeout Error