---
title: "Create a batch job"
method: POST
path: "/v1/batches"
tags: ["Batch"]
---

# Create a batch job

`POST /v1/batches`

Creates a batch job for asynchronous processing.

## Request body

- BatchCreateRequest
  - `model` string, required — Model in provider/model format
  - `input_file_id` string — OpenAI-style file ID
  - `requests` object[] — Anthropic-style inline requests
    - `custom_id` string, required
    - `method` string
    - `url` string
    - `body` object
    - `params` object
  - `endpoint` '/v1/chat/completions' | '/v1/embeddings' | '/v1/completions' | '/v1/responses' | '/v1/messages'
  - `completion_window` string — e.g., "24h"
  - `metadata` object

## Response `200`

Successful response

- BatchCreateResponse
  - `id` string
  - `object` string
  - `endpoint` string
  - `input_file_id` string
  - `completion_window` string
  - `status` 'validating' | 'failed' | 'in_progress' | 'finalizing' | 'completed' | 'expired' | 'cancelling' | 'canceled' | 'ended'
  - `request_counts` object
    - `total` integer
    - `completed` integer
    - `failed` integer
    - `succeeded` integer
    - `expired` integer
    - `canceled` integer
    - `pending` integer
  - `metadata` object
  - `created_at` integer
  - `expires_at` integer
  - `output_file_id` string
  - `error_file_id` string
  - `processing_status` string
  - `results_url` string
  - `operation_name` string
  - `extra_fields` BifrostResponseExtraFields — Additional fields included in responses
    - `request_type` string — Type of request that was made
    - `provider` 'openai' | 'azure' | 'anthropic' | 'bedrock' | 'cohere' | 'vertex' | 'vllm' | 'mistral' | 'ollama' | 'groq' | 'sgl' | 'parasail' | 'perplexity' | 'replicate' | 'cerebras' | 'deepseek' | 'gemini' | 'openrouter' | 'elevenlabs' | 'huggingface' | 'nebius' | 'xai' | 'runway' | 'fireworks' — AI model provider identifier
    - `model_requested` string — The model that was requested
    - `model_deployment` string — The actual model deployment used
    - `latency` integer — Request latency in milliseconds
    - `chunk_index` integer — Index of the chunk for streaming responses
    - `raw_request` object — Raw request if enabled
    - `raw_response` object — Raw response if enabled
    - `cache_debug` BifrostCacheDebug
      - `cache_hit` boolean
      - `cache_id` string
      - `hit_type` string
      - `requested_provider` string
      - `requested_model` string
      - `provider_used` string
      - `model_used` string
      - `input_tokens` integer
      - `threshold` number
      - `similarity` number

## Other responses

- `400` — Bad request
- `500` — Internal server error

---

[API](https://skmtc.net/getbifrost/apis/bifrost-api.md) · [All operations](https://skmtc.net/getbifrost/apis/bifrost-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbifrost/bifrost-api/versions/f8cab88f64ea/schema)
