In short.
Working with Files is a Perplexity API guide for developers building document questions and file exports, but document conversations cannot use browser tools. It covers inline and URL document inputs, follow-ups using previous_response_id, and separate listing and download endpoints for generated files. Document requests have a 30-document limit, a combined 50 MiB decoded inline-file budget and a 72 MiB JSON-body limit; providers may impose lower limits. Pricing is unknown, and runtime behavior and output quality are not assessed.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is the complete selected documentation page at [https://docs.perplexity.ai/docs/agent-api/working-with-files.md], including document submission, continuation, limits, examples and output-file retrieval. The documentation index and linked output-control, Sandbox and Background mode pages are excluded. No code, API requests or downloads were executed; runtime behavior, generated-content quality, current pricing and linked-page details remain unassessed.
The overview
Identity
Working with Files is a Perplexity documentation guide covering document inputs and generated-file outputs for the Agent API. Its original address is [https://docs.perplexity.ai/docs/agent-api/working-with-files.md].
The guide describes POST requests to [https://api.perplexity.ai/v1/agent] and its [https://api.perplexity.ai/v1/responses] alias. It provides direct HTTP examples alongside Python and TypeScript SDK examples.
Assessment
The guide is useful for implementing a document question-and-answer feature or an agent that delivers downloadable results. It connects request construction, conversation identifiers, file metadata and binary downloads, while documenting constraints that can make an otherwise plausible request fail.
Its value is integration guidance. It provides no measured document-understanding accuracy, export correctness, latency or reliability results, so those qualities remain unassessed.
Users
Application developers can use this guide to build document summaries, follow-up questions and downloadable reports or structured data. Beginners need familiarity with JSON and either HTTP requests, Python or TypeScript; the initial Python document example uses standard-library modules.
Experienced developers will find details relevant to request validation, continuation state, provider compatibility and streaming errors. Applications requiring browser tools within a document conversation, or document input under zero data retention, do not fit the documented capabilities.
Capabilities
A user message can contain an input_file part with either inline file_data or a public file_url. Recognized formats include PDF, DOC, DOCX, UTF-8 TXT and RTF, although actual support depends on the selected model and provider. Document input goes directly to the model without requiring sandbox or file_search.
For inline documents, previous_response_id lets an application continue the conversation within the same API project without uploading the document again, subject to retention and inherited-document limits.
Agents can produce CSV, JSON, JSONL and reports through the sandbox. Files delivered through share_file can then be listed and downloaded using the response identifier and each file's separate identifier.
Using it
Requirements
The examples require a Perplexity API key, supplied through PERPLEXITY_API_KEY and Bearer authentication. SDK examples use the Python SDK imported as perplexity (the page does not name the package to install) or the @perplexity-ai/perplexity_ai TypeScript package; package versions are not specified. The selected model must support every document active in the conversation.
A request can contain up to 30 document parts, including inherited documents. Inline files share a 50 MiB limit after base64 decoding, and the complete JSON request body is limited to 72 MiB. Provider size, page and context limits may be lower.
Remote documents require public HTTPS URLs using port 443, without credentials or fragments. URLs must remain accessible for follow-ups. Provider restrictions on URL access, redirects and parsing still apply.
Mechanism
Inline document bytes are encoded as standard base64 or a base64 data URI inside file_data. With file_url, the model provider retrieves the document; the API does not download or verify its contents beforehand. Consequently, an accepted URL request can still fail during retrieval or parsing.
For generated output, sandbox code writes a file and share_file delivers it. The response output array contains a share_file item, while the file contents require a separate download. GET [https://api.perplexity.ai/v1/agent/{id}/files] lists output files, and GET [https://api.perplexity.ai/v1/agent/{id}/files/{file_id}/content] retrieves their bytes.
Response identifiers and file identifiers serve different purposes. Download responses contain raw bytes, a matching Content-Type and an attachment filename. Input documents do not appear in the output-file listing.
Setup
Set the API key, choose a compatible model and construct a user message containing the document and its instruction. Supply exactly one of file_data and file_url. Save the response id if the application needs follow-up questions.
For inline data, an omitted filename becomes document with the recognized extension; an extensionless filename receives that extension automatically. The resulting basename must fit within 255 UTF-8 bytes. Conflicting filename extensions or data-URI media types return HTTP 400.
For URL input, omitting filename describes the document as PDF. Other supported formats need a filename with an extension matching the remote document. To produce output files, enable sandbox and ask the agent to write and deliver a file. For long runs, the page recommends background=true and polling before listing files; the linked background-mode guide is outside this page's scope.
Example
The document example base64-encodes document.pdf, submits it with a summarization request using model openai/gpt-5.4, then asks for the three most important details using previous_response_id. It illustrates retaining conversation context without resending the inline document.
A separate export example enables sandbox with effort=xhigh and asks for ten recent AI news stories in ai_news.csv, with title, source, url and published_date columns. It then lists the response's files and downloads their contents. This example contains no document input.
These are documented usage examples. No example was executed, and the accuracy of summaries, news entries or downloaded files is not assessed.
Assessment & evidence
Limitations
Browser tools are unavailable with document inputs and document continuations. Requests combining them return HTTP 400 before the response starts, including when an effort setting enables a browser tool or previous_response_id inherits document context.
Known unsupported model, format or source combinations also return HTTP 400 before the response starts, including with stream=true. Reusable file_id values are unsupported for document input, and video is outside this document contract.
A follow-up does not extend an inline document's original retention period. Once the original response expires or is deleted, the document must be resent in a new conversation. URL-based conversations additionally depend on continued remote access, while inherited documents continue to count toward active-document limits.
Design implications
The documented browser restriction implies that an application needing both document analysis and browser-assisted research must separate those operations into compatible requests. Effort settings need attention because they can introduce browser tools indirectly.
Continuation can simplify repeated questions, but applications still need to track the original response, document expiry and inherited limits. Generated-file retrieval adds another state requirement: preserve the response id, then obtain the distinct file ids before downloading.
These are implementation implications of the documented contract. They do not establish that any particular application architecture has been validated.
Alternatives
Within this API, inline file_data suits local documents but consumes the decoded-file and JSON-body budgets. A public file_url avoids embedding the document bytes in the request, while depending on provider retrieval and continued URL availability.
The page identifies one difference from Sonar: Sonar's attachment allowance is 50 MiB per file, whereas the Agent API's inline allowance is 50 MiB combined. It does not establish broader equivalence for follow-ups, supported formats or generated-file exports.
Direct HTTP, Python and TypeScript examples provide implementation choices. Other services and their comparative quality, privacy or pricing are not assessed by this page.
Evidence
The evidence is the complete Perplexity Working with Files page at [https://docs.perplexity.ai/docs/agent-api/working-with-files.md]. It contains request examples, limit tables, file-list metadata and download instructions.
Its examples and sample metadata document the interface; they do not supply independent execution results, benchmarks or quality measurements.
Access & freshness
Costs
The page gives no prices, billing units, free-tier terms or worked cost calculation. Model and sandbox pricing, along with any storage or download fees, are unknown from this evidence.
The effort=xhigh example does not establish a price or cost estimate. Continuing without resending an inline file is documented behavior, but the page does not establish how continuation affects billing.
Rights
The supplied page states no licence or redistribution permission for its documentation or example code. Commercial-use terms, generated-file ownership and output licensing are also not established.
Document input is unavailable with zero data retention. Inline documents remain available for the original response's retention period, up to 30 days. The page does not establish training-use terms, processing location or generated-file retention, so those matters remain unknown.
Freshness
The supplied page was captured on 2026-11-15 at 01:34:46.181 UTC. Its publication date and last update date are not stated in the supplied text.
The examples name openai/gpt-5.4 and effort=xhigh, but provide neither a complete current support matrix nor pinned SDK versions. Availability and behavior after the capture are unknown.
Next steps
Before implementation, confirm that the chosen model supports the required document formats, sizes and sources. Check whether browser access or zero data retention is essential; either requirement conflicts with document conversations as documented here.
For an initial integration, use a small supported document, retain its response id and verify a follow-up within the same API project. Evaluate file generation separately by listing and downloading a delivered sandbox file, then checking its actual contents.
Resolve current pricing, service-use terms and generated-file retention before committing to deployment. Plan for document expiry, provider retrieval failures and validation errors that occur before streaming begins.
