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

# Create Batch Job

`POST /v1/batch/jobs`

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

---

[API](https://skmtc.net/mistral/apis/mistral-ai-api.md) · [All operations](https://skmtc.net/mistral/apis/mistral-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mistral/mistral-ai-api/revisions/933c4ebdcd72/schema)
