---
title: "Create Batch Job"
method: POST
path: "/v1/batch/jobs"
tags: ["batch"]
---

# Create Batch Job

`POST /v1/batch/jobs`

## Request

- Base URL: `https://api.mistral.ai`
- URL: `https://api.mistral.ai/v1/batch/jobs`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/mistral/apis/mistral-ai-api/docs/v1/batch/jobs/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new batch job, it will be queued for processing.

## Request body

- CreateBatchJobRequest
  - `input_files` string[], nullable: A list of `.jsonl` files for batch inference. Each line must be a JSON object with a `body` field containing the request payload: ```json {"custom_id": "0", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French cheese?"}]}} {"custom_id": "1", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French wine?"}]}} ```
  - `requests` BatchRequest[], nullable
    - `custom_id` string, nullable
    - `body` object, required
  - `endpoint` '/v1/chat/completions' | '/v1/embeddings' | '/v1/fim/completions' | '/v1/moderations' | '/v1/chat/moderations' | '/v1/ocr' | '/v1/classifications' | '/v1/chat/classifications' | '/v1/conversations' | '/v1/audio/transcriptions', required
  - `model` string, nullable: The model to be used for batch inference.
  - `agent_id` string, nullable: In case you want to use a specific agent from the **deprecated** agents api for batch inference, you can specify the agent ID here.
  - `metadata` object, nullable: The metadata of your choice to be associated with the batch inference job.
  - `timeout_hours` integer: The timeout in hours for the batch inference job.

## Response `200`

OK

- BatchJob
  - `id` string, required
  - `object` 'batch'
  - `input_files` string[], required
  - `metadata` object, nullable
  - `endpoint` string, required
  - `model` string, nullable
  - `agent_id` string, nullable
  - `output_file` string, uuid, nullable
  - `error_file` string, uuid, nullable
  - `errors` BatchError[], required
    - `message` string, required
    - `count` integer
  - `outputs` object[], nullable
  - `status` 'QUEUED' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'TIMEOUT_EXCEEDED' | 'CANCELLATION_REQUESTED' | 'CANCELLED', required
  - `created_at` integer, required
  - `total_requests` integer, required
  - `completed_requests` integer, required
  - `succeeded_requests` integer, required
  - `failed_requests` integer, required
  - `started_at` integer, nullable
  - `completed_at` integer, nullable

## Changes

- **2026-07-26** `933c4ebdcd72`: 2 warning
  - the `timeout_hours` request property's max was set to `168.00`
  - the `timeout_hours` request property's min was set to `1.00`
- **2026-04-07** `ff8a7389b7a4`: 2 info
  - the `object` response property const value `batch` was added for the status `200`
  - removed the `batch` enum value from the `object` response property for the response status `200`
- **2026-03-01** `37659aafcad6`: 4 info
  - added the new optional request property `requests`
  - the request property `input_files` became optional
  - request property `input_files` list-of-types was widened by adding types `null` to media type `application/json`
  - added the optional property `outputs` to the response with the `200` status

[Operation history](https://skmtc.dev/mistral/apis/mistral-ai-api/changes/v1/batch/jobs/post.md)

---

[API](https://skmtc.dev/mistral/apis/mistral-ai-api.md) - [All operations](https://skmtc.dev/mistral/apis/mistral-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mistral/apis/mistral-ai-api/revisions/08a585fb75bc?raw)
