> This page is for version v2 API (default).
> 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 batches

GET https://api.cohere.com/v2/batches

List the batches for the current user

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

## Authentication

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

## Request

### Query parameters

- `page_size` (integer, optional) — The maximum number of batches to return. The service may return fewer than this value. If unspecified, at most 50 batches will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
- `page_token` (string, optional) — A page token, received from a previous `ListBatches` call. Provide this to retrieve the subsequent page.
- `order_by` (string, optional) — Batches can be ordered by creation time or last updated time. Use `created_at` for creation time or `updated_at` for last updated time.

### Headers

- `X-Client-Name` (string, optional) — The name of the project that is making the request.

## Response

### 200

A successful response.

- `batches` (list of Batch, optional) — The batches that belong to the authenticated user.
- `next_page_token` (string, optional) — A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional) — A developer-facing error message.

### 401 Unauthorized Error

Unauthorized

- `message` (string, optional) — A developer-facing error message.

### 403 Forbidden Error

Forbidden

- `message` (string, optional) — A developer-facing error message.

### 404 Not Found Error

Not Found

- `message` (string, optional) — A developer-facing error message.

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional) — A developer-facing error message.

### 503 Service Unavailable Error

Status Service Unavailable

- `message` (string, optional) — A developer-facing error message.

## Types

### Batch

This resource represents a batch job.

- `name` (string, required) — Batch name (e.g. `foobar`).
- `input_dataset_id` (string, required) — ID of the dataset the batch reads inputs from.
- `model` (string, required) — The name of the model the batch uses.
- `id` (string, optional) — read-only. Batch ID.
- `creator_id` (string, optional) — read-only. User ID of the creator.
- `org_id` (string, optional) — read-only. Organization ID.
- `status` (enum, optional, default: BATCH_STATUS_UNSPECIFIED) — read-only. Current stage in the life-cycle of the batch.
  - Allowed values: `BATCH_STATUS_UNSPECIFIED`, `BATCH_STATUS_QUEUED`, `BATCH_STATUS_IN_PROGRESS`, `BATCH_STATUS_CANCELING`, `BATCH_STATUS_COMPLETED`, `BATCH_STATUS_FAILED`, `BATCH_STATUS_CANCELED`
- `created_at` (string, optional) — read-only. Creation timestamp.
- `updated_at` (string, optional) — read-only. Latest update timestamp.
- `output_dataset_id` (string, optional)
- `input_tokens` (string, optional) — read-only. The total number of input tokens in the batch.
- `output_tokens` (string, optional) — read-only. The total number of output tokens in the batch.
- `num_records` (integer, optional) — read-only. The total number of records in the batch.
- `num_successful_records` (integer, optional) — read-only. The current number of successful records in the batch.
- `num_failed_records` (integer, optional) — read-only. The current number of failed records in the batch.
- `status_reason` (string, optional) — read-only. More details about the reason for the status of a batch job.

## Examples

**Response**

```json
{
  "batches": [
    {
      "name": "my-batch",
      "input_dataset_id": "my-requests-dataset",
      "model": "command",
      "id": "9439e0e3-49a4-4336-93e3-485fc420bc18",
      "creator_id": "b5e1ffb9-49a1-4653-9927-94083316309d",
      "org_id": "62603116-1750-4c04-b1b6-9d5046764bc4",
      "status": "BATCH_STATUS_IN_PROGRESS",
      "num_records": 5000
    }
  ]
}
```

**SDK Code**

```python Default
import cohere

co = cohere.ClientV2()

batches = co.batches.list()
```

```typescript Default
import { CohereClient } from 'cohere-ai';

const cohere = new CohereClient({});

(async () => {
  const batches = await cohere.batches.list();
  console.log(batches);
})();

```

```go Default
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.Batches.List(
		context.TODO(),
		&cohere.BatchesListBatchesRequest{})

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

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

```

```java Default
import com.cohere.api.Cohere;
import com.cohere.api.resources.batches.types.ListBatchesResponse;

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

    ListBatchesResponse response = cohere.batches().list();

    System.out.println(response);
  }
}
```

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

url = URI("https://api.cohere.com/v2/batches")

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

request = Net::HTTP::Get.new(url)
request["X-Client-Name"] = 'my-cool-project'
request["Authorization"] = 'Bearer <token>'

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

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.cohere.com/v2/batches', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'X-Client-Name' => 'my-cool-project',
  ],
]);

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

```csharp batches_list_example
using RestSharp;

var client = new RestClient("https://api.cohere.com/v2/batches");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Client-Name", "my-cool-project");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift batches_list_example
import Foundation

let headers = [
  "X-Client-Name": "my-cool-project",
  "Authorization": "Bearer <token>"
]

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

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()
```