Cohere Batches API
The batches API from Cohere — 3 operation(s) for batches.
The batches API from Cohere — 3 operation(s) for batches.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/cohere:cohere-batches-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Cohere Batches API
version: 1.0.0
servers:
- url: https://api.cohere.com
description: production
tags:
- name: Batches
paths:
/v2/batches:
post:
operationId: batches_create
summary: Create a batch
description: Creates and executes a batch from an uploaded dataset of requests
tags:
- Batches
parameters:
- name: X-Client-Name
in: header
description: 'The name of the project that is making the request.
'
required: false
schema:
type: string
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/CreateBatchResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'503':
description: Status Service Unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
requestBody:
description: 'Information about the batch. Must contain name, input_dataset_id, and
model. Output-only fields are ignored.'
content:
application/json:
schema:
$ref: '#/components/schemas/Batch'
security:
- bearerAuth: []
get:
operationId: batches_list
summary: List batches
description: List the batches for the current user
tags:
- Batches
parameters:
- name: page_size
in: query
description: '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.'
required: false
schema:
type: integer
- name: page_token
in: query
description: 'A page token, received from a previous `ListBatches` call.
Provide this to retrieve the subsequent page.'
required: false
schema:
type: string
- name: order_by
in: query
description: 'Batches can be ordered by creation time or last updated time.
Use `created_at` for creation time or `updated_at` for last updated time.'
required: false
schema:
type: string
- name: X-Client-Name
in: header
description: 'The name of the project that is making the request.
'
required: false
schema:
type: string
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ListBatchesResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'503':
description: Status Service Unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
security:
- bearerAuth: []
/v2/batches/{id}:
get:
operationId: batches_retrieve
summary: Retrieve a batch
description: Retrieves a batch
tags:
- Batches
parameters:
- name: id
in: path
description: The batch ID.
required: true
schema:
type: string
- name: X-Client-Name
in: header
description: 'The name of the project that is making the request.
'
required: false
schema:
type: string
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/GetBatchResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'503':
description: Status Service Unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
security:
- bearerAuth: []
/v2/batches/{id}:cancel:
post:
operationId: batches_cancel
summary: Cancel a batch
description: Cancels an in-progress batch
tags:
- Batches
parameters:
- name: id
in: path
description: The batch ID.
required: true
schema:
type: string
- name: X-Client-Name
in: header
description: 'The name of the project that is making the request.
'
required: false
schema:
type: string
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/CancelBatchResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
'503':
description: Status Service Unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/BatchError'
security:
- bearerAuth: []
components:
schemas:
BatchStatus:
type: string
enum:
- BATCH_STATUS_UNSPECIFIED
- BATCH_STATUS_QUEUED
- BATCH_STATUS_IN_PROGRESS
- BATCH_STATUS_CANCELING
- BATCH_STATUS_COMPLETED
- BATCH_STATUS_FAILED
- BATCH_STATUS_CANCELED
default: BATCH_STATUS_UNSPECIFIED
description: "The possible stages of a batch life-cycle.\n\n - BATCH_STATUS_UNSPECIFIED: Unspecified status.\n - BATCH_STATUS_QUEUED: The batch has been queued.\n - BATCH_STATUS_IN_PROGRESS: The batch is in-progress.\n - BATCH_STATUS_CANCELING: The batch is being canceled.\n - BATCH_STATUS_COMPLETED: The batch has been completed.\n - BATCH_STATUS_FAILED: The batch has failed.\n - BATCH_STATUS_CANCELED: The batch has been canceled."
title: BatchStatus
GetBatchResponse:
type: object
properties:
batch:
$ref: '#/components/schemas/Batch'
description: Information about the batch.
required:
- batch
description: Response to a request to get a batch.
title: GetBatchResponse
BatchError:
type: object
properties:
message:
type: string
description: A developer-facing error message.
description: Error is the response for any unsuccessful event.
title: BatchError
Batch:
type: object
properties:
id:
type: string
description: read-only. Batch ID.
name:
type: string
description: Batch name (e.g. `foobar`).
creator_id:
type: string
description: read-only. User ID of the creator.
org_id:
type: string
description: read-only. Organization ID.
status:
$ref: '#/components/schemas/BatchStatus'
default: BATCH_STATUS_UNSPECIFIED
description: read-only. Current stage in the life-cycle of the batch.
created_at:
type: string
format: date-time
description: read-only. Creation timestamp.
updated_at:
type: string
format: date-time
description: read-only. Latest update timestamp.
input_dataset_id:
type: string
description: ID of the dataset the batch reads inputs from.
output_dataset_id:
type: string
input_tokens:
type: string
format: int64
description: read-only. The total number of input tokens in the batch.
output_tokens:
type: string
format: int64
description: read-only. The total number of output tokens in the batch.
model:
type: string
description: The name of the model the batch uses.
num_records:
type: integer
description: read-only. The total number of records in the batch.
num_successful_records:
type: integer
description: read-only. The current number of successful records in the batch.
num_failed_records:
type: integer
description: read-only. The current number of failed records in the batch.
status_reason:
type: string
description: read-only. More details about the reason for the status of a batch job.
required:
- name
- input_dataset_id
- model
description: This resource represents a batch job.
title: Batch
CancelBatchResponse:
type: object
properties: {}
description: Response to a request to cancel a batch.
title: CancelBatchResponse
CreateBatchResponse:
type: object
properties:
batch:
$ref: '#/components/schemas/Batch'
description: Information about the batch.
required:
- batch
description: Response to request to create a batch.
title: CreateBatchResponse
ListBatchesResponse:
type: object
properties:
batches:
type: array
items:
$ref: '#/components/schemas/Batch'
description: The batches that belong to the authenticated user.
next_page_token:
type: string
description: 'A token, which can be sent as `page_token` to retrieve the next page.
If this field is omitted, there are no subsequent pages.'
description: Response to a request to list batches.
title: ListBatchesResponse
securitySchemes:
bearerAuth:
type: http
scheme: bearer