FILES

Retrieve a File

Retrieve a file's metadata by its ID. Use the content endpoint to download the bytes.

GET/v1/files/{file_id}

Authorization

Authorizationstringheaderrequired

Bearer token — your API key. Example: Bearer sk-...

Response

idstringrequired

The file ID (e.g. "file-abc123").

object"file"required

Object type — always "file".

bytesintegerrequired

Size of the file in bytes.

created_atintegerrequired

Unix timestamp of when the file was uploaded.

filenamestringrequired

The original filename.

purpose"general" | "batch" | "batch_output" | "connector"required

The purpose the file was uploaded for.

generalbatchbatch_outputconnector

Request

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "your-scx-api-key",
  baseURL: "https://api.scx.ai/v1",
});

const file = await client.files.retrieve("file-3f1a9c2e");

console.log(file.filename, file.bytes);

Response

{
  "id": "file-3f1a9c2e-5b7d-4e08-9a2b-6c1d8e4f7a90",
  "object": "file",
  "bytes": 48213,
  "created_at": 1783652619,
  "filename": "first-frame.png",
  "purpose": "general"
}