Repository navigation
Align Platform and Growth Studio clients with the official API docs - #3
Merged
Merged
Conversation
A review of every operation against docs.platform.pixverse.ai and the Growth Studio OpenAPI integration guide found the fusion img_id bug was systemic, plus several other request-shape and recovery mismatches. Platform requests - Serialize every field the API reference types as integer (img_id, img_ids, template_id, source_video_id, video_media_id, audio_media_id, keyframe_id, restyle_id, agent_id, nested reference IDs) as lossless JSON numbers via a per-operation map. ~17 billable operations sent quoted IDs that the API rejects with ErrCode 400013. - Send template_ids as one comma-separated query value and type upload file parts by extension instead of application/octet-stream. Platform validation - sound-effect: drop the nonexistent prompt field; use the documented sound_effect_content and original_sound_switch. - music-mv: accept vibe_mv_v3/vibe_mv_v3_custom, make aspect_ratio and quality optional, fix mv_style/music_style lists, link the public doc. - template prompt may be empty; transition accepts only first_frame_img/last_frame_img; viral-recreation references require uploaded IDs and strip local paths; documented bounds for multi-transition durations, keyframe_id, restyle seed, extend models, avatar TTS length, real-estate pro-only fields, v6 omni video-only fusion. Platform polling and webhooks - Keep polling through transient read errors (transport, 429, 5xx, ErrCode 500069/500044) until the timeout; default interval 5s and timeout 30m; fresh Ai-trace-id per read retry. Billable submissions are still sent exactly once. - Answer verified duplicate webhooks with 200 ok, dedupe on (id, status), accept null values, sort keys by code point, and make the timestamp tolerance configurable (default 6h to cover retries). Growth Studio - Use the documented /openapi/v1/folders endpoints and send video.folder_id instead of a top-level folder_id. - Retry GET requests on 429/503 honoring Retry-After; never retry create, edit, upload, or folder create. - Parse responses losslessly, keep request_id in error.json, keep user folder names unchanged, and validate documented create, edit, list, and upload limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s as integers Live API checks showed both schemas are wrong: quoted IDs in fusion video_references[] and image.template img_ids[] are rejected with ErrCode 400013, while integers are accepted, matching the v6 video reference and image template guide examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A full review of the kit against docs.platform.pixverse.ai and the Growth Studio OpenAPI integration guide found that the fusion
img_idbug (983538b) was one case of a wider problem, along with other request-shape and recovery mismatches. This PR fixes them all.Platform requests
src/platform/request.jsnow serializes every documented integer field losslessly. Fields the docs type as string (mask_id(s),lip_sync_tts_speaker_id,webhook_id) stay quoted.template_idsis sent as one comma-separated query value.application/octet-stream.Platform validation
video.sound-effectno longer requires apromptfield the API doesn't have; it usessound_effect_content.agent.music-mv:vibe_mv_v3andvibe_mv_v3_customaspect_ratioandqualityare optionalmv_styleandmusic_stylelistsvideo.templateallows an empty prompt.video.transitionaccepts onlyfirst_frame_imgandlast_frame_img.keyframe_id(minimum 1)seedPlatform polling and webhooks
Ai-trace-id. Billable submissions are still sent exactly once.200 okinstead of 409(id, status)nullvalues are acceptedGrowth Studio
GET/POST /openapi/v1/foldersinstead of/marketing_hub/folder/*, and removes the separate folder key and prefix settings.video.folder_idinstead of a top-levelfolder_id.Retry-After. Create, edit, upload and folder create are never retried.request_idinerror.json.Not changed or needs confirmation
video_referencesIDs andimage.templateimg_idsare listed as string in the schemas, but the API rejects quoted values (400013), so both are now sent as integers. Upscale integers were confirmed too.type=2template returned by the template list is a "workflow template" that the API says belongs to an undocumentedPOST /openapi/v2/template/generate;image.templatecould not complete live./openapi/v1/ecommerce_pdp/video) and wallet endpoints. Left unchanged; worth confirming with PixVerse.Test plan
npm test: 490/490npm run test:customer-plugin: 40/40npm run check,npm run security:scanfolders liston/openapi/v1/folders, avatars, video list, walletvideo.folder_id: a nonexistent folder atvideo.folder_idreturns404 FOLDER_NOT_FOUND, while the same folder at the old top-levelfolder_idis ignored and a video is created. So the old placement silently dropped the folder.POST /openapi/v1/videossuccess: every attempt (with or without a folder) returns500 INTERNAL_ERRORand leaves afailedvideo withGENERATION_FAILED, uncharged. This looks server-side and needs PixVerse.🤖 Generated with Claude Code