Retrieve a file

Retrieve metadata for a previously uploaded file by its ID.

GET /files/{file_id}

Retrieve metadata for an uploaded file.

Parameters

Path parameters

FieldTypeRequiredDescription
file_idstringYesIdentifier of the file to act on.

Response

HTTP 200 — OK

Content Type: application/json

FileObject

python
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.meta.ai/v1",
api_key=os.environ["MODEL_API_KEY"],
)
response = client.files.retrieve("file_abc123")
print(response.model_dump_json(indent=2))

To download the file's contents, see Retrieve file content.