### Create Task Example Source: https://piapi.ai/docs/kling-api/create-task This example demonstrates a successful response when creating a task. ```APIDOC ## POST /tasks ### Description Creates a new task for processing. ### Method POST ### Endpoint /tasks ### Request Body - **prompt** (string) - Required - The prompt for the task. - **model** (string) - Optional - The model to use for the task. - **task_type** (string) - Optional - The type of task to create (e.g., txt2img). ### Response #### Success Response (200) - **task_id** (string) - The unique identifier for the created task. - **model** (string) - The model used for the task. - **task_type** (string) - The type of the task. - **status** (string) - The current status of the task (e.g., pending, running, completed). - **input** (object) - The input parameters for the task. - **prompt** (string) - The prompt provided for the task. - **output** (any) - The output of the task once completed. - **meta** (object) - Metadata associated with the task. - **account_id** (integer) - The ID of the account that created the task. - **account_name** (string) - The name of the account that created the task. - **created_at** (string) - The timestamp when the task was created. - **started_at** (string) - The timestamp when the task started processing. - **completed_at** (string) - The timestamp when the task was completed. - **detail** (any) - Additional details about the task. - **logs** (array) - A list of logs related to the task. - **error** (object) - Error information if the task failed. - **code** (integer) - The error code. - **message** (string) - The error message. #### Response Example ```json { "task_id": "49638cd2-4689-4f33-9336-164a8f6b1111", "model": "Qubico/flux1-dev", "task_type": "txt2img", "status": "pending", "input": { "prompt": "a bear" }, "output": null, "meta": { "account_id": 0, "account_name": "Qubico_test_user", "created_at": "2024-08-16T16:13:21.194049Z", "started_at": "", "completed_at": "" }, "detail": null, "logs": [], "error": { "code": 0, "message": "" } } ``` ``` -------------------------------- ### Example Task Response (200 OK) Source: https://piapi.ai/docs/trellis-api/get-task This example shows a successful response when retrieving task details. It includes the task ID, model, status, input, and metadata. ```json { "task_id": "49638cd2-4689-4f33-9336-164a8f6b1111", "model": "Qubico/flux1-dev", "task_type": "txt2img", "status": "pending", "input": { "prompt": "a bear" }, "output": null, "meta": { "account_id": 0, "account_name": "Qubico_test_user", "created_at": "2024-08-16T16:13:21.194049Z", "started_at": "", "completed_at": "" }, "detail": null, "logs": [], "error": { "code": 0, "message": "" } } ``` -------------------------------- ### Get Task API Response Example Source: https://piapi.ai/docs/faceswap-api/get-task This example shows a successful response for a completed face-swap task. It includes the task ID, model used, task type, status, configuration, input/output, metadata, and error details. ```json { "task_id": "90efd2db-bcfc-413f-a0be-c893850c9d68", "model": "Qubico/image-toolkit", "task_type": "face-swap", "status": "completed", "config": { "webhook_config": { "endpoint": "", "secret": "" } }, "input": {}, "output": {}, "meta": {}, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "" } } ``` -------------------------------- ### Example Task Response Source: https://piapi.ai/docs/ace-step-api/get-task This example shows a successful response (200 OK) for a task, detailing its ID, input parameters, status, metadata, and associated works. ```json 200 ``` ```json { "task_id": "22db1753-fbf6-4996-9385-11111111", "input": ">- {\"professional_mode\":true,\"prompt\":\"sleeping\n cat\",\"negative_prompt\":\"\",\"creativity\":\"0.6\",\"duration\":\"5\",\"aspect_ratio\":\"1:1\",\"camera_json\":\"{\\\"type\\\":\\\"empty\\\",\\\"horizontal\\\":0.0,\\\"vertical\\\":0.0,\\\"zoom\\\":0.0,\\\"tilt\\\":0.0,\\\"pan\\\":0.0,\\\"roll\\\":0.0}\"}", "status": "completed", "metadata": { "created_at": "2024-08-13T05:15:56.809611007Z", "started_at": "2024-08-13T05:15:57.553314938Z", "ended_at": "2024-08-13T05:22:29.84202933Z", "quota_frozen": 0, "quota_usage": 0 }, "task": { "id": 38888881, "userId": 3777777, "type": "m2v_img2video_hq", "status": 99, "taskInfo": { "arguments": [ { "name": "prompt", "value": "sleeping cat" }, { "name": "negative_prompt", "value": "" }, { "name": "cfg", "value": "0.6" }, { "name": "duration", "value": "5" }, { "name": "aspect_ratio", "value": "1:1" }, { "name": "camera_json", "value": ">- {\"type\":\"empty\",\"horizontal\":0.0,\"vertical\":0.0,\"zoom\":0.0,\"tilt\":0.0,\"pan\":0.0,\"roll\":0.0}" }, { "name": "biz", "value": "klingai" }, { "name": "tail_image_enabled", "value": "true" } ], "inputs": [ { "inputType": "URL", "name": "input", "url": ">- https://s16-def.ap4r.com/bs2/upload-ylab-stunt-sgp/ai_portal/1723526000/LHWdEpt7Jb/bqqtjvq.jpeg", "blobStorage": null, "token": null }, { "inputType": "URL", "name": "tail_image", "url": ">- https://s22-def.ap4r.com/bs2/upload-ylab-stunt-sgp/ai_portal/1723526000/tPFzmmZZ1T/6hfglzl.jpeg", "blobStorage": null, "token": null } ], "type": "m2v_img2video_hq" }, "favored": false, "deleted": false, "createTime": 1723526219999, "updateTime": 1723526542999 }, "works": [ { "workId": 50692667, "workItemId": 0, "taskId": 37777771, "userId": 3777777, "type": "m2v_img2video_hq", "status": 99, "contentType": "video", "resource": { "resource": ">- ``` -------------------------------- ### Seedance API Text-to-Video Example Source: https://piapi.ai/docs/seedance-api/seedance-2 Example of generating a video from a text prompt using the text_to_video mode. Includes webhook configuration for task notifications. ```json { "model": "seedance", "task_type": "seedance-2-fast", "input": { "prompt": "A woman sings and strums her guitar", "mode": "text_to_video", "duration": 5, "aspect_ratio": "16:9" }, "config": { "webhook_config": { "endpoint": "https://your-webhook-endpoint.example.com/callback", "secret": "" } } } ``` -------------------------------- ### Text to Video API Response Example Source: https://piapi.ai/docs/wan-api/wan26-text-to-video This example shows a successful response from the text-to-video API, including task details and status. ```json { "code": 200, "data": { "task_id": "29636325-347c-4361-9df1-76c6af8835ee", "model": "Wan", "task_type": "wan26-txt2video", "status": "pending", "config": { "service_mode": "", "webhook_config": { "endpoint": "https://webhook.site/3c7b8a0b-bf72-46cc-8fb9-e5ca37100f9b", "secret": "" } }, "input": { "prompt": "stylized animation, Sylvanas Windrunner, large expressive eyes, cartoonish proportions, battling the Lich King Arthas, exaggerated features, on a vibrant, colorful Icecrown Citadel, swirling snow effect, dynamic poses," } }, "message": "" } ``` -------------------------------- ### Text to Audio Generation Example Source: https://piapi.ai/docs/kling-api/kling-sound-api Use this example to generate audio from a text prompt. Specify the desired duration and optionally configure webhook notifications for task updates. ```json { "model": "kling", "task_type": "sound", "input": { "prompt": ">-\n The audio contains the sound of a lively violin playing a marching tune.", "duration": 10 }, "config": { "service_mode": "public", "webhook_config": { "endpoint": ">-\n https://webhook.site/29649907-dab6-40f5-b059-b11b7a81fec1", "secret": "" } } } ``` -------------------------------- ### Add Audio to Video Example Source: https://piapi.ai/docs/kling-api/kling-sound-api This example demonstrates how to add generated audio to an existing video by referencing the origin task ID. Webhook configuration is included for notifications. ```json { "model": "kling", "task_type": "sound", "input": { "origin_task_id": "738c9d85-a69e-47a9-b5f0-49b1bd98a0bb" }, "config": { "service_mode": "public", "webhook_config": { "endpoint": ">-\n https://webhook.site/29649907-dab6-40f5-b059-b11b7a81fec1", "secret": "" } } } ``` -------------------------------- ### Text to Video API Request Example Source: https://piapi.ai/docs/wan-api/wan26-text-to-video This example demonstrates a typical request to the Text to Video API, specifying detailed parameters for video generation. ```json { "prompt": "comic book panel framing, strong rim lighting, saturated\n colors, stylized textures, epic clash, cartoonish smoke\n and impact effects, close-up on Sylvanas' determined face,\n wide shot of the chaotic battle, vibrant and energetic,\n reminiscent of Arcane, 4k, animated", "negative_prompt": "low resolution", "prompt_extend": true, "shot_type": "multi", "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250923/hbiayh/%E4%BB%8E%E5%86%9B%E8%A1%8C.mp3", "audio": true, "resolution": "720P", "aspect_ratio": "16:9", "duration": 5, "watermark": false, "seed": 0 } ``` -------------------------------- ### Text to Video API Response Example Source: https://piapi.ai/docs/wan-api/wan26-text-to-video This example shows a successful response from the Text to Video API, including metadata about the generated video and usage details. ```json { "output": null, "meta": { "created_at": "2025-12-17T10:28:49.8528496Z", "started_at": "0001-01-01T00:00:00Z", "ended_at": "0001-01-01T00:00:00Z", "usage": { "type": "point", "frozen": 4000000, "consume": 0 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } } ``` -------------------------------- ### Example Webhook Request for Luma Video Generation Source: https://piapi.ai/docs/unified-webhook This example shows a complete webhook request for a Luma video generation task, detailing input, output, and metadata. ```json { "timestamp": 1724511853, "data": { "task_id": "58cb41b7-556d-46c0-b82e-1e116aa1a31a", "model": "luma", "task_type": "video_generation", "status": "completed", "config": { "webhook_config": { "endpoint": "https://webhook.site/xxxxx", "secret": "123456" } }, "input": { "aspect_ratio": "16:9", "expand_prompt": true, "image_end_url": "https://i.imgur.com/CSmEZud.png", "image_url": "https://i.imgur.com/eJkSUnA.png", "loop": false, "user_prompt": "" }, "output": { "generation": { "id": "ab9124ef-49d4-4da7-bf12-0c3891a3cca8", "prompt": "", "state": "completed", "created_at": "2024-08-24T15:01:52.727Z", "video": { "url": "https://storage.cdn-luma.com/dream_machine/49995d70-d0f3-4b0d-afb0-ec034107e4e2/watermarked_video08fe0802a4e104f1a80fb6c6c658710ee.mp4", "url_no_watermark": "https://img.midjourneyapi.xyz/ephemeral/db7420f9-8a24-48fd-ade5-ede803e835db.mp4", "width": 1168, "height": 864, "thumbnail": "" }, "like": null, "estimate_wait_seconds": null } }, "meta": { "created_at": "2024-08-24T23:01:12.3556324+08:00", "started_at": "2024-08-24T23:01:36.7432691+08:00", "ended_at": "2024-08-24T23:04:13.5301322+08:00", "usage": { "type": "luma_quota", "frozen": 30, "consume": 30 } }, "detail": { "account_id": 1, "is_using_private_pool": false }, "logs": [], "error": { "code": 0, "message": "" } } } ``` -------------------------------- ### Get Task API Response Example Source: https://piapi.ai/docs/ai-hug-api/get-task This example shows a successful response for a task that is in a 'pending' state. It includes the task ID, model, type, status, input, output, metadata, and an empty error object. ```json { "code": 200, "data": { "task_id": "49638cd2-4689-4f33-9336-164a8f6b1111", "model": "Qubico/flux1-dev", "task_type": "txt2img", "status": "pending", "input": { "prompt": "a bear" }, "output": null, "meta": { "account_id": 0, "account_name": "Qubico_test_user", "created_at": "2024-08-16T16:13:21.194049Z", "started_at": "", "completed_at": "" }, "detail": null, "logs": [], "error": { "code": 0, "message": "" } }, "message": "success" } ``` -------------------------------- ### Image to Video API Request Example Source: https://piapi.ai/docs/wan-api/wan26-image-to-video This example demonstrates how to construct a request to the Image to Video API. It includes parameters for prompt, negative prompt, image URL, audio URL, resolution, duration, and optional configurations like webhook settings. ```json { "model": "Wan", "task_type": "wan26-img2video", "input": { "prompt": "A cool guy rapping in the night", "negative_prompt": "low resolution", "image": ">- https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png", "prompt_extend": true, "shot_type": "multi", "audio_url": ">- https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3", "audio": true, "resolution": "720p", "duration": 5, "watermark": false, "seed": 0 }, "config": { "webhook_config": { "endpoint": "https://webhook.site/3c7b8a0b-bf72-46cc-8fb9-e5ca37100f9b", "secret": "" } } } ``` -------------------------------- ### Get Task Details Source: https://piapi.ai/docs/kling-api/omni-get-task Retrieve the status and details of a specific task. This includes information about when the task started and ended, its resource usage, and any associated logs or errors. ```APIDOC ## GET /tasks/{task_id} ### Description Retrieves the details of a specific task, including its status, processing times, and resource usage. ### Method GET ### Endpoint /tasks/{task_id} ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task. ### Response #### Success Response (200) - **code** (integer) - The status code of the response. - **data** (object) - Contains the task details. - **task_id** (string) - The unique identifier of the task. - **model** (string) - The model used for the task. - **task_type** (string) - The type of task performed. - **status** (string) - The current status of the task (e.g., 'completed', 'processing'). - **input** (object) - The input parameters for the task. - **output** (object) - The output generated by the task. - **meta** (object) - Metadata associated with the task. - **started_at** (string) - The time when the task started processing. - **ended_at** (string) - The time when the task finished processing. - **usage** (object) - Resource usage details. - **type** (string) - The type of usage. - **frozen** (number) - Frozen resource amount. - **consume** (number) - Consumed resource amount. - **is_using_private_pool** (boolean) - Indicates if a private pool was used. - **detail** (null) - Placeholder for detailed task information, currently null. - **logs** (array) - An array of log objects associated with the task. - **error** (object) - Error details if the task failed. - **code** (integer) - The error code. - **message** (string) - The error message. - **message** (string) - A message describing the response, often indicating success or providing error guidance. #### Response Example ```json { "code": 0, "data": { "task_id": "f43657f9-5655-4869-a201-651ded8649bb", "model": "kling", "task_type": "omni_video_generation", "status": "completed", "input": {}, "output": {}, "meta": {}, "started_at": "2023-10-27T10:00:00Z", "ended_at": "2023-10-27T10:05:00Z", "usage": { "type": "compute", "frozen": 100, "consume": 50 }, "is_using_private_pool": false, "detail": null, "logs": [], "error": null }, "message": "Task retrieved successfully." } ``` ``` -------------------------------- ### Task Completed Example Source: https://piapi.ai/docs/gemini-api/nano-banana-2 Shows the response structure when a task has been successfully completed. It includes the output, such as image URLs, and updated timestamps for start and end times. ```json { "code": 200, "data": { "task_id": "qgycnfg4jxrmr0cwyq0rzc9tac", "model": "gemini", "task_type": "nano-banana-2", "status": "completed", "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } }, "input": { "prompt": "A red apple on a white table, photorealistic", "aspect_ratio": "1:1", "output_format": "jpg", "resolution": "1K" }, "output": { "image_urls": [ "https://example.jpeg" ] }, "meta": { "created_at": "2026-03-16T08:26:33.495Z", "started_at": "2026-03-16T08:26:35.000Z", "ended_at": "2026-03-16T08:27:25.090Z", "usage": { "type": "llm", "frozen": 0, "consume": 600000 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` -------------------------------- ### Unified Task Response Example Source: https://piapi.ai/docs/music-api/get-task This example shows the structure of a successful response when retrieving a completed music generation task. It includes the task ID, model, status, input, output, and configuration details. ```json { "task_id": "7088bf9d-6edb-4fab-b1fd-83afc64dde91", "model": "suno", "task_type": "generate_music", "status": "completed", "config": { "service_mode": "public", "webhook_config": { "endpoint": "", "secret": "" } }, "input": {}, "output": { "clips": { "7d7231fa-5015-4f71-8d0b-fd446f1dd446": {}, "a43c955a-3474-47f3-a550-57bf7c395c48": {} } } } ``` -------------------------------- ### Seedream API Task Object Example Source: https://piapi.ai/docs/seedream-api/get-task This example demonstrates the structure of a successful task response from the Seedream API. It includes details about the task ID, model, status, configuration, input parameters, output image URL, and metadata such as creation, start, and end times, along with usage statistics. ```json { "code": 200, "data": { "task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "model": "seedream", "task_type": "seedream-5-lite", "status": "completed", "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } }, "input": { "prompt": ">-\nA golden retriever playing in a field of sunflowers at\nsunset", "aspect_ratio": "16:9", "output_format": "png", "size": "2K" }, "output": { "image_url": ">-\nhttps://img.theapi.app/ephemeral/seedream-result-example.png" }, "meta": { "created_at": "2026-03-16T10:00:00.000000000Z", "started_at": "2026-03-16T10:00:01.000000000Z", "ended_at": "2026-03-16T10:00:18.000000000Z", "usage": { "type": "llm", "frozen": 0, "consume": 280000 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` -------------------------------- ### Text to Video Task Example Source: https://piapi.ai/docs/veo3-api/get-task Example of a completed text-to-video task, showing task ID, model, status, configuration, input parameters, output video URL, and metadata. ```json { "timestamp": 1758063366, "data": { "task_id": "52f22274-0fb7-4184-b5f1-e854e12fbf12", "model": "veo3", "task_type": "veo3-video-fast", "status": "completed", "config": { "service_mode": "", "webhook_config": { "endpoint": "https://webhook.site/4cefe58d-d5b8-4694-b30a-9118747b9631", "secret": "" } }, "input": { "aspect_ratio": "1:1", "duration": "4s", "generate_audio": false, "negative_prompt": "static background", "prompt": "A medium shot, historical adventure setting: Warm lamplight illuminates a cartographer in a cluttered study, poring over an ancient, sprawling map spread across a large table. Cartographer: 'According to this old sea chart, the lost island isn't myth! We must prepare an expedition immediately!'", "resolution": "720p" }, "output": { "video": "https://img.theapi.app/ephemeral/00da9d89-b4e0-4945-93aa-d55bafd3b435.mp4" }, "meta": { "created_at": "2025-09-16T22:54:16.847387261Z", "started_at": "2025-09-16T22:54:17.792225577Z", "ended_at": "2025-09-16T22:56:06.792096964Z", "usage": { "type": "llm", "frozen": 0, "consume": 4000000 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } } } ``` -------------------------------- ### Get Task Status Source: https://piapi.ai/docs/tts-get-task Retrieve the status and details of a Text-to-Speech task. This includes information about when the task was created, started, and ended, as well as usage statistics and any associated errors. ```APIDOC ## GET /tasks/{task_id} ### Description Retrieves the status and details of a specific text-to-speech task using its unique identifier. ### Method GET ### Endpoint `/tasks/{task_id}` ### Parameters #### Path Parameters - **task_id** (string) - Required - The unique identifier of the task. ### Response #### Success Response (200) - **code** (integer) - The HTTP status code of the response. - **data** (object) - Contains the task details. - **task_id** (string) - The unique identifier of the task. - **model** (string) - The TTS model used for the task. - **task_type** (string) - The type of task (e.g., 'zero-shot'). - **status** (string) - The current status of the task (e.g., 'pending', 'processing', 'completed', 'failed'). - **input** (object) - The input parameters for the task. - **gen_text** (string) - The text to be synthesized. - **ref_audio** (string) - URL to a reference audio file (if applicable). - **output** (object) - The output of the task (e.g., URL to the synthesized audio). - **meta** (object) - Metadata associated with the task. - **created_at** (string) - The timestamp when the task was created. - **started_at** (string) - The timestamp when the task started processing. - **ended_at** (string) - The timestamp when the task finished processing. - **usage** (object) - Usage statistics for the task. - **type** (string) - The type of usage (e.g., 'character'). - **frozen** (number) - The amount of frozen resources used. - **consume** (number) - The amount of resources consumed. - **is_using_private_pool** (boolean) - Indicates if a private resource pool was used. - **detail** ('null') - Placeholder for detailed task information, currently null. - **logs** (array) - An array of log objects associated with the task (currently empty). - **error** (object) - Information about any errors encountered. - **code** (integer) - The error code. - **message** (string) - A description of the error. - **message** (string) - A message describing the result of the operation. Provides guidance on handling common errors. #### Response Example ```json { "code": 200, "data": { "task_id": "e49d1460-d7db-47b8-a430-61b3415a6376", "model": "Qubico/tts", "task_type": "zero-shot", "status": "pending", "input": { "gen_text": "captain teemo, on duty!", "ref_audio": "https://replicate.delivery/pbxt/LnHEJTVWhjLcpGQJTBralyztLwl8diaLyHjP2a1KXJ8dxVWv/Teemo_Original_Taunt.ogg" }, "output": {}, "meta": { "created_at": "2023-10-27T10:00:00Z", "started_at": null, "ended_at": null, "usage": { "type": "character", "frozen": 0, "consume": 0 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": null }, "message": "Task retrieved successfully." } ``` ``` -------------------------------- ### Image to Video Task Example Source: https://piapi.ai/docs/veo3-api/get-task Example of a completed image-to-video task, including task details, input image URL, and output video URL. This shows the structure for tasks initiated with an image. ```json { "timestamp": 1758063316, "data": { "task_id": "a196da4b-b12d-48aa-bafc-e4eac4c3a357", "model": "veo3", "task_type": "veo3-video-fast", "status": "completed", "config": { "service_mode": "", "webhook_config": { "endpoint": "https://webhook.site/4cefe58d-d5b8-4694-b30a-9118747b9631", "secret": "" } }, "input": { "aspect_ratio": "auto", "duration": "8s", "generate_audio": true, "image_url": "https://storage.theapi.app/images/playground/20250916/oulb2qkbf0f.png", "prompt": "A medium shot, historical adventure setting: Warm lamplight illuminates a cartographer in a cluttered study, poring over an ancient, sprawling map spread across a large table. Cartographer: 'According to this old sea chart, the lost island isn't myth! We must prepare an expedition immediately!'", "resolution": "720p" }, "output": { "video": "https://img.theapi.app/ephemeral/45bed07d-d2ce-4b8e-82dc-d8a5ac053262.mp4" }, "meta": { "created_at": "2025-09-16T22:54:11.744202577Z", "started_at": "2025-09-16T22:54:12.787320465Z", "ended_at": "2025-09-16T22:55:16.858440368Z", "usage": { "type": "llm", "frozen": 0, "consume": 4000000 } } } } ``` -------------------------------- ### Seedance API Task Completion Response Source: https://piapi.ai/docs/seedance-api/seedance-2 Example of a successful response when a Seedance task has completed. This includes the video output URL, usage details, and timestamps for creation, start, and end. ```json { "code": 200, "data": { "task_id": "801a0826-2b04-46bb-abec-fbec9d407cf1", "model": "seedance", "task_type": "seedance-2-fast", "status": "completed", "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } }, "input": { "prompt": ">- Transform @video1 into an anime style, the cat plays piano with cherry blossoms falling around", "mode": "omni_reference", "video_urls": [ "https://example.com/cat-piano.mp4" ], "aspect_ratio": "9:16", "duration": 8 }, "output": { "video": "https://img.theapi.app/example.mp4" }, "meta": { "created_at": "2026-04-05T23:03:48.646972369Z", "started_at": "2026-04-05T23:03:49.959358462Z", "ended_at": "2026-04-05T23:06:53.752837736Z", "usage": { "type": "point", "frozen": 0, "consume": 6400000 } } }, "message": "success" } ``` -------------------------------- ### Verify Claude Code Installation Source: https://piapi.ai/docs/claude-code/usage-guide Verifies the installation of the Claude Code CLI by checking its version. ```bash claude --version ``` -------------------------------- ### Task Created Example (Pending) Source: https://piapi.ai/docs/gemini-api/nano-banana-2 Illustrates the expected response structure when a task is successfully created and is in a pending state. This includes details like task ID, model, status, and input configuration. ```json { "code": 200, "data": { "task_id": "qgycnfg4jxrmr0cwyq0rzc9tac", "model": "gemini", "task_type": "nano-banana-2", "status": "pending", "config": { "service_mode": "", "webhook_config": { "endpoint": "", "secret": "" } }, "input": { "prompt": "A red apple on a white table, photorealistic", "aspect_ratio": "1:1", "output_format": "jpg", "resolution": "1K" }, "output": null, "meta": { "created_at": "2026-03-16T08:26:33.495Z", "started_at": "0001-01-01T00:00:00Z", "ended_at": "0001-01-01T00:00:00Z", "usage": { "type": "llm", "frozen": 0, "consume": 600000 }, "is_using_private_pool": false }, "detail": null, "logs": [], "error": { "code": 0, "raw_message": "", "message": "", "detail": null } }, "message": "success" } ``` -------------------------------- ### MM-Audio API Task Creation OpenAPI Example Source: https://piapi.ai/docs/mmaudio-api/create-task This example demonstrates the structure of a request to create a video-to-audio task using the MM-Audio API, including model, task type, input parameters, and webhook configuration. ```yaml type: object required: - prompt - video x-apidog-orders: - prompt - negative_prompt - video - steps - seed config: type: object properties: webhook_config: type: object properties: endpoint: type: string secret: type: string x-apidog-orders: - endpoint - secret x-apidog-orders: - webhook_config x-apidog-orders: - model - task_type - input - config example: model: Qubico/mmaudio task_type: video2audio input: prompt: '' negative_prompt: '' video: '' steps: 20 seed: 48511119825268 config: webhook_config: endpoint: '' secret: '' headers: {} x-apidog-name: Success security: [] x-apidog-folder: Endpoints/Mmaudio x-apidog-status: developing x-run-in-apidog: https://app.apidog.com/web/project/675356/apis/api-14928507-run components: schemas: {} securitySchemes: {} servers: - url: https://api.piapi.ai description: Develop Env security: [] ``` -------------------------------- ### Install Claude Code CLI via npm Source: https://piapi.ai/docs/claude-code/usage-guide Installs the Claude Code CLI using npm. ```bash npm install -g @anthropic-ai/claude-code ``` -------------------------------- ### Install Dependencies for PiAPI MCP Server Source: https://piapi.ai/docs/mcp-server Install the necessary Node.js dependencies for the PiAPI MCP Server project. ```bash npm install ```