Skip to main content
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>"
# 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

Authorizations

Authorization
string
header
required

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

file_id
string
required

The file identifier

Response

Extracted file content

Extracted file content as plain text