Skip to main content
OpenAI-compatible file storage: upload documents or send them inline, then reference them in chat messages. The gateway extracts text and inlines it into the prompt at request time.

Endpoints

POST /v1/files — upload

Uploads require a positive credit balance unless your account has free access or permission to carry a negative balance. An empty balance returns 402 insufficient_credits. You can still list, retrieve, download, and delete existing files without credits.
200 OK

GET /v1/files — list

Using files in chat

Reference an uploaded file by ID, or send content inline — the gateway extracts text and inlines it into the prompt. File content parts are available on DeepSeek V4.1 Flash and Particle-1; GLM requests do not expand file_id or file_data parts. Send text and image_url image parts on GLM instead: json
Inline variant on Particle-1 (no upload required; combined attached-file text is capped per request): json

Retrieval behavior

  • File count: DeepSeek chat requests may reference up to 32 files across all messages. Repeated stored file IDs count once; each inline file counts separately. Requests above this limit return 400 too_many_file_references before file retrieval begins.
  • Context budget: retrieval includes file content relevant to your message, up to ~200K tokens per request. Large files may be included only in part.
  • Formats: plain text and PDFs extract directly; DOCX, XLSX, and PPTX documents are converted automatically. Image files are rejected with 400 unsupported_file_type — send images as image_url content parts instead. Scanned/image-only PDFs without extractable text are rejected with 400 unsupported_file_content.
  • Warnings: partial extractions (truncation, unsupported pages) are reported on the chat response via the X-Particle-Warnings JSON header — check it when answers seem to miss file content.
  • Privacy: files are scoped to your API key. Another key requesting your file ID gets a plain 404, exactly like a nonexistent file.
  • Retention: files never expire until deleted. Deleting a file referenced by later chats simply drops it from retrieval.
File content and token chargesFile text is assembled into the prompt before the model runs — it consumes real prompt tokens (billed at input rates, cache rules applying to the stable prefix). A 25 MiB PDF will not fit whole; rely on relevance ranking or split uploads.