FILES
Download File Content
Download a file's bytes by its ID.
GET/v1/files/{file_id}/content
Authorization
AuthorizationstringheaderrequiredBearer token — your API key. Example: Bearer sk-...
Request
import OpenAI from "openai";
import { writeFile } from "node:fs/promises";
const client = new OpenAI({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai/v1",
});
const res = await client.files.content("file-3f1a9c2e");
await writeFile("first-frame.png", Buffer.from(await res.arrayBuffer()));import OpenAI from "openai";
import { writeFile } from "node:fs/promises";
const client = new OpenAI({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai/v1",
});
const res = await client.files.content("file-3f1a9c2e");
await writeFile("first-frame.png", Buffer.from(await res.arrayBuffer()));Response
{
"error": {
"message": "File not found",
"type": "not_found_error"
}
}{
"error": {
"message": "File not found",
"type": "not_found_error"
}
}