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

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

file = client.files.retrieve("file_123")

print(file)
{
  "id": "file_123",
  "object": "file",
  "bytes": 1048576,
  "filename": "batch-requests.jsonl",
  "created_at": 1726315200,
  "expires_at": 1726920000,
  "purpose": "batch"
}
Retrieves metadata for a specific file, including its size, status, expiration date, and download URL.

Path Parameters

file_id
string
required
The ID of the file to retrieve.

Response

id
string
A unique identifier for the file.
object
string
The object type, which is always file.
filename
string
The name of the uploaded file.
purpose
string
The intended purpose of the file.
bytes
integer
The size of the file in bytes.
created_at
integer
The Unix timestamp (in seconds) of when the file was created.
expires_at
integer
The Unix timestamp (in seconds) of when the file will be automatically deleted.
from cerebras.cloud.sdk import Cerebras
import os

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

file = client.files.retrieve("file_123")

print(file)
{
  "id": "file_123",
  "object": "file",
  "bytes": 1048576,
  "filename": "batch-requests.jsonl",
  "created_at": 1726315200,
  "expires_at": 1726920000,
  "purpose": "batch"
}