# How to attach a file to api request from python? haven't found a toy example of that

**URL:** <https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71>\
**Category:** General\
**Created:** [May 15, 2025, 12:13am UTC](https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71 "2025-05-15T00:13:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikvang](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vikvang](https://community.perplexity.ai/u/vikvang)\
**Post date:** [May 15, 2025, 12:13am UTC](https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71/1 "2025-05-15T00:13:06Z")

</div>

I’m just trying to use the API to make a simple requests including a prompt and an attached file from python but I haven’t found a toy example of how to do that with a Pro account.

---

<div class="post-metadata">

**Author:** ![vikvang](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@vikvang](https://community.perplexity.ai/u/vikvang)\
**Post date:** [May 15, 2025, 12:13am UTC](https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71/2 "2025-05-15T00:13:08Z")

</div>

Have you found a solution to your problem?

---

<div class="post-metadata">

**Author:** ![jamesliounis](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/jamesliounis/32/897_2.png) [@jamesliounis](https://community.perplexity.ai/u/jamesliounis)\
**Post date:** [May 16, 2025, 11:06pm UTC](https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71/3 "2025-05-16T23:06:55Z")

</div>

Hey team - unfortunately the API still doesn’t support file uploads, and the only inputs possible are still text and images. The common workaround to this is just to add a text extraction process before the API call.

This said, we are working on file uploads and these should be available in the next month.

---

<div class="post-metadata">

**Author:** ![miceno\_52280](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/miceno_52280/32/1164_2.png) [@miceno\_52280](https://community.perplexity.ai/u/miceno_52280)\
**Post date:** [September 29, 2025, 2:54pm UTC](https://community.perplexity.ai/t/how-to-attach-a-file-to-api-request-from-python-havent-found-a-toy-example-of-that/71/4 "2025-09-29T14:54:00Z")

</div>

Any update on this? I am trying to use the API to summarize a PDF file and I am getting HTTP 500 errors.
