﻿---
sidebar_position: 5
description: Delete file and other functions to work with OpenAI in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, OpenAI]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Delete file
 Deletes a previously uploaded file



`Function DeleteFile(Val URL, Val Token, Val FileID, Val AdditionalHeaders = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | OpenAI server URL |
  | Token | --token | String | &#x2714; | OpenAI authorization token |
  | FileID | --id | String | &#x2714; | File ID |
  | AdditionalHeaders | --headers | Map Of KeyAndValue | &#x2716; | Additional request headers, if necessary |

  
  Returns:  Map Of KeyAndValue - Processing result

<br/>

:::tip
Method at API documentation: [Delete file](https://platform.openai.com/docs/api-reference/files/delete)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    URL   = "https://hut.openintegrations.dev/localai/";
    Token = "12We...";

    FileID = "file-6";

    Result = OPI_OpenAI.DeleteFile(URL, Token, FileID);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint openai DeleteFile \
             --url "https://hut.openintegrations.dev/localai/" \
             --token "***" \
             --id "file-62"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint openai DeleteFile ^
             --url "https://hut.openintegrations.dev/localai/" ^
             --token "***" ^
             --id "file-62"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "id": "file-20",
 "object": "file",
 "deleted": true
}
```
