List batches
GET https://api.fastapi.ai/v1/batches
List your organization's batches.
Query parameters
after string Optional
A cursor for use in pagination.
limit integer Optional Defaults to 20
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.
Returns
Returns the Batch object.
A list of paginated Batch objects.
Example
Request
bash
curl "https://api.fastapi.ai/v1/batches?limit=2" \
-H "Authorization: Bearer $FAST_API_KEY" \
-H "Content-Type: application/json"Response
bash
{
"object": "list",
"data": [
{
"id": "batch_abc123",
"object": "batch",
"endpoint": "/v1/completions",
"model": "gpt-5-2025-08-07",
"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
},
"usage": {
"input_tokens": 1500,
"output_tokens": 500,
"total_tokens": 2000,
"input_tokens_details": {
"cached_tokens": 1024
},
"output_tokens_details": {
"reasoning_tokens": 300
}
},
"metadata": {
"customer_id": "user_123456789",
"batch_description": "Nightly eval job"
}
}
],
"first_id": "batch_abc123",
"last_id": "batch_abc456",
"has_more": true
}