# File Management (/docs/files)


Upload File [#upload-file]

```
POST /v1/files
```

Upload a file for later use with batch operations, fine-tuning, or file search.

Request [#request]

```python
file = client.files.create(
    file=open("training_data.jsonl", "rb"),
    purpose="batch"
)

print(f"File ID: {file.id}")
```

Parameters [#parameters]

| Parameter | Type   | Required | Description                                 |
| --------- | ------ | -------- | ------------------------------------------- |
| `file`    | file   | Yes      | The file to upload                          |
| `purpose` | string | Yes      | Purpose: `batch`, `fine-tune`, `assistants` |

List Files [#list-files]

```
GET /v1/files
```

```python
files = client.files.list()

for f in files.data:
    print(f"{f.id} - {f.filename} ({f.bytes} bytes)")
```

Get File Info [#get-file-info]

```
GET /v1/files/{file_id}
```

Get File Content [#get-file-content]

```
GET /v1/files/{file_id}/content
```

Delete File [#delete-file]

```
DELETE /v1/files/{file_id}
```

```python
client.files.delete("file-abc123")
```

Supported Formats [#supported-formats]

| Purpose      | Formats                                |
| ------------ | -------------------------------------- |
| `batch`      | `.jsonl`                               |
| `fine-tune`  | `.jsonl`                               |
| `assistants` | `.pdf`, `.txt`, `.md`, `.docx`, images |

File Size Limits [#file-size-limits]

| Plan       | Max File Size | Max Total Storage |
| ---------- | ------------- | ----------------- |
| Free       | 10 MB         | 100 MB            |
| Basic      | 100 MB        | 1 GB              |
| Pro        | 512 MB        | 10 GB             |
| Enterprise | Custom        | Custom            |
