- Get started
- Introduction
- Authentication
- Making requests
- Streaming
- Audio
- Batch
- Models
- Invites
- Chat
- Users
- Projects
- Project users
- Project service accounts
- Project API keys
- Audit logs
- Usage
- Project rate limits
- Completions
- Uploads
- Embeddings
- Files
- Moderations
- Assistants (v1)
- Threads (v1)
- Messages (v1)
- Runs (v1)
- Images
- Fine-tuning
List batch
GET
https://api.openai.com/v1/batches
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Query Params
limit
stringÂ
required
Example:
2
Header Params
Authorization
stringÂ
required
Example:
Bearer $OPENAI_API_KEY
Content-Type
stringÂ
required
Example:
application/json
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.openai.com/v1/batches?limit=2' \
--header 'Authorization: Bearer $OPENAI_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw ''
Responses
🟢200Success
application/json
Body
object
stringÂ
required
data
array [object {20}]Â
required
id
stringÂ
optional
object
stringÂ
optional
endpoint
stringÂ
optional
errors
nullÂ
optional
input_file_id
stringÂ
optional
completion_window
stringÂ
optional
status
stringÂ
optional
output_file_id
stringÂ
optional
error_file_id
stringÂ
optional
created_at
integerÂ
optional
in_progress_at
integerÂ
optional
expires_at
integerÂ
optional
finalizing_at
integerÂ
optional
completed_at
integerÂ
optional
failed_at
nullÂ
optional
expired_at
nullÂ
optional
cancelling_at
nullÂ
optional
cancelled_at
nullÂ
optional
request_counts
objectÂ
optional
metadata
objectÂ
optional
first_id
stringÂ
required
last_id
stringÂ
required
has_more
booleanÂ
required
Example
{
"object": "list",
"data": [
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/chat/completions",
"errors": null,
"input_file_id": "file-abc123",
"completion_window": "24h",
"status": "completed",
"output_file_id": "file-cvaTdG",
"error_file_id": "file-HOWS94",
"created_at": 1711471533,
"in_progress_at": 1711471538,
"expires_at": 1711557933,
"finalizing_at": 1711493133,
"completed_at": 1711493163,
"failed_at": null,
"expired_at": null,
"cancelling_at": null,
"cancelled_at": null,
"request_counts": {
"total": 100,
"completed": 95,
"failed": 5
},
"metadata": {
"customer_id": "user_123456789",
"batch_description": "Nightly job",
}
},
{ ... },
],
"first_id": "batch_abc123",
"last_id": "batch_abc456",
"has_more": true
}
Modified at 2024-12-13 10:20:37