# Files API (/en/docs/api/native/file)



File stores uploads for conversations and knowledge bases, with metadata, downloads and deletion. Concepts and behavior follow OpenAI Files (multipart uploads, purposes and file IDs), so OpenAI Files experience applies. Differences: uploads are limited to 104857600 bytes; only user\_data, assistants and vision purposes are accepted, and conversation images require user\_data; praxis\[expires\_in\_seconds] allows expiry up to 90 days, while expires\_after allows up to 30 days. Start with `praxis.file.files.create` to upload bytes and obtain a reusable file ID.

## Base URL [#base-url]

<ApiBaseDomain prefix="/file/v1" />

## Get started [#get-started]

<QuickstartTabs snippets="{&#x22;curl&#x22;:&#x22;curl https://api-origin.invalid/file/v1/files \\\n  -H \&#x22;Authorization: Bearer $PRAXIS_API_KEY\&#x22; \\\n  -F \&#x22;purpose=user_data\&#x22; \\\n  -F \&#x22;file=@pixel.png\&#x22;&#x22;,&#x22;python&#x22;:&#x22;import os\n\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\&#x22;https://api-origin.invalid/file/v1\&#x22;,\n    api_key=os.environ[\&#x22;PRAXIS_API_KEY\&#x22;],\n)\n\nfile = client.files.create(\n    file=open(\&#x22;pixel.png\&#x22;, \&#x22;rb\&#x22;),\n    purpose=\&#x22;user_data\&#x22;,\n)&#x22;,&#x22;typescript&#x22;:&#x22;import OpenAI from \&#x22;openai\&#x22;;\nimport fs from \&#x22;node:fs\&#x22;;\n\nconst client = new OpenAI({\n  baseURL: \&#x22;https://api-origin.invalid/file/v1\&#x22;,\n  apiKey: process.env.PRAXIS_API_KEY,\n});\n\nconst file = await client.files.create({\n  file: fs.createReadStream(\&#x22;pixel.png\&#x22;),\n  purpose: \&#x22;user_data\&#x22;,\n});&#x22;}" />

The per-file limit is 100 MB (104857600 bytes). Uploads and downloads stream throughout; Uploads chunking is not available. Types are detected from content; see the upload endpoint for formats. Files are isolated by organization.

## Endpoints [#endpoints]

| Method | Path                                                                       | Description     | Support     |
| ------ | -------------------------------------------------------------------------- | --------------- | ----------- |
| POST   | [`/v1/files`](/docs/api/native/file/createFile)                            | Upload a file   | ◐ Partial   |
| GET    | [`/v1/files`](/docs/api/native/file/listFiles)                             | List files      | ● Supported |
| GET    | [`/v1/files/{file_id}`](/docs/api/native/file/retrieveFile)                | Retrieve a file | ● Supported |
| GET    | [`/v1/files/{file_id}/content`](/docs/api/native/file/retrieveFileContent) | Download a file | ● Supported |
| DELETE | [`/v1/files/{file_id}`](/docs/api/native/file/deleteFile)                  | Delete a file   | ● Supported |

## Differences from OpenAI [#differences-from-openai]

* Uses OpenAI file and pagination shapes, adding mime\_type, downloadable and a before query cursor. Only this face accepts body praxis.expires\_in\_seconds (3600–7776000 seconds), mutually exclusive with expires\_after; encode it as praxis\[expires\_in\_seconds] in multipart.
* <a href="/docs/api/native/file/createFile">Upload a file</a>：Supports PDF; DOCX / XLSX / PPTX; PNG / JPEG / GIF / WebP; MP3 / WAV / FLAC / OGG / M4A; MP4 / WebM; UTF-8 JSON / NDJSON / CSV / Markdown / plain text. Purposes are user\_data / assistants / vision. Limit 104857600 bytes. Empty, unsupported, invalid-purpose and oversized uploads return 400. No Uploads chunking. Set expiry with expires\_after\[anchor] and expires\_after\[seconds], or with praxis\[expires\_in\_seconds]; the two settings are mutually exclusive.

For authoritative parameter definitions, see the [official OpenAI documentation](https://platform.openai.com/docs/api-reference).

Errors follow the OpenAI format, see [errors](/docs/api/errors); quotas and response headers are covered in [rate limits](/docs/api/rate-limits).
