Files API
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: direct uploads are limited to 100000000 bytes; unlike OpenAI, Uploads accepts at most 20 GiB (21474836480 bytes) in parts up to 64000000 bytes and an unfinished upload waits 7 days for its missing parts; only user_data, assistants and vision purposes are accepted, and conversation images require user_data; own-face Uploads expiry allows up to 90 days, while the OpenAI face allows up to 30 days. A file id is file- followed by 24 base62 characters, and it is what every byte-backed thing holds — a knowledge source, a media asset, a session’s output, a ticket attachment. Bytes that already exist do not have to come through the model: a file a session wrote to its outputs directory is already a platform file, so list it with praxis.file.files.list and scope_id, and praxis.file.uploads.createSigned hands out a URL to PUT any other local file. Start with praxis.file.uploadFile to upload bytes and obtain a reusable file ID.
Base URL
https://api.deepraxis.com/file/v1
Get started
curl
curl https://api.deepraxis.com/file/v1/files \
-H "Authorization: Bearer $PRAXIS_API_KEY" \
-F "purpose=user_data" \
-F "file=@pixel.png"Python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepraxis.com/file/v1",
api_key=os.environ["PRAXIS_API_KEY"],
)
file = client.files.create(
file=open("pixel.png", "rb"),
purpose="user_data",
)TypeScript
import OpenAI from "openai";
import fs from "node:fs";
const client = new OpenAI({
baseURL: "https://api.deepraxis.com/file/v1",
apiKey: process.env.PRAXIS_API_KEY,
});
const file = await client.files.create({
file: fs.createReadStream("pixel.png"),
purpose: "user_data",
});Direct uploads accept up to 100 MB (100000000 bytes). Use Uploads for larger files: parts up to 64 MB, total up to 20 GiB (21474836480 bytes), completed within one hour. Poll the resulting file until status=processed (own face state=active). The SDK praxis.file.uploadFile helper handles parts, retries and polling, up to 2 GiB. Types are detected from content; see the upload endpoint for formats. Files are isolated by organization.
Endpoints
| Method | Path | Description | Support |
|---|---|---|---|
| POST | /v1/files | Upload a file | ◐ Partial |
| GET | /v1/files | List files | ● Supported |
| GET | /v1/files/{file_id} | Retrieve a file | ● Supported |
| GET | /v1/files/{file_id}/content | Download a file | ● Supported |
| DELETE | /v1/files/{file_id} | Delete a file | ● Supported |
| POST | /v1/uploads | Create an upload | ◐ Partial |
| POST | /v1/uploads/{upload_id}/parts | Add an upload part | ◐ Partial |
| POST | /v1/uploads/{upload_id}/complete | Complete an upload | ◐ Partial |
| GET | /v1/uploads/{upload_id} | Retrieve an upload | ● Supported |
| POST | /v1/uploads/{upload_id}/cancel | Cancel an upload | ◐ Partial |
Differences from OpenAI
- Uses OpenAI file and pagination shapes, adding mime_type, state, source, scope, sha256 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.
- Upload a file: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 100000000 bytes. Empty, unsupported, invalid-purpose and oversized uploads return 400. Use Uploads for files over 100 MB. Set expiry with expires_after[anchor] and expires_after[seconds], or with praxis[expires_in_seconds]; the two settings are mutually exclusive.
- Create an upload:Parts are at most 64 MB and the total is at most 20 GiB. Only user_data, assistants and vision are accepted. Pending uploads expire after 7 days. Query GET /file/v1/uploads/{upload_id} to see the received parts, resend only what is missing, then complete. Create, send parts, query, resume, complete; wait for file processing before use.
- Add an upload part:Parts are at most 64 MB and the total is at most 20 GiB. Only user_data, assistants and vision are accepted. Pending uploads expire after 7 days. Query GET /file/v1/uploads/{upload_id} to see the received parts, resend only what is missing, then complete. Create, send parts, query, resume, complete; wait for file processing before use.
- Complete an upload:Parts are at most 64 MB and the total is at most 20 GiB. Only user_data, assistants and vision are accepted. Pending uploads expire after 7 days. Query GET /file/v1/uploads/{upload_id} to see the received parts, resend only what is missing, then complete. Create, send parts, query, resume, complete; wait for file processing before use.
- Retrieve an upload:After a break, query this endpoint for the parts already received (part_number, bytes, sha256), resend only the missing ones, then complete. Pending uploads expire after 7 days; an expired or cancelled upload answers 409.
- Cancel an upload:Parts are at most 64 MB and the total is at most 20 GiB. Only user_data, assistants and vision are accepted. Pending uploads expire after 7 days. Query GET /file/v1/uploads/{upload_id} to see the received parts, resend only what is missing, then complete. Create, send parts, query, resume, complete; wait for file processing before use.
For authoritative parameter definitions, see the official OpenAI documentation.
Errors follow the OpenAI format, see errors; quotas and response headers are covered in rate limits.