### GET /v1/models Source: https://vividai.run/docs Lists all available models. ```APIDOC ## GET /v1/models ### Description Retrieves a list of all models available for use. ### Method GET ### Endpoint https://vividai.run/v1/models ``` -------------------------------- ### GET /v1/models Source: https://vividai.run/docs Retrieve the list of available models for image and video generation. ```APIDOC ## GET /v1/models ### Description Retrieve the list of available models for image and video generation. ### Method GET ### Endpoint https://vividai.run/v1/models ``` -------------------------------- ### GET /v1/videos/{id} Source: https://vividai.run/docs Check the status of a video generation task. ```APIDOC ## GET /v1/videos/{id} ### Description Check the status of a video generation task. ### Method GET ### Endpoint https://vividai.run/v1/videos/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the video task ``` -------------------------------- ### GET /v1/videos/{id} Source: https://vividai.run/docs Retrieves the status of a video generation task. ```APIDOC ## GET /v1/videos/{id} ### Description Polls the status of a video generation task using its ID. ### Method GET ### Endpoint https://vividai.run/v1/videos/{id} ``` -------------------------------- ### GET /v1/videos/{id}/content Source: https://vividai.run/docs Downloads the generated video file. ```APIDOC ## GET /v1/videos/{id}/content ### Description Downloads the completed video file in MP4 format. ### Method GET ### Endpoint https://vividai.run/v1/videos/{id}/content ``` -------------------------------- ### GET /v1/videos/{id} Source: https://vividai.run/docs Polls the status of an asynchronous video generation task. ```APIDOC ## GET /v1/videos/{id} ### Description Polls the status of a video generation task. Status transitions from 'queued' to 'in_progress' to 'completed' or 'failed'. ### Method GET ### Endpoint /v1/videos/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique task identifier ### Response #### Success Response (200) - **status** (string) - Current status of the task ``` -------------------------------- ### GET /v1/videos/{id}/content Source: https://vividai.run/docs Download the generated MP4 video content. ```APIDOC ## GET /v1/videos/{id}/content ### Description Download the generated MP4 video content. ### Method GET ### Endpoint https://vividai.run/v1/videos/{id}/content ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the video task ``` -------------------------------- ### GET /v1/videos/{id}/content Source: https://vividai.run/docs Retrieves the raw MP4 binary content of a completed video task. ```APIDOC ## GET /v1/videos/{id}/content ### Description Retrieves the raw MP4 binary content once the video generation task is completed. ### Method GET ### Endpoint /v1/videos/{id}/content ### Parameters #### Path Parameters - **id** (string) - Required - The unique task identifier ### Response #### Success Response (200) - **body** (binary) - Raw MP4 binary data ``` -------------------------------- ### POST /v1/videos Source: https://vividai.run/docs Create an asynchronous video generation task. ```APIDOC ## POST /v1/videos ### Description Create an asynchronous video generation task. ### Method POST ### Endpoint https://vividai.run/v1/videos ### Parameters #### Request Body - **model** (string) - Required - Model name - **prompt** (string) - Required - Text description - **seconds** (string/int) - Required - Duration in seconds - **size** (string) - Optional - Resolution/ratio - **input_reference** (file) - Optional - Reference image for video generation ``` -------------------------------- ### POST /v1/videos Source: https://vividai.run/docs Initiates an asynchronous video generation task. ```APIDOC ## POST /v1/videos ### Description Initiates an asynchronous video generation task. Returns a task object with a status of 'queued'. ### Method POST ### Endpoint /v1/videos ### Response #### Success Response (200) - **id** (string) - Unique task identifier - **object** (string) - Object type, returns 'video' - **status** (string) - Current task status, initially 'queued' ``` -------------------------------- ### Video Generation Workflow with curl Source: https://vividai.run/docs Asynchronous video generation process involving task creation, status polling, and content download. ```bash # 1) 创建任务 → 立即返回 {"id": "...", "status": "queued"} curl https://vividai.run/v1/videos \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-video", "prompt": "a paper boat sailing down a rainy street, cinematic", "seconds": "6", "size": "1280x720" }' # 2) 轮询状态,直到 status=completed curl https://vividai.run/v1/videos/ \ -H "Authorization: Bearer YOUR_API_KEY" # 3) 下载 mp4(完成后) curl https://vividai.run/v1/videos//content \ -H "Authorization: Bearer YOUR_API_KEY" -o out.mp4 ``` -------------------------------- ### POST /v1/videos Source: https://vividai.run/docs Creates a new video generation task. ```APIDOC ## POST /v1/videos ### Description Initiates a video generation task. Returns a task ID and status. ### Method POST ### Endpoint https://vividai.run/v1/videos ### Request Body - **model** (string) - Required - The video model identifier - **prompt** (string) - Required - The text description for the video - **seconds** (string) - Required - Duration of the video - **size** (string) - Required - Resolution (e.g., "1280x720") ``` -------------------------------- ### Text-to-Image Generation with Python Source: https://vividai.run/docs Generate images using the OpenAI SDK. Note that the returned URL is a temporary direct link and should be downloaded promptly. ```python import urllib.request from openai import OpenAI client = OpenAI(api_key="YOUR_API_KEY", base_url="https://vividai.run/v1") resp = client.images.generate( model="imagine-1.5pro", prompt="a corgi running in a golden wheat field, cinematic", size="2048x2048", # 2K · 1:1,见下方对照表 ) # 结果是图片 URL(上游原始直链,会过期 → 尽快下载/转存) urllib.request.urlretrieve(resp.data[0].url, "out.png") ``` -------------------------------- ### List Available Models with curl Source: https://vividai.run/docs Retrieve a list of available models supported by the API. ```bash curl https://vividai.run/v1/models \ -H "Authorization: Bearer YOUR_API_KEY" ``` -------------------------------- ### Video Generation Workflow with Python Source: https://vividai.run/docs Automated video generation using requests to handle task submission, polling, and file saving. ```python import time, requests base = "https://vividai.run/v1" h = {"Authorization": "Bearer YOUR_API_KEY"} # 1) 创建 job = requests.post(f"{base}/videos", headers=h, json={ "model": "grok-video", "prompt": "a paper boat sailing down a rainy street", "seconds": "6", "size": "1280x720", }).json() vid = job["id"] # 2) 轮询 while True: s = requests.get(f"{base}/videos/{vid}", headers=h).json() if s["status"] in ("completed", "failed"): break time.sleep(5) # 3) 下载 if s["status"] == "completed": mp4 = requests.get(f"{base}/videos/{vid}/content", headers=h).content open("out.mp4", "wb").write(mp4) ``` -------------------------------- ### POST /v1/images/generations Source: https://vividai.run/docs Generate images from text prompts. ```APIDOC ## POST /v1/images/generations ### Description Generate images from text prompts. ### Method POST ### Endpoint https://vividai.run/v1/images/generations ### Parameters #### Request Body - **model** (string) - Required - Model name (alias preferred) - **prompt** (string) - Required - Text description - **size** (string) - Optional - Width x Height (e.g., "1024x1024") ``` -------------------------------- ### Image-to-Image Generation with Python Source: https://vividai.run/docs Edit images using the OpenAI SDK. The image parameter accepts a file object or a list of file objects for multiple references. ```python import urllib.request from openai import OpenAI client = OpenAI(api_key="YOUR_API_KEY", base_url="https://vividai.run/v1") resp = client.images.edit( model="imagine-1.5pro", image=open("input.png", "rb"), # 多张:image=[open("a.png","rb"), open("b.png","rb")] prompt="把这张图改成赛博朋克风格", ) # 结果是图片 URL(上游原始直链,会过期 → 尽快下载/转存) urllib.request.urlretrieve(resp.data[0].url, "out.png") ``` -------------------------------- ### POST /v1/images/generations Source: https://vividai.run/docs Generates an image based on a text prompt. ```APIDOC ## POST /v1/images/generations ### Description Generates an image from a text prompt using a specified model and resolution. ### Method POST ### Endpoint https://vividai.run/v1/images/generations ### Request Body - **model** (string) - Required - The model identifier (e.g., "imagine-1.5pro") - **prompt** (string) - Required - The text description for image generation - **size** (string) - Optional - The resolution (e.g., "2048x2048"), defaults to 1:1 2K ### Request Example { "model": "imagine-1.5pro", "prompt": "a corgi running in a golden wheat field, cinematic", "size": "2048x2048" } ``` -------------------------------- ### POST /v1/images/edits Source: https://vividai.run/docs Edits an existing image based on a prompt. ```APIDOC ## POST /v1/images/edits ### Description Modifies an uploaded image based on a text prompt. ### Method POST ### Endpoint https://vividai.run/v1/images/edits ### Request Body - **model** (string) - Required - The model identifier - **prompt** (string) - Required - The instruction for editing the image - **size** (string) - Optional - The resolution - **image** (file) - Required - The input image file ``` -------------------------------- ### Image-to-Image Generation with curl Source: https://vividai.run/docs Perform image editing or style transfer using multipart form data. Multiple reference images can be provided by repeating the -F flag. ```bash curl https://vividai.run/v1/images/edits \ -H "Authorization: Bearer YOUR_API_KEY" \ -F model="imagine-1.5pro" \ -F prompt="把这张图改成赛博朋克风格" \ -F size="2048x2048" \ -F image=@input.png # 多张参考图:重复 -F image=@a.png -F image=@b.png ``` -------------------------------- ### POST /v1/images/edits Source: https://vividai.run/docs Perform image-to-image editing using multipart file uploads. ```APIDOC ## POST /v1/images/edits ### Description Perform image-to-image editing using multipart file uploads. ### Method POST ### Endpoint https://vividai.run/v1/images/edits ### Parameters #### Request Body - **image** (file) - Required - Input image(s); use image[] for multiple files - **prompt** (string) - Required - Editing/reference description - **model** (string) - Required - Model name - **size** (string) - Optional - Resolution/ratio setting ``` -------------------------------- ### Text-to-Image Generation with curl Source: https://vividai.run/docs Perform text-to-image generation by sending a JSON payload to the generations endpoint. ```bash curl https://vividai.run/v1/images/generations \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "imagine-1.5pro", "prompt": "a corgi running in a golden wheat field, cinematic", "size": "2048x2048" }' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.