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 batch
      • GETList batches
      • GETRetrieve a batch
      • POSTCancel a batch
  • Deprecated
LogoLogodocs
DASHBOARDPLAYGROUNDDOCSCOMMUNITYLOG IN
Endpointsv2/batches

Retrieve a batch

GET
https://api.cohere.com/v2/batches/:id
GET
/v2/batches/:id
1import cohere
2
3co = cohere.ClientV2()
4
5batch_job = co.batches.retrieve("<batch_job_id>")
1{
2 "batch": {
3 "name": "my-batch",
4 "input_dataset_id": "my-requests-dataset",
5 "model": "batch-command",
6 "id": "9439e0e3-49a4-4336-93e3-485fc420bc18",
7 "creator_id": "b5e1ffb9-49a1-4653-9927-94083316309d",
8 "org_id": "62603116-1750-4c04-b1b6-9d5046764bc4",
9 "status": "BATCH_STATUS_IN_PROGRESS",
10 "created_at": "2024-01-15T09:30:00Z",
11 "updated_at": "2024-01-15T09:30:00Z",
12 "output_dataset_id": "my-batch-output-c2waz1",
13 "input_tokens": "0",
14 "output_tokens": "0",
15 "num_records": 5000,
16 "num_successful_records": 8,
17 "num_failed_records": 0
18 }
19}
Retrieves a batch
Was this page helpful?
Previous

Cancel a batch

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

idstringRequired
The batch ID.

Headers

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

Response

A successful response.
batchobject
Information about the batch.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error
503
Service Unavailable Error