Assistants
- GETList assistants
- POSTCreate assistant
- GETRetrieve assistant
- POSTModify assistant
- DELDelete assistant
- POSTCreate thread
- POSTCreate thread and run
- GETRetrieve thread.
- POSTModify thread
- DELDelete thread
- GETList messages
- POSTCreate message
- GETRetrieve message
- POSTModify message
- DELDelete message
- GETList runs
- POSTCreate run
- GETRetrieve run
- POSTModify run
- POSTCancel run
- GETList run steps
- GETRetrieve run step
- POSTThe run step object
Chat
Completions
Embeddings
Evals
Files
Fine-tuning
- GETList checkpoint permissions
- POSTCreate checkpoint permissions
- DELDelete checkpoint permission
- GETList your organization's fine-tuning jobs
- POSTCreate a fine-tuning job
- GETRetrieve fine-tuning job
- POSTImmediately cancel a fine-tune job.
- GETList checkpoints for a fine-tuning job.
- GETGet status updates for a fine-tuning job.
Moderations
API Reference
Audit Logs
Certificates
Usage
Projects
- GETReturns a list of projects.
- POSTCreate project
- GETRetrieves a project.
- POSTModify project
- GETList project API keys
- GETRetrieve project API key
- DELDelete project API key
- POSTArchive project
- GETList project rate limits
- POSTUpdate project rate limit
- GETList project service accounts
- POSTCreate project service account
- GETRetrieve project service account
- DELDelete project service account
- GETReturn project users
- POSTCreate project user
- GETRetrieve project user
- POSTModify project user
- DELDelete project user
Responses
Vector stores
- GETReturns a list of vector stores.
- POSTCreate a vector store.
- GETRetrieves a vector store.
- POSTModifies a vector store.
- DELDelete a vector store.
- POSTCreate a vector store file batch.
- GETRetrieves a vector store file batch.
- POSTCancel vector store file batch
- GETReturns a list of vector store files in a batch.
- GETReturns a list of vector store files.
- POSTCreate vector store file
- GETRetrieves a vector store file.
- POSTUpdate attributes on a vector store file.
- DELDelete vector store file
- GETRetrieve vector store
- POSTSearch vector store
Batch
Cancel batch
Cancels an in-progress batch. The batch will be in status cancelling
for up to 10 minutes, before changing to cancelled
, where it will have partial results (if any) available in the output file.
POST
/
batches
/
{batch_id}
/
cancel
Copy
Ask AI
curl --request POST \
--url https://api.openai.com/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'
Copy
Ask AI
{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"errors": {
"object": "<string>",
"data": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
]
},
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "validating",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The ID of the batch to cancel.
Response
200 - application/json
Batch is cancelling. Returns the cancelling batch's details.
The response is of type object
.
Was this page helpful?
Copy
Ask AI
curl --request POST \
--url https://api.openai.com/v1/batches/{batch_id}/cancel \
--header 'Authorization: Bearer <token>'
Copy
Ask AI
{
"id": "<string>",
"object": "batch",
"endpoint": "<string>",
"errors": {
"object": "<string>",
"data": [
{
"code": "<string>",
"message": "<string>",
"param": "<string>",
"line": 123
}
]
},
"input_file_id": "<string>",
"completion_window": "<string>",
"status": "validating",
"output_file_id": "<string>",
"error_file_id": "<string>",
"created_at": 123,
"in_progress_at": 123,
"expires_at": 123,
"finalizing_at": 123,
"completed_at": 123,
"failed_at": 123,
"expired_at": 123,
"cancelling_at": 123,
"cancelled_at": 123,
"request_counts": {
"total": 123,
"completed": 123,
"failed": 123
},
"metadata": {}
}
Assistant
Responses are generated using AI and may contain mistakes.