> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Files

> Call /files with the TypeScript SDK.

**Methods**: `client.uploadFile()`, `client.listFiles()`, `client.getFile()`, `client.getFileContent()`.

### Example

```typescript theme={null}
const uploaded = await client.uploadFile({ purpose: "batch", file: new Blob(["{}"]) });
const file = await client.getFile(uploaded.id);
const content = await client.getFileContent(uploaded.id);
```

<Note>
  `client.listFiles()` exists, but `GET /files` currently returns `file_list_not_supported_with_shared_gateway_key`
  when you use the shared gateway key. Persist the `uploaded.id` value and retrieve files directly.
</Note>

### Key parameters

* `file` (required for upload): Blob/File/base64/string.
* `purpose` (required for upload): e.g., `batch`.

### Returns

`FileObject` (upload/get)

```json theme={null}
{
  "id": "file-123",
  "object": "file",
  "filename": "data.json",
  "purpose": "batch",
  "status": "processed",
  "created_at": 1677610602,
  "bytes": 123
}
```

Or `FileListResponse` (list when the underlying provider key supports file enumeration)

```json theme={null}
{
  "data": [
    {
      "id": "file-123",
      "object": "file",
      "filename": "data.json",
      "purpose": "batch",
      "status": "processed",
      "created_at": 1677610602,
      "bytes": 123
    }
  ]
}
```
