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
      • POSTCreate a Dataset
      • GETList Datasets
      • GETGet Dataset Usage
      • GETGet a Dataset
      • DELDelete a Dataset
  • Deprecated
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Endpointsv1/datasets

Get a Dataset

GET
https://api.cohere.com/v1/datasets/:id
GET
/v1/datasets/:id
1import cohere
2
3co = cohere.Client()
4
5# get dataset
6response = co.datasets.get(id="<<datasetId>>")
7
8print(response)
1{
2 "dataset": {
3 "id": "dset-9f8b7c6a5e4d3f21",
4 "name": "Customer Support Chat Logs",
5 "created_at": "2024-01-15T09:30:00Z",
6 "updated_at": "2024-04-10T12:45:00Z",
7 "dataset_type": "chat-finetune-input",
8 "validation_status": "validated",
9 "validation_error": "",
10 "schema": "{\"type\":\"record\",\"name\":\"ChatExample\",\"fields\":[{\"name\":\"context\",\"type\":\"string\"},{\"name\":\"response\",\"type\":\"string\"}]}",
11 "required_fields": [
12 "context",
13 "response"
14 ],
15 "preserve_fields": [
16 "metadata",
17 "timestamp"
18 ],
19 "dataset_parts": [
20 {
21 "id": "part-001",
22 "name": "chat_logs_jan.csv",
23 "url": "https://storage.cohere.com/datasets/dset-9f8b7c6a5e4d3f21/part-001.csv",
24 "index": 0,
25 "size_bytes": 2048576,
26 "num_rows": 15000,
27 "original_url": "https://originalsource.com/chat_logs_jan.csv",
28 "samples": [
29 "{\"context\":\"Hello, I need help with my order.\",\"response\":\"Sure, can you provide your order ID?\"}",
30 "{\"context\":\"My internet is not working.\",\"response\":\"Have you tried restarting your router?\"}"
31 ]
32 }
33 ],
34 "validation_warnings": [
35 "Some rows contain missing timestamps",
36 "Detected inconsistent newline characters"
37 ],
38 "parse_info": {},
39 "metrics": {
40 "finetune_dataset_metrics": {
41 "trainable_token_count": 1250000,
42 "total_examples": 15000,
43 "train_examples": 12000,
44 "train_size_bytes": 1800000,
45 "eval_examples": 3000,
46 "eval_size_bytes": 450000,
47 "reranker_data_metrics": {
48 "num_train_queries": 0,
49 "num_train_relevant_passages": 0,
50 "num_train_hard_negatives": 0,
51 "num_eval_queries": 0,
52 "num_eval_relevant_passages": 0,
53 "num_eval_hard_negatives": 0
54 },
55 "chat_data_metrics": {
56 "num_train_turns": 48000,
57 "num_eval_turns": 12000,
58 "preamble": "Customer support chat logs for fine-tuning chat models."
59 },
60 "classify_data_metrics": {
61 "label_metrics": [
62 {
63 "total_examples": 15000,
64 "label": "support",
65 "samples": [
66 "How do I reset my password?",
67 "My shipment is delayed."
68 ]
69 }
70 ]
71 }
72 }
73 }
74 }
75}
Retrieve a dataset by ID. See ['Datasets'](https://docs.cohere.com/docs/datasets) for more information.
Was this page helpful?
Previous

Delete a Dataset

Next
Built with

Retrieve a dataset by ID. See ‘Datasets’ for more information.

Authentication

AuthorizationBearer

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

Path parameters

idstringRequiredformat: "^(?!usage$).*$"

Headers

X-Client-NamestringOptional
The name of the project that is making the request.

Response

A successful response.
datasetobject

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