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
AuthorizationstringheaderrequiredBearer token — your API key. Example: Bearer sk-...
Response
idstringrequiredThe file ID (e.g. "file-abc123").
object"file"requiredObject type — always "file".
bytesintegerrequiredSize of the file in bytes.
created_atintegerrequiredUnix timestamp of when the file was uploaded.
filenamestringrequiredThe original filename.
purpose"general" | "batch" | "batch_output" | "connector"requiredThe purpose the file was uploaded for.
generalbatchbatch_outputconnectorRequest
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);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"
}{
"id": "file-3f1a9c2e-5b7d-4e08-9a2b-6c1d8e4f7a90",
"object": "file",
"bytes": 48213,
"created_at": 1783652619,
"filename": "first-frame.png",
"purpose": "general"
}