Skip to main content
GET
/
v1
/
files
/
{file_id}
/
content
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

content = client.files.retrieve_content("file_123")

# Save to file
with open("downloaded-file.jsonl", "wb") as f:
    f.write(content)

print("File downloaded successfully")
Returns raw file content with appropriate Content-Type header.
For JSONL files, returns newline-delimited JSON.

Documentation Index

Fetch the complete documentation index at: https://inference-docs.cerebras.ai/llms.txt

Use this file to discover all available pages before exploring further.

This feature is in Private Preview. For access or more information, contact us or reach out to your account representative.
Downloads the raw content of a file. Use this endpoint to retrieve the actual file data rather than just metadata.

Path Parameters

file_id
string
required
The ID of the file whose content to retrieve.

Response

Returns the raw file contents. The Content-Type header indicates the file type:
  • JSONL files: application/x-ndjson
from cerebras.cloud.sdk import Cerebras
import os

client = Cerebras(
    api_key=os.environ.get("CEREBRAS_API_KEY"),
)

content = client.files.retrieve_content("file_123")

# Save to file
with open("downloaded-file.jsonl", "wb") as f:
    f.write(content)

print("File downloaded successfully")
Returns raw file content with appropriate Content-Type header.
For JSONL files, returns newline-delimited JSON.