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

Authorizationstringheaderrequired

Bearer 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

idstringrequired

The deleted file's ID.

object"file"required

Object type — always "file".

deletedbooleanrequired

Always 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); // true

Response

{
  "id": "file-3f1a9c2e-5b7d-4e08-9a2b-6c1d8e4f7a90",
  "object": "file",
  "deleted": true
}