Get File Content
curl --request GET \
--url https://api.moonshot.ai/v1/files/{file_id}/content \
--header 'Authorization: Bearer <token>'"<string>"Get File Content
Retrieves extracted text content for files uploaded with purpose file-extract.
GET
/
v1
/
files
/
{file_id}
/
content
Get File Content
curl --request GET \
--url https://api.moonshot.ai/v1/files/{file_id}/content \
--header 'Authorization: Bearer <token>'"<string>"Usage Example
Usage Example
- python
- curl
# Note: retrieve_content is marked with a warning in the latest version. Use the line below instead.
# If you are using an older version, you can use retrieve_content.
file_content = client.files.content(file_id=file_object.id).text
curl https://api.moonshot.ai/v1/files/{file_id}/content \
-H "Authorization: Bearer $MOONSHOT_API_KEY"
Authorizations
The Authorization header expects a Bearer token. Use an MOONSHOT_API_KEY as the token. This is a server-side secret key. Generate one on the API keys page in your dashboard.
Path Parameters
The file identifier
Response
Extracted file content
Extracted file content as plain text
Was this page helpful?
⌘I