Repository navigation
fix(video): migrate higgsfield_video to api.higgsfield.ai - #958
Open
HappyFeet07 wants to merge 1 commit into
Open
HappyFeet07 wants to merge 1 commit into
HappyFeet07 wants to merge 1 commit into
Conversation
…eInc#957) The tool still targeted the deprecated platform.higgsfield.ai host with Bearer auth, so every submit failed with 401 for valid keys. - Use https://api.higgsfield.ai with one endpoint per model and Authorization: Key <key>:<secret> - Read request_id/status_url from the submit response, compare status case-insensitively and take the output from video.url - Route only models with a verified endpoint (seedance_2.0, kling_3.0 Pro); other models fail before any request is sent - Validate duration, aspect ratio and resolution per model before submit - Add generate_audio (maps to generate_audio / sound) and resolution - Price from Higgsfield's published per-second rates instead of the stale per-clip table (kling_3.0 was under-quoted about 3x) 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
higgsfield_videostill targeted the deprecatedplatform.higgsfield.aihost withBearerauth, so it could not generate anything with valid keys. This moves it to the currenthttps://api.higgsfield.aicontract described in #957, and fixes the cost estimate and request validation along the way.Related issue
Closes #957
Changes
Host and auth:
https://api.higgsfield.ai/<model path>/<text-to-video|image-to-video>withAuthorization: Key <key>:<secret>. Nomodel/taskbody fields.Response parsing: reads
request_idandstatus_urlfrom the submit response, compares status case-insensitively (queued | in_progress | completed | failed | nsfw | canceled), and takes the output fromvideo.url. Errors now include therequest_id, so a charged job can be found later.Routes only verified models. I checked endpoints with the free
POST /estimate/...call:seedance_2.0→bytedance/seedance-2.0(200)kling_3.0→kling-video/v3.0/pro(200)seedance_2.0_fast,veo_3.1,sora_2,wan_2.5orsoul_cinema; every path I tried returned 404 or 423.Those models now fail before any request is sent, so no money can be spent on an unknown route. The schema enum is unchanged; routes can be added to
_MODEL_ROUTESonce their endpoints are confirmed.Validation before submit, using the limits the estimate endpoint enforces:
5/10/15enum blocked valid lengths such as 3 s and 6 s)image_urlis required for image-to-videoNew inputs:
generate_audio(defaulttrue). Sent asgenerate_audioto Seedance and assound: on|offto Kling. Kling's default is sound on, so before this change there was no way to get a silent clip for scoring in post.resolution, Seedance only (default720p).Cost: uses Higgsfield's published per-second self-serve rates (Kling 3.0 Pro 1080p $0.0962/s; Seedance 2.0 $0.0804–$0.8907/s by resolution) instead of the stale per-clip table. That table quoted Kling at $0.10 per 5 s, about 3× under the real price.
Polling window raised from about 6 to about 10 minutes.
Testing
tests/tools/test_higgsfield_video.py(no network;requestsis faked). It covers:video.urldownloadimage_urltests/tools/test_provider_model_defaults.pystill passes.make test-contracts: 1515 passed, 9 skipped.pytest tests/: no new failures compared withmain. The 9 failures that remain also fail onmainin my environment (local FFmpeg build missing some encoders), and none of them touch this tool.POST /estimateendpoint.generate_audio: false. It completed in about 110 s and produced a 1080×1920, 3.04 s file with no audio stream. Cost about $0.29, matching the estimate.Checklist
make test-contracts/make test) where applicable.install_instructions; no README change needed.)🤖 Generated with Claude Code