FILES
Delete a File
Delete a file. Removes both the stored bytes and the file record; references to the file (e.g. from past video jobs) stop resolving.
DELETE/v1/files/{file_id}
Authorization
AuthorizationstringheaderrequiredBearer token — your API key. Example: Bearer sk-...
Connector-managed files
Files with the connector purpose are owned by a connector sync and cannot
be deleted through this endpoint (400) — remove them through the connector
sync lifecycle instead.
Response
idstringrequiredThe deleted file's ID.
object"file"requiredObject type — always "file".
deletedbooleanrequiredAlways true on success.
Request
import OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai/v1",
});
const result = await client.files.delete("file-3f1a9c2e");
console.log(result.deleted); // trueimport OpenAI from "openai";
const client = new OpenAI({
apiKey: "your-scx-api-key",
baseURL: "https://api.scx.ai/v1",
});
const result = await client.files.delete("file-3f1a9c2e");
console.log(result.deleted); // trueResponse
{
"id": "file-3f1a9c2e-5b7d-4e08-9a2b-6c1d8e4f7a90",
"object": "file",
"deleted": true
}{
"id": "file-3f1a9c2e-5b7d-4e08-9a2b-6c1d8e4f7a90",
"object": "file",
"deleted": true
}