# Error when uploading files assistant purpose

**URL:** <https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428>\
**Category:** API\
**Created:** [November 6, 2023, 7:28pm UTC](https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428 "2023-11-06T19:28:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![samsulrahmadani](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/samsulrahmadani/32/235152_2.png) [@samsulrahmadani](https://community.openai.com/u/samsulrahmadani)\
**Post date:** [November 6, 2023, 7:28pm UTC](https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428/1 "2023-11-06T19:28:24Z")

</div>

from openai import OpenAI  
client = OpenAI(api\_key=“”)

client.files.create(  
file=open(“filese.pdf”, “rb”),  
purpose=“assistants”  
)

Error code: 400 - {‘error’: {‘message’: “‘assistants’ is not one of [‘fine-tune’] - ‘purpose’”, ‘type’: ‘invalid\_request\_error’, ‘param’: None, ‘code’: None}}

---

<div class="post-metadata">

**Author:** ![PaulBellow](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/paulbellow/32/597962_2.png) [@PaulBellow](https://community.openai.com/u/PaulBellow)\
**Post date:** [November 6, 2023, 7:29pm UTC](https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428/2 "2023-11-06T19:29:14Z")

</div>

Not going live until 1 PM Pacific time according to docs. Stay tuned…

---

<div class="post-metadata">

**Author:** ![kclaassen](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/kclaassen/32/235535_2.png) [@kclaassen](https://community.openai.com/u/kclaassen)\
**Post date:** [November 6, 2023, 11:01pm UTC](https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428/3 "2023-11-06T23:01:29Z")

</div>

Its still broken?

It can’t read any file topic I upload. It will either say unsupported file format or “Failed to create assistant: UserError: Failed to index file: Unsupported file”

This is for a .csv file

---

<div class="post-metadata">

**Author:** ![1stFlyingWolf](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/1stflyingwolf/32/240313_2.png) [@1stFlyingWolf](https://community.openai.com/u/1stFlyingWolf)\
**Post date:** [November 9, 2023, 2:08am UTC](https://community.openai.com/t/error-when-uploading-files-assistant-purpose/475428/4 "2023-11-09T02:08:20Z")

</div>

yes, getting this error for PDF’s while plain text files do upload:  
{  
“error”: {  
“message”: “Invalid file format. Supported formats: [‘c’, ‘cpp’, ‘csv’, ‘docx’, ‘html’, ‘java’, ‘json’, ‘md’, ‘pdf’, ‘php’, ‘pptx’, ‘py’, ‘rb’, ‘tex’, ‘txt’, ‘css’, ‘jpeg’, ‘jpg’, ‘js’, ‘gif’, ‘png’, ‘tar’, ‘ts’, ‘xlsx’, ‘xml’, ‘zip’]”,  
“type”: “invalid\_request\_error”,  
“param”: null,  
“code”: null  
}  
}
