> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.videogen.io/rest-api-reference/files/create-file-upload/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.videogen.io/_mcp/server. # Create file upload POST https://api.videogen.io/v1/files/upload Content-Type: application/json Create a new file and receive a pre-signed upload URL. PUT the file bytes to the returned URL, then poll `GET /v1/files/{fileId}` until the file is ready. Reference: https://docs.videogen.io/rest-api-reference/files/create-file-upload ## Authentication - `Authorization` header (bearer token, required) — API key from [app.videogen.io/api](https://app.videogen.io/api). The full key is only shown once when you create it. ## Request ### Body (application/json) This endpoint expects a CreateFileUploadRequest. - `displayName` (string, required) — Display name for the uploaded file. - `type` (enum, optional) — The type of file to upload. Optional; when omitted, the type is inferred after upload processing completes. - Allowed values: `IMAGE`, `VIDEO`, `AUDIO`, `PDF`, `SLIDESHOW`, `TEXT`, `LOTTIE` - `isTemporary` (boolean, optional, default: false) — When true, the file is temporary. Temporary files are guaranteed to be available for 24 hours, after which they may be archived at any time. Temporary files are not analyzed (no description, transcript, or embedding will be generated), so they will not appear in search results. Defaults to false. - `hideFromUi` (boolean, optional, default: false) — When true, the file is hidden from the VideoGen Media page by default. It remains accessible through the API. Defaults to false. - `transcript` (Transcript, optional, nullable) — Optional pre-computed transcript for an audio or video upload, as timed `words`. When provided, transcription is skipped and caption timing matches your transcript. Ignored for non-audio/video files. ## Response ### 200 Upload instructions - `fileId` (string, required) — The file id to use in subsequent API calls (e.g. `vg_file_...`). - `uploadUrl` (string, required) — Pre-signed URL. PUT the raw file bytes to this URL to complete the upload. ## Types ### Transcript A transcript of an audio file, as timed words in order. - `words` (list of TranscriptWord, required) — The transcript words, sorted by `startSeconds` and non-overlapping. Must contain at least one word. - `languageCode` (string, optional, nullable) — Optional BCP-47 language code of the spoken audio (e.g. `en`, `es`). Used to tag the transcript's language; omit if unknown. ### TranscriptWord A single timed word of a transcript. - `startSeconds` (double, required) — Start time of the word in seconds from the beginning of the audio. - `endSeconds` (double, required) — End time of the word in seconds from the beginning of the audio. Must be greater than `startSeconds`. - `word` (string, required) — The spoken word, used verbatim for narration timing and captions. ## Examples **Request** ```json { "displayName": "My Campaign Video", "type": "VIDEO" } ``` **Response** ```json { "fileId": "vg_file_obLD1OX2eJCrEs0071Z4kA", "uploadUrl": "https://9f3a7c1e8b4d6a0f2c5e9b1d7a8c3f60.r2.cloudflarestorage.com/storage-files-prod/vg_file_obLD1OX2eJCrEs0071Z4kA/primary-source?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=example%2F20260505%2Fwnam%2Fs3%2Faws4_request&X-Amz-Date=20260505T120000Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=exampleSignatureValue" } ``` **SDK Code** ```typescript import { VideoGen } from "@videogen/sdk"; const client = new VideoGen({ apiKey: "sk_videogen_live_..." }); await client.files.createFileUpload({ type: "VIDEO", displayName: "My Campaign Video", }); ``` ```python from videogen import VideoGen client = VideoGen(api_key="sk_videogen_live_...") client.files.create_file_upload( type="VIDEO", display_name="My Campaign Video", ) ``` > HTTP API with TypeScript and Python SDKs for generating image, video, and audio assets with VideoGen.