feat(kling): migrate to Kling API 2.0 (path-based endpoints, API Key auth) - #59
Open
Yuyyxz wants to merge 1 commit into
Open
feat(kling): migrate to Kling API 2.0 (path-based endpoints, API Key auth)#59Yuyyxz wants to merge 1 commit into
Yuyyxz wants to merge 1 commit into
Conversation
…auth)
- Auth: replace AK/SK JWT signing with Bearer API Key (KLING_API_KEY)
- Submit: POST /image-to-video/{model_id} (model in path, API 2.0 standard)
- Body: contents[]/settings{}/options{} three-layer structure
- Poll: GET /tasks?task_ids= (batch, status enum: succeeded)
- Params: translate legacy std/pro -> 720p/1080p, sound -> audio
- Catalog: vendor credential source now KLING_API_KEY
Verified against live API: request accepted, reaches business-layer
error (code 1102 balance) instead of 404/401.
Author
|
@Mike4Ellis 您好,感谢查看这个 PR。 |
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
Kling 开放平台已升级到 API 2.0 标准: 模型版本信息位于路径中, 鉴权统一为 API Key(Bearer), 请求体改为 contents/settings/options 三层结构。当前
src/models/kling.py仍使用旧版设计(AK/SK JWT 签名 +model_name参数 + 平铺请求体), 无法接入新版接口。本 PR 将 Kling adapter 迁移到 API 2.0, 使 LumenX 可以直连新版可灵接口(开放平台单 API Key 即可, 无需 AK/SK 对)。
Changes
src/models/kling.pysrc/utils/endpoints.pyconfig/model_catalog/families/kling.yamlVerification
用真实 API Key 提交图生视频请求, 返回:
{"code": 1102, "message": "Account balance not enough"}说明请求契约已被新版 API 完整接受, 只差账户余额即可真实出片。
Notes
model/mode/sound等旧参数名, adapter 内部翻译kling-3.0(路径式), 旧kling-v3映射保留在 factory 路由中