Skip to content

Add KIE.AI media provider support#2009

Open
wauputr4 wants to merge 13 commits intodiegosouzapw:mainfrom
wauputr4:feat/kie-media-provider
Open

Add KIE.AI media provider support#2009
wauputr4 wants to merge 13 commits intodiegosouzapw:mainfrom
wauputr4:feat/kie-media-provider

Conversation

@wauputr4
Copy link
Copy Markdown

@wauputr4 wauputr4 commented May 6, 2026

Closes #1529

Summary

  • Add KIE.AI as a provider across media capabilities, including image, video, music, text-to-speech, and transcription flows.
  • Add a KIE task executor plus shared task utilities for callback URL defaults, task state normalization, result JSON parsing, and async polling.
  • Wire KIE models into the dashboard media playground, provider registry, icon mapping, validation flow, and media handler tests.

Notes

  • KIE market models keep their full provider model IDs when sent to the unified jobs API.
  • Direct KIE music generation uses the direct generate/record-info polling endpoint while market jobs use jobs/recordInfo.
  • Text-to-speech normalizes OpenAI-style voice aliases to KIE/ElevenLabs voice names and falls back to a callback URL when none is supplied.

Validation

  • Ran formatter on changed KIE handler/config files.
  • Pre-commit lint and explicit-any budget checks passed on the KIE review-fix commits.
  • Manually exercised the media playground flow locally for the reported KIE media scenarios.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting /gemini review.

@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

kie: new KieExecutor(),

P1 Badge Route KIE chat traffic through DefaultExecutor

Registering kie as a specialized executor here makes all chat requests for provider kie use KieExecutor instead of DefaultExecutor; KieExecutor is initialized with https://api.kie.ai and does not override chat URL construction, so requests are sent to the API root rather than the configured chat-completions URL, which breaks KIE chat/completions calls in production for this provider.


payload = {
prompt,
image_size: mapImageSize(size, "1:1"),
num_images: body.n || 1,

P1 Badge Send direct KIE image params with correct field names

For non-market KIE image models (for example kie/gpt4o-image), this payload uses image_size and num_images, but the direct KIE generate flow in this change expects OpenAI-style size and nVariants; as a result direct image requests can ignore requested size/count or fail upstream validation, even though the market-model path works.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Author

wauputr4 commented May 6, 2026

Addressed the Codex review feedback in commit 667ce4db:

  • Removed kie from the specialized chat executor map so KIE chat/completions traffic routes through DefaultExecutor and the configured provider registry URL.
  • Kept KieExecutor available for media handlers that need task create/poll behavior.
  • Updated direct KIE image payloads to send size and nVariants, matching the direct KIE image flow and existing handler test expectations.
  • Added a regression test to guard that KIE chat routing continues to use the default executor while media can still import the KIE task executor.

Pre-commit checks passed locally: prettier, eslint, docs-sync, and explicit-any budget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Request: Support Kie.ai Media API Generator

1 participant