Skip to main content
POST
https://api.neosantara.xyz
/
v1
/
batches
Create Batch
curl --request POST \
  --url https://api.neosantara.xyz/v1/batches \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "input_file_id": "<string>",
  "endpoint": "<string>",
  "completion_window": "<string>",
  "metadata": {}
}
'
{
  "id": "<string>",
  "object": "<string>",
  "endpoint": "<string>",
  "errors": {},
  "input_file_id": "<string>",
  "completion_window": "<string>",
  "status": "<string>",
  "output_file_id": {},
  "error_file_id": {},
  "created_at": 123,
  "in_progress_at": {},
  "expires_at": 123,
  "finalizing_at": {},
  "completed_at": {},
  "failed_at": {},
  "expired_at": {},
  "cancelling_at": {},
  "cancelled_at": {},
  "request_counts": {
    "total": 123,
    "completed": 123,
    "failed": 123
  },
  "metadata": {}
}

Save 50% on Batch Processing

Batch API offers 50% cost savings compared to standard API calls. Perfect for processing large volumes of requests asynchronously.
Free Tier Limitation: Batch API is only available for Basic tier and above. Upgrade your plan to unlock batch processing.
Create a new batch job for asynchronous processing of multiple API requests.
input_file_id
string
required
The ID of an uploaded file that contains the requests for this batch. The file must be uploaded with purpose="batch" and be in valid JSONL format.
endpoint
string
required
The endpoint to be used for all requests in the batch. Currently supported endpoints:
  • /v1/chat/completions - For chat completion requests
  • /v1/embeddings - For embedding generation
  • /v1/responses - For response generation
completion_window
string
default:"24h"
The time frame within which the batch should be processed. Currently only 24h is supported.
metadata
object
Optional custom metadata for the batch. Can contain any key-value pairs for tracking purposes.

Returns

id
string
A unique identifier for the batch job (e.g., batch-abc123).
object
string
The object type, which is always batch.
endpoint
string
The API endpoint that will be used for all requests in the batch.
errors
object or null
Any errors encountered during batch processing. Will be null if no errors.
input_file_id
string
The ID of the input file containing batch requests.
completion_window
string
The time window for batch completion.
status
string
The current status of the batch. Possible values:
  • validating - The input file is being validated
  • in_progress - The batch is being processed
  • finalizing - The batch is being finalized
  • completed - The batch has completed successfully
  • failed - The batch has failed
  • expired - The batch has expired
  • canceled - The batch was canceled
output_file_id
string or null
The ID of the file containing successful batch results. Available when status is completed.
error_file_id
string or null
The ID of the file containing failed requests. Available when there are errors.
created_at
integer
The Unix timestamp (in seconds) of when the batch was created.
in_progress_at
integer or null
The Unix timestamp when the batch started processing.
expires_at
integer
The Unix timestamp when the batch will expire.
finalizing_at
integer or null
The Unix timestamp when the batch started finalizing.
completed_at
integer or null
The Unix timestamp when the batch completed.
failed_at
integer or null
The Unix timestamp when the batch failed.
expired_at
integer or null
The Unix timestamp when the batch expired.
cancelling_at
integer or null
The Unix timestamp when cancellation was initiated.
cancelled_at
integer or null
The Unix timestamp when the batch was cancelled.
request_counts
object
Statistics about the requests in the batch.
metadata
object
Custom metadata associated with the batch.
{
  "id": "batch-abc123",
  "object": "batch",
  "endpoint": "/v1/chat/completions",
  "errors": null,
  "input_file_id": "file-xyz789",
  "completion_window": "24h",
  "status": "validating",
  "output_file_id": null,
  "error_file_id": null,
  "created_at": 1699564800,
  "in_progress_at": null,
  "expires_at": 1699651200,
  "finalizing_at": null,
  "completed_at": null,
  "failed_at": null,
  "expired_at": null,
  "cancelling_at": null,
  "cancelled_at": null,
  "request_counts": {
    "total": 100,
    "completed": 0,
    "failed": 0
  },
  "metadata": {
    "project": "data-analysis",
    "batch_type": "daily_processing"
  }
}
Last modified on December 7, 2025