OpenAI-compatible Files API for uploads referenced in chat via file_id.
Base: https://51kik.com/v1/files
Authentication
All operations require Authorization: Bearer YOUR_API_KEY. Files are scoped to the key that created them.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /files | Multipart upload |
| GET | /files | List (current key) |
| GET | /files/:id | Metadata |
| DELETE | /files/:id | Delete |
| GET | /files/:id/content | Download bytes |
Upload
curl -sS "https://51kik.com/v1/files" \
-H "Authorization: Bearer $API_KEY" \
-F "purpose=assistants" \
-F "file=@./document.pdf"
| Field | Notes |
|---|---|
file | Required — form field name must be file |
purpose | Optional, default assistants |
200 example:
{
"id": "file-xxxxxxxx",
"object": "file",
"bytes": 12345,
"created_at": 1710000000,
"filename": "document.pdf",
"purpose": "assistants"
}
Default max size ~32 MB per file (deployment-specific).
List
curl -sS "https://51kik.com/v1/files" \
-H "Authorization: Bearer $API_KEY"
Returns { "object": "list", "data": [ ... ] }. Optional limit query (1–10000).
Metadata / delete / download
curl -sS "https://51kik.com/v1/files/FILE_ID" -H "Authorization: Bearer $API_KEY"
curl -sS -X DELETE "https://51kik.com/v1/files/FILE_ID" -H "Authorization: Bearer $API_KEY"
curl -sS "https://51kik.com/v1/files/FILE_ID/content" -H "Authorization: Bearer $API_KEY" -o out.bin
Use in chat
Files and context (input_file + file_id).
SDK
await client.files.upload({ file: buffer, filename: "a.pdf", purpose: "assistants" });
await client.files.list();
See SDK files and models.