Files - Delete
Deletes the file with the given file-id. Deletion is also allowed if a file was used, e.g., as training file in a fine-tune job.
DELETE {endpoint}/openai/files/{file-id}?api-version=2024-02-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
endpoint
|
path | True |
string url |
Supported Cognitive Services endpoints (protocol and hostname, for example: https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI account name). |
|
file-id
|
path | True |
string |
The identifier of the file. |
|
api-version
|
query | True |
string |
The requested API version. |
Request Header
| Name | Required | Type | Description |
|---|---|---|---|
| api-key | True |
string |
Provide your Cognitive Services Azure OpenAI account key here. |
Responses
| Name | Type | Description |
|---|---|---|
| 204 No Content |
The file was successfully deleted. |
|
| Other Status Codes |
An error occurred. |
Security
api-key
Provide your Cognitive Services Azure OpenAI account key here.
Type:
apiKey
In:
header
Examples
Deleting a file.
Sample Request
DELETE https://aoairesource.openai.azure.com/openai/files/file-181a1cbdcdcf4677ada87f63a0928099?api-version=2024-02-01
Sample Response
Definitions
| Name | Description |
|---|---|
| Error |
Error |
|
Error |
ErrorCode |
|
Error |
ErrorResponse |
|
Inner |
InnerError |
|
Inner |
InnerErrorCode |
Error
Error
| Name | Type | Description |
|---|---|---|
| code |
ErrorCode |
|
| details |
Error[] |
The error details if available. |
| innererror |
InnerError |
|
| message |
string |
The message of this error. |
| target |
string |
The location where the error happened if available. |
ErrorCode
ErrorCode
| Name | Type | Description |
|---|---|---|
| conflict |
string |
The requested operation conflicts with the current resource state. |
| contentFilter |
string |
Image generation failed as a result of our safety system. |
| fileImportFailed |
string |
Import of file failed. |
| forbidden |
string |
The operation is forbidden for the current user/api key. |
| internalFailure |
string |
Internal error. Please retry. |
| invalidPayload |
string |
The request data is invalid for this operation. |
| itemDoesAlreadyExist |
string |
The item does already exist. |
| jsonlValidationFailed |
string |
Validation of jsonl data failed. |
| notFound |
string |
The resource is not found. |
| quotaExceeded |
string |
Quota exceeded. |
| serviceUnavailable |
string |
The service is currently not available. |
| tooManyRequests |
string |
Too many requests. Please retry later. |
| unauthorized |
string |
The current user/api key is not authorized for the operation. |
| unexpectedEntityState |
string |
The operation cannot be executed in the current resource's state. |
ErrorResponse
ErrorResponse
| Name | Type | Description |
|---|---|---|
| error |
Error |
InnerError
InnerError
| Name | Type | Description |
|---|---|---|
| code |
InnerErrorCode |
|
| innererror |
InnerError |
InnerErrorCode
InnerErrorCode
| Name | Type | Description |
|---|---|---|
| invalidPayload |
string |
The request data is invalid for this operation. |