baldart 3.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/CHANGELOG.md +599 -0
  2. package/README.md +566 -0
  3. package/VERSION +1 -0
  4. package/bin/baldart.js +143 -0
  5. package/framework/.claude/agents/REGISTRY.md +169 -0
  6. package/framework/.claude/agents/api-perf-cost-auditor.md +291 -0
  7. package/framework/.claude/agents/code-reviewer.md +350 -0
  8. package/framework/.claude/agents/codebase-architect.md +391 -0
  9. package/framework/.claude/agents/coder.md +291 -0
  10. package/framework/.claude/agents/deep-human-insight.md +198 -0
  11. package/framework/.claude/agents/doc-reviewer.md +440 -0
  12. package/framework/.claude/agents/email-deliverability-architect.md +193 -0
  13. package/framework/.claude/agents/hybrid-ml-architect.md +285 -0
  14. package/framework/.claude/agents/hyper-gamification-designer.md +149 -0
  15. package/framework/.claude/agents/legal-counsel-gdpr.md +179 -0
  16. package/framework/.claude/agents/marketing-conversion-strategist.md +162 -0
  17. package/framework/.claude/agents/motion-expert.md +108 -0
  18. package/framework/.claude/agents/onboarding-architect-lead.md +230 -0
  19. package/framework/.claude/agents/plan-auditor.md +546 -0
  20. package/framework/.claude/agents/prd-card-writer.md +372 -0
  21. package/framework/.claude/agents/prd.md +744 -0
  22. package/framework/.claude/agents/qa-sentinel.md +305 -0
  23. package/framework/.claude/agents/remotion-animator-orchestrator.md +218 -0
  24. package/framework/.claude/agents/security-reviewer.md +276 -0
  25. package/framework/.claude/agents/senior-researcher.md +175 -0
  26. package/framework/.claude/agents/seo-analytics-strategist.md +156 -0
  27. package/framework/.claude/agents/skill-improver.md +61 -0
  28. package/framework/.claude/agents/ui-expert.md +191 -0
  29. package/framework/.claude/agents/visual-designer.md +190 -0
  30. package/framework/.claude/agents/website-orchestrator.md +118 -0
  31. package/framework/.claude/agents/wiki-curator.md +145 -0
  32. package/framework/.claude/commands/baldart-push.md +15 -0
  33. package/framework/.claude/commands/check.md +237 -0
  34. package/framework/.claude/commands/codexreview.md +203 -0
  35. package/framework/.claude/commands/design-review.md +11 -0
  36. package/framework/.claude/commands/issue-review.md +34 -0
  37. package/framework/.claude/commands/new.md +331 -0
  38. package/framework/.claude/commands/qa.md +257 -0
  39. package/framework/.claude/hooks/framework-edit-gate.js +208 -0
  40. package/framework/.claude/hooks/lint-before-commit.sh.template +66 -0
  41. package/framework/.claude/settings.local.json.example +32 -0
  42. package/framework/.claude/skills/api-design-principles/SKILL.md +567 -0
  43. package/framework/.claude/skills/api-design-principles/assets/api-design-checklist.md +155 -0
  44. package/framework/.claude/skills/api-design-principles/assets/rest-api-template.py +182 -0
  45. package/framework/.claude/skills/api-design-principles/references/graphql-schema-design.md +583 -0
  46. package/framework/.claude/skills/api-design-principles/references/rest-best-practices.md +408 -0
  47. package/framework/.claude/skills/baldart-push/SKILL.md +222 -0
  48. package/framework/.claude/skills/bug/SKILL.md +200 -0
  49. package/framework/.claude/skills/bug/references/logging-patterns.md +174 -0
  50. package/framework/.claude/skills/capture/SKILL.md +125 -0
  51. package/framework/.claude/skills/capture/references/synthesis-template.md +42 -0
  52. package/framework/.claude/skills/context-primer/SKILL.md +189 -0
  53. package/framework/.claude/skills/copywriting/SKILL.md +273 -0
  54. package/framework/.claude/skills/copywriting/references/copy-frameworks.md +338 -0
  55. package/framework/.claude/skills/copywriting/references/natural-transitions.md +252 -0
  56. package/framework/.claude/skills/doc-writing-for-rag/SKILL.md +119 -0
  57. package/framework/.claude/skills/doc-writing-for-rag/references/before-after-examples.md +291 -0
  58. package/framework/.claude/skills/doc-writing-for-rag/references/compact-templates.md +183 -0
  59. package/framework/.claude/skills/doc-writing-for-rag/references/frontmatter-minimal.md +112 -0
  60. package/framework/.claude/skills/doc-writing-for-rag/references/line-count-targets.md +110 -0
  61. package/framework/.claude/skills/doc-writing-for-rag/references/schemas-and-errors.md +129 -0
  62. package/framework/.claude/skills/find-skills/SKILL.md +133 -0
  63. package/framework/.claude/skills/frontend-design/LICENSE.txt +177 -0
  64. package/framework/.claude/skills/frontend-design/SKILL.md +84 -0
  65. package/framework/.claude/skills/gamification-design/SKILL.md +130 -0
  66. package/framework/.claude/skills/issue-review/SKILL.md +45 -0
  67. package/framework/.claude/skills/kie-ai/SKILL.md +262 -0
  68. package/framework/.claude/skills/kie-ai/references/models-catalog.md +272 -0
  69. package/framework/.claude/skills/kie-ai/scripts/kie_api.sh +209 -0
  70. package/framework/.claude/skills/kie-ai/scripts/remove_greenscreen.py +69 -0
  71. package/framework/.claude/skills/kie-ai/scripts/setup_api_key.sh +77 -0
  72. package/framework/.claude/skills/motion-design/LICENSE +21 -0
  73. package/framework/.claude/skills/motion-design/README.md +82 -0
  74. package/framework/.claude/skills/motion-design/SKILL.md +336 -0
  75. package/framework/.claude/skills/motion-design/director/choreography.md +93 -0
  76. package/framework/.claude/skills/motion-design/director/context-adaptation.md +83 -0
  77. package/framework/.claude/skills/motion-design/director/core-philosophy.md +53 -0
  78. package/framework/.claude/skills/motion-design/director/decision-framework.md +91 -0
  79. package/framework/.claude/skills/motion-design/director/disney-principles.md +102 -0
  80. package/framework/.claude/skills/motion-design/director/emotion-mapping.md +71 -0
  81. package/framework/.claude/skills/motion-design/director/motion-personality.md +89 -0
  82. package/framework/.claude/skills/motion-design/director/narrative-structure.md +62 -0
  83. package/framework/.claude/skills/motion-design/patterns/ambient-continuous.md +81 -0
  84. package/framework/.claude/skills/motion-design/patterns/entrance-exit.md +82 -0
  85. package/framework/.claude/skills/motion-design/patterns/multi-element.md +69 -0
  86. package/framework/.claude/skills/motion-design/patterns/state-feedback.md +96 -0
  87. package/framework/.claude/skills/motion-design/reference/property-selection.md +95 -0
  88. package/framework/.claude/skills/motion-design/reference/quality-checklist.md +67 -0
  89. package/framework/.claude/skills/motion-design/reference/timing-easing-tables.md +106 -0
  90. package/framework/.claude/skills/motion-design/reference/troubleshooting.md +73 -0
  91. package/framework/.claude/skills/new/SKILL.md +1687 -0
  92. package/framework/.claude/skills/playwright-skill/API_REFERENCE.md +652 -0
  93. package/framework/.claude/skills/playwright-skill/SKILL.md +157 -0
  94. package/framework/.claude/skills/playwright-skill/package.json +26 -0
  95. package/framework/.claude/skills/prd/SKILL.md +228 -0
  96. package/framework/.claude/skills/prd/assets/card-template.yml +232 -0
  97. package/framework/.claude/skills/prd/assets/epic-template.yml +190 -0
  98. package/framework/.claude/skills/prd/assets/prd-template.md +230 -0
  99. package/framework/.claude/skills/prd/assets/state-template.md +78 -0
  100. package/framework/.claude/skills/prd/references/api-perf-gate.md +152 -0
  101. package/framework/.claude/skills/prd/references/audit-phase.md +478 -0
  102. package/framework/.claude/skills/prd/references/backlog-phase.md +145 -0
  103. package/framework/.claude/skills/prd/references/discovery-phase.md +359 -0
  104. package/framework/.claude/skills/prd/references/impact-analysis.md +233 -0
  105. package/framework/.claude/skills/prd/references/prd-add-phase.md +214 -0
  106. package/framework/.claude/skills/prd/references/prd-writing-phase.md +145 -0
  107. package/framework/.claude/skills/prd/references/research-phase.md +216 -0
  108. package/framework/.claude/skills/prd/references/ui-design-phase.md +61 -0
  109. package/framework/.claude/skills/prd/references/validation-phase.md +72 -0
  110. package/framework/.claude/skills/prd-add/SKILL.md +222 -0
  111. package/framework/.claude/skills/prd-add/references/impact-analysis.md +233 -0
  112. package/framework/.claude/skills/remotion-best-practices/SKILL.md +48 -0
  113. package/framework/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
  114. package/framework/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
  115. package/framework/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  116. package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  117. package/framework/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  118. package/framework/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
  119. package/framework/.claude/skills/remotion-best-practices/rules/audio.md +169 -0
  120. package/framework/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  121. package/framework/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
  122. package/framework/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
  123. package/framework/.claude/skills/remotion-best-practices/rules/compositions.md +141 -0
  124. package/framework/.claude/skills/remotion-best-practices/rules/display-captions.md +184 -0
  125. package/framework/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  126. package/framework/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
  127. package/framework/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  128. package/framework/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  129. package/framework/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  130. package/framework/.claude/skills/remotion-best-practices/rules/gifs.md +141 -0
  131. package/framework/.claude/skills/remotion-best-practices/rules/images.md +130 -0
  132. package/framework/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
  133. package/framework/.claude/skills/remotion-best-practices/rules/light-leaks.md +73 -0
  134. package/framework/.claude/skills/remotion-best-practices/rules/lottie.md +67 -0
  135. package/framework/.claude/skills/remotion-best-practices/rules/maps.md +401 -0
  136. package/framework/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
  137. package/framework/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  138. package/framework/.claude/skills/remotion-best-practices/rules/parameters.md +98 -0
  139. package/framework/.claude/skills/remotion-best-practices/rules/sequencing.md +118 -0
  140. package/framework/.claude/skills/remotion-best-practices/rules/subtitles.md +36 -0
  141. package/framework/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
  142. package/framework/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
  143. package/framework/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
  144. package/framework/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
  145. package/framework/.claude/skills/remotion-best-practices/rules/transitions.md +197 -0
  146. package/framework/.claude/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
  147. package/framework/.claude/skills/remotion-best-practices/rules/trimming.md +52 -0
  148. package/framework/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
  149. package/framework/.claude/skills/seo-audit/SKILL.md +394 -0
  150. package/framework/.claude/skills/seo-audit/references/aeo-geo-patterns.md +279 -0
  151. package/framework/.claude/skills/seo-audit/references/ai-writing-detection.md +190 -0
  152. package/framework/.claude/skills/simplify/SKILL.md +137 -0
  153. package/framework/.claude/skills/skill-creator/LICENSE.txt +202 -0
  154. package/framework/.claude/skills/skill-creator/SKILL.md +356 -0
  155. package/framework/.claude/skills/skill-creator/references/output-patterns.md +82 -0
  156. package/framework/.claude/skills/skill-creator/references/workflows.md +28 -0
  157. package/framework/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
  158. package/framework/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
  159. package/framework/.claude/skills/skill-creator/scripts/quick_validate.py +95 -0
  160. package/framework/.claude/skills/ui-design/SKILL.md +199 -0
  161. package/framework/.claude/skills/ui-design/references/component-discovery.md +54 -0
  162. package/framework/.claude/skills/ui-design/references/evaluation.md +171 -0
  163. package/framework/.claude/skills/ui-design/references/generation.md +109 -0
  164. package/framework/.claude/skills/ui-design/references/inventory.md +59 -0
  165. package/framework/.claude/skills/webapp-testing/LICENSE.txt +202 -0
  166. package/framework/.claude/skills/webapp-testing/SKILL.md +123 -0
  167. package/framework/.claude/skills/webapp-testing/examples/console_logging.py +35 -0
  168. package/framework/.claude/skills/webapp-testing/examples/element_discovery.py +40 -0
  169. package/framework/.claude/skills/webapp-testing/examples/static_html_automation.py +33 -0
  170. package/framework/.claude/skills/webapp-testing/scripts/with_server.py +106 -0
  171. package/framework/.claude/skills/worktree-manager/SKILL.md +680 -0
  172. package/framework/AGENTS.md +240 -0
  173. package/framework/agents/api-contracts.md +137 -0
  174. package/framework/agents/architecture.md +145 -0
  175. package/framework/agents/coding-standards.md +148 -0
  176. package/framework/agents/data-model.md +110 -0
  177. package/framework/agents/deployment-protocol.md +232 -0
  178. package/framework/agents/design-review.md +172 -0
  179. package/framework/agents/env-reference.md +171 -0
  180. package/framework/agents/github-issue-subagent.md +252 -0
  181. package/framework/agents/index.md +261 -0
  182. package/framework/agents/llm-wiki-methodology.md +216 -0
  183. package/framework/agents/maintenance-protocol.md +305 -0
  184. package/framework/agents/observability.md +162 -0
  185. package/framework/agents/performance.md +155 -0
  186. package/framework/agents/project-context.md +145 -0
  187. package/framework/agents/runbook.md +208 -0
  188. package/framework/agents/security.md +168 -0
  189. package/framework/agents/skills-mapping.md +286 -0
  190. package/framework/agents/testing.md +111 -0
  191. package/framework/agents/workflows.md +215 -0
  192. package/framework/docs/PROJECT-CONFIGURATION.md +336 -0
  193. package/framework/docs/references/brand-guidelines.md +170 -0
  194. package/framework/docs/references/ui-guidelines.template.md +182 -0
  195. package/framework/routines/code-review.routine.yml +46 -0
  196. package/framework/routines/doc-review.routine.yml +45 -0
  197. package/framework/routines/ds-drift.routine.yml +52 -0
  198. package/framework/routines/full-sweep.routine.yml +51 -0
  199. package/framework/routines/index.yml +70 -0
  200. package/framework/routines/skill-improve.routine.yml +50 -0
  201. package/framework/routines/wiki-review.routine.yml +45 -0
  202. package/framework/templates/baldart.config.template.yml +113 -0
  203. package/framework/templates/breaking-change-checklist.md +484 -0
  204. package/framework/templates/feature-card.template.yml +125 -0
  205. package/framework/templates/overlays/README.md +44 -0
  206. package/framework/templates/overlays/copywriting.fidelity-example.md +62 -0
  207. package/framework/templates/overlays/ui-design.fidelity-example.md +75 -0
  208. package/framework/templates/skill-project-context.snippet.md +19 -0
  209. package/framework/templates/spec.template.md +208 -0
  210. package/package.json +51 -0
  211. package/src/commands/add.js +229 -0
  212. package/src/commands/configure.js +385 -0
  213. package/src/commands/doctor.js +486 -0
  214. package/src/commands/migrate.js +185 -0
  215. package/src/commands/push.js +0 -0
  216. package/src/commands/routines.js +269 -0
  217. package/src/commands/status.js +130 -0
  218. package/src/commands/update.js +419 -0
  219. package/src/commands/version.js +88 -0
  220. package/src/utils/contamination.js +400 -0
  221. package/src/utils/git.js +181 -0
  222. package/src/utils/hooks.js +152 -0
  223. package/src/utils/routine-adapters/claude-code-cloud.js +78 -0
  224. package/src/utils/routine-adapters/cron.js +138 -0
  225. package/src/utils/routine-adapters/github-actions.js +141 -0
  226. package/src/utils/routine-adapters/index.js +21 -0
  227. package/src/utils/routines.js +166 -0
  228. package/src/utils/state.js +143 -0
  229. package/src/utils/symlinks.js +425 -0
  230. package/src/utils/ui.js +133 -0
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: issue-review
3
+ description: Run the GitHub issue review workflow for triage and planning. Use when the user asks to review or triage a GitHub issue, requests the /issue-review slash command, or needs an issue summary with priority/plan/tests.
4
+ ---
5
+
6
+ # Issue Review
7
+
8
+ ## Overview
9
+
10
+ Run the `/issue-review` automation, capture issue context, and produce a triage + plan summary using the project's GitHub issue subagent protocol.
11
+
12
+ ## Workflow
13
+
14
+ If the user mentions `/issue-review` without a number, ask for the GitHub issue ID.
15
+
16
+ ### Phase 0 — Documentation Context
17
+
18
+ Before triaging, use `search_docs` MCP tool (if available) with `mode: "hybrid"` to find related PRDs, ADRs, and reference docs for the issue's domain. The active retrieval layer is Obsidian-first LightRAG: use Obsidian for concept context, then verify implementation/stateful claims against repo docs/code. If MCP is unavailable, fall back to targeted canonical docs plus `rg` over `${paths.references_dir}/`, `${paths.backlog_dir}/`, and `.claude/agents/`. Check `${paths.references_dir}/traceability-matrix.md` for source-to-doc mappings.
19
+
20
+ ### Phase 1 — Triage
21
+
22
+ 1. Run `npm run issue-review <number>` (optionally `--repo owner/repo`). This calls `scripts/issue-review.mjs` to fetch the issue snapshot including structured JSON data.
23
+ 2. Perform the clarity analysis in `agents/github-issue-subagent.md` (MUST for bugs per AGENTS.md).
24
+ 3. Apply the triage matrix from `agents/github-issue-subagent.md`, listing Blocker/High impacts first.
25
+
26
+ ### Phase 2 — Plan
27
+
28
+ 4. Create or update a backlog card from `templates/feature-card.template.yml`. Populate `execution_mode`, `git_strategy`, and `claimed_paths` fields.
29
+ 5. Ask the user which git strategy to use (main vs feature branch) per AGENTS.md and record it in `git_strategy`.
30
+ 6. Route to specialist agents based on issue type:
31
+ - UI/UX issues: invoke `ui-expert` agent.
32
+ - New features (label "New Feature" or implicit): invoke `prd` agent, follow `agents/index.md` pre-implementation requirements.
33
+ - Architecture decisions: invoke `codebase-architect` agent.
34
+
35
+ ### Phase 3 — Execute
36
+
37
+ 7. For new features: invoke `prd` agent for spec, synthesize plan into backlog card, invoke `coder` agent to implement.
38
+ 8. For bugs/fixes: invoke `coder` agent for complex fixes.
39
+ 9. After implementation: invoke `code-reviewer` on the changes (MUST per agents/index.md).
40
+ 10. If documentation updates are needed: invoke `doc-reviewer`.
41
+ 11. Apply `vibe review` label and add a summary comment on the GitHub issue (MUST per AGENTS.md).
42
+
43
+ ## Agent Routing
44
+
45
+ Follow `agents/index.md` for agent invocation rules and sequencing. Do not write production code yourself; orchestrate other agents and synthesize results. Run independent agents in the background where possible.
@@ -0,0 +1,262 @@
1
+ ---
2
+ name: kie-ai
3
+ description: >
4
+ Generate images, videos, and audio using Kie.ai's unified AI API platform (80+ models).
5
+ Use when: (1) generating images from text or editing images (Nano Banana 2, Imagen 4, Flux Kontext,
6
+ 4o Image, Seedream, Grok Imagine, Qwen, Ideogram, Flux-2, GPT Image 1.5, Z-Image),
7
+ (2) generating videos from text/images (Kling 3.0, Sora 2, Veo 3.1, Runway Gen-4, Wan 2.6,
8
+ Hailuo, Bytedance Seedance), (3) upscaling images/videos (Topaz, Recraft),
9
+ (4) generating music/audio (Suno V4, ElevenLabs TTS/SFX), (5) removing backgrounds,
10
+ (6) any task involving "kie", "kie.ai", "genera immagine", "genera video", "crea immagine",
11
+ "crea video", "text to image", "text to video", "image to video", or model names like
12
+ "nano banana", "imagen", "flux", "kling", "sora", "veo", "runway", "seedream", "wan",
13
+ "hailuo", "midjourney", "suno", "elevenlabs".
14
+ Triggers on: /kie, /generate-image, /generate-video, /kie-setup.
15
+ ---
16
+
17
+ # Kie.ai — AI Image, Video & Audio Generation
18
+
19
+ ## Project Context
20
+
21
+ **Reads from `baldart.config.yml`:** `paths.design_system`, `paths.ui_guidelines`, `identity.design_philosophy`, `identity.brand_name`.
22
+ **Gated by features:** `features.has_design_system` (when `true`, the design-system reads below are BLOCKING; when `false`, fall back to `paths.ui_guidelines` alone).
23
+ **Overlay:** loads `.baldart/overlays/kie-ai.md` if present — project-specific illustration character library, video-prompt motion vocabulary, and forbidden aesthetic patterns.
24
+ **On missing/empty keys:** ask the user; do not assume defaults. See `framework/agents/project-context.md` § 3.
25
+
26
+ ## Visual Contract (project-specific)
27
+
28
+ When generating images, videos, or animation prompts for product illustrations, the project's design-system SSOT is a BLOCKING prerequisite before model selection or prompt writing — but only when the project has one. Reading order:
29
+
30
+ 1. `${paths.design_system}/INDEX.md` — design-system entry point (when `features.has_design_system: true`).
31
+ 2. `${paths.design_system}/tokens-reference.md` — canonical color and shadow contract (when present).
32
+ 3. `${paths.ui_guidelines}` — brand visual language and UI constraints.
33
+ 4. `${paths.design_system}/patterns/illustration-motion.md` — canonical illustration, character, product-variant, and surgical video-prompt rules (when present; otherwise consult `.baldart/overlays/kie-ai.md`).
34
+
35
+ Every prompt should reflect `identity.design_philosophy` (e.g. "Neo-Brutalism" → bold flat shapes + hard offsets; "Minimalist" → restrained palette + breathing room). Every video prompt should use element-by-element "surgical motion" rules (what moves, what reacts, what stays fixed) rather than leaving motion to implicit model interpretation.
36
+
37
+ ## Setup (First-Time)
38
+
39
+ If no API key is configured, run setup before any generation:
40
+
41
+ ```bash
42
+ bash scripts/setup_api_key.sh
43
+ ```
44
+
45
+ Stores key securely in macOS Keychain (or `~/.config/kie-ai/config` on Linux).
46
+ Get your key at: <https://kie.ai/api-key>
47
+
48
+ Check remaining credits:
49
+
50
+ ```bash
51
+ bash scripts/kie_api.sh credits
52
+ ```
53
+
54
+ ## Quick Reference
55
+
56
+ - **Full model catalog with parameters**: Read [references/models-catalog.md](references/models-catalog.md)
57
+ - **API helper script**: `scripts/kie_api.sh` (handles auth, create, poll, download)
58
+ - **Base URL**: `https://api.kie.ai`
59
+ - **Auth**: `Authorization: Bearer <KEY>` (key retrieved automatically by scripts)
60
+ - **Docs**: <https://docs.kie.ai>
61
+
62
+ ## Limits
63
+
64
+ Max 20 requests / 10 seconds, ~100 concurrent. HTTP 429 = wait and retry.
65
+
66
+ ## How It Works
67
+
68
+ All Kie.ai APIs are **asynchronous**:
69
+ 1. **Create task** → get `taskId`
70
+ 2. **Poll status** until `success` or `fail`
71
+ 3. **Download** the generated file (URLs valid 14 days, direct downloads 20 min)
72
+
73
+ ## API Patterns
74
+
75
+ Two patterns exist (Market Unified vs Dedicated). See [models-catalog.md](references/models-catalog.md#two-api-patterns) for details. The helper script handles both — use `create-market` or `create`.
76
+
77
+ ## Generation Workflow
78
+
79
+ ### Step 1: Determine task and model
80
+
81
+ **Default model for images: `nano-banana-2`** (Nano Banana 2). Use it automatically
82
+ unless the user explicitly requests a different model. Do NOT present a model selection
83
+ menu — just proceed with nano-banana-2. Mention alternatives only if the user asks
84
+ "quale modello?" or names a specific one.
85
+
86
+ **Default model for videos: `kling-3.0/video`** (Kling 3.0).
87
+
88
+ If the user needs **maximum fidelity or complex text rendering**, suggest upgrading to
89
+ `nano-banana-pro` (Gemini 3.0 Pro, 18-24 cr) — same API pattern, just change model ID.
90
+
91
+ Alternative models (only when explicitly requested):
92
+ - **Images**: Nano Banana Pro, Imagen 4, Flux Kontext, 4o Image, Seedream, Flux-2, Grok Imagine
93
+ - **Videos**: Veo 3.1, Sora 2, Runway Gen-4 Turbo, Runway Aleph (V2V/VFX), Wan 2.6, Hailuo, Luma Modify
94
+ - **Audio**: Suno V4 (music), ElevenLabs (TTS, SFX, dialogue)
95
+ - **Upscale**: Topaz (image/video), Recraft (background removal, upscale)
96
+
97
+ For model-specific parameters, read [references/models-catalog.md](references/models-catalog.md).
98
+
99
+ ### Step 2: Collect parameters
100
+
101
+ Ask for the essential parameters only:
102
+ - **Prompt** (always required)
103
+ - **Aspect ratio** (default `1:1` if not specified)
104
+ - **Resolution** for nano-banana-2: default `2K` (good balance quality/cost at 12 credits)
105
+
106
+ For non-default models, read [references/models-catalog.md](references/models-catalog.md) for exact parameters.
107
+
108
+ Common parameters across models:
109
+ - `prompt` (always required for generation)
110
+ - `aspect_ratio` / `size` (varies per model)
111
+ - `callBackUrl` (optional, omit for polling)
112
+ - Image/video URLs for edit/I2V modes
113
+
114
+ ### Step 2.5: Transparency Check (images only — SKIP for video/audio/upscale)
115
+
116
+ **This step applies ONLY to image generation.** Skip entirely for video, audio, and upscale tasks.
117
+
118
+ **HARD GATE.** Before sending ANY image generation request, you MUST
119
+ ask the user whether they need a transparent background. Do NOT skip this step. Do NOT
120
+ assume the answer.
121
+
122
+ **Ask explicitly:**
123
+
124
+ > **Sfondo trasparente?**
125
+ > L'immagine deve avere lo sfondo trasparente (PNG con alpha)?
126
+ > - **A)** Si, sfondo trasparente
127
+ > - **B)** No, sfondo normale
128
+
129
+ **⛔ STOP.** Wait for the user's answer before proceeding.
130
+
131
+ **If the user wants transparent background:**
132
+
133
+ 1. **Modify the prompt** — append to the user's prompt:
134
+ ```
135
+ The subject MUST be placed on a perfectly uniform, solid, bright GREEN
136
+ (#00FF00) chroma-key background. The green must be flat, even, with NO
137
+ shadows, NO gradients, NO reflections on the green area. The subject
138
+ must have clean, sharp edges with NO green spill on the subject itself.
139
+ ```
140
+ 2. **Force PNG output** — set `output_format: "png"` (or equivalent per model).
141
+ 3. **Set `needs_transparency: true`** in your internal tracking for this request.
142
+
143
+ **If the user does NOT want transparent background:**
144
+ - Proceed normally. Set `needs_transparency: false`.
145
+
146
+ **Detection from context:** If the user's original request or the calling system
147
+ already mentions "transparent", "sfondo trasparente", "no background", "alpha",
148
+ "PNG with transparency", or "rimuovi sfondo" → still ask the question to confirm,
149
+ but default the recommendation to **A) Si**.
150
+
151
+ ### Output Path Convention
152
+
153
+ Save all generated files to `/tmp/kie-ai/`. Create the directory if it doesn't exist.
154
+ Naming: `<slug>-<timestamp>.<ext>` (e.g., `promo-cityscape-20260404-143022.png`).
155
+ For transparency processing: raw file as `<name>-raw-greenscreen.png`, final as `<name>.png`.
156
+
157
+ ### Step 3: Execute
158
+
159
+ Use the helper script:
160
+
161
+ ```bash
162
+ # Market models (most models)
163
+ bash scripts/kie_api.sh create-market '{
164
+ "model": "nano-banana-2",
165
+ "input": {
166
+ "prompt": "A futuristic cityscape at sunset",
167
+ "aspect_ratio": "16:9",
168
+ "resolution": "2K"
169
+ }
170
+ }'
171
+
172
+ # Dedicated models (Runway, Veo3, 4o Image, Flux Kontext)
173
+ bash scripts/kie_api.sh create "/api/v1/veo/generate" '{
174
+ "prompt": "A cat exploring a magical forest",
175
+ "model": "veo3_fast",
176
+ "aspect_ratio": "16:9"
177
+ }'
178
+ ```
179
+
180
+ ### Step 4: Poll and download
181
+
182
+ ```bash
183
+ # Market models
184
+ bash scripts/kie_api.sh poll-market "task_12345" 60 10
185
+
186
+ # Dedicated models
187
+ bash scripts/kie_api.sh poll "/api/v1/veo/record-info" "veo_task_abc" 60 10
188
+
189
+ # Download result
190
+ bash scripts/kie_api.sh download "https://tempfile..." "./output.png"
191
+ ```
192
+
193
+ ### Step 5: Post-process and present result
194
+
195
+ **If `needs_transparency` is true:**
196
+
197
+ After downloading the image, remove the green screen and produce a transparent PNG:
198
+
199
+ ```bash
200
+ python3 scripts/remove_greenscreen.py "<input_path>" "<output_path>" [--tolerance 60] [--edge-blur 1]
201
+ ```
202
+
203
+ The script:
204
+ 1. Converts green (#00FF00 region) to transparent alpha
205
+ 2. Applies edge cleanup to remove green fringe/spill
206
+ 3. Saves as PNG with alpha channel
207
+
208
+ Parameters:
209
+ - `--tolerance` (default 60): how much deviation from pure green to include (0-255).
210
+ Increase if green remnants remain, decrease if subject edges are eaten.
211
+ - `--edge-blur` (default 1): pixel radius for edge anti-aliasing. Use 0 for pixel-perfect
212
+ edges, 2-3 for softer blending.
213
+
214
+ After processing, show the user the **transparent PNG path** (not the raw green screen
215
+ version). Keep the raw version as `<name>-raw-greenscreen.png` in case the user wants
216
+ to re-process with different tolerance.
217
+
218
+ **If `needs_transparency` is false:**
219
+
220
+ Show the user the download URL or local file path. If multiple URLs, list them all.
221
+
222
+ ## Error Handling
223
+
224
+ | Code | Meaning | Action |
225
+ |------|---------|--------|
226
+ | 200 | Task created (NOT completed) | Poll for result |
227
+ | 401 | Invalid API key | Re-run setup |
228
+ | 402 | Insufficient credits | Top up at kie.ai |
229
+ | 422 | Invalid parameters | Check model docs |
230
+ | 429 | Rate limited | Wait and retry |
231
+ | 451 | Image fetch failed | Check image URL |
232
+ | 455 | Service maintenance | Wait |
233
+ | 500 | Server error | Retry |
234
+ | 501 | Generation failed | Retry with different params |
235
+
236
+ ## File Upload (when user has local files)
237
+
238
+ ```bash
239
+ # Upload local file
240
+ bash scripts/kie_api.sh upload-stream "/path/to/image.png"
241
+
242
+ # Upload from URL
243
+ bash scripts/kie_api.sh upload-url "https://example.com/image.png"
244
+ ```
245
+
246
+ Upload response contains `fileUrl` to use as input. Files expire in 3 days.
247
+
248
+ ## Pricing Reference (credits)
249
+
250
+ **Default models:**
251
+
252
+ | Model | Cost |
253
+ |-------|------|
254
+ | Nano Banana 2 (1K) | 8 cr |
255
+ | Nano Banana 2 (2K) | 12 cr |
256
+ | Nano Banana 2 (4K) | 18 cr |
257
+ | Kling 3.0 video | 20-40 cr/s |
258
+ | Recraft bg removal | 2 cr |
259
+
260
+ For other models, see [references/models-catalog.md](references/models-catalog.md).
261
+
262
+ Check credits: `bash scripts/kie_api.sh credits`
@@ -0,0 +1,272 @@
1
+ # Kie.ai Models Catalog
2
+
3
+ Complete reference of all available models, organized by category.
4
+ Base URL: `https://api.kie.ai`
5
+
6
+ ## Quick Pick (most common)
7
+
8
+ | Task | Model | ID | Credits |
9
+ |------|-------|----|---------|
10
+ | Image (default — fast + cheap) | Nano Banana 2 | `nano-banana-2` | 8-18 |
11
+ | Image (max fidelity + text) | Nano Banana Pro | `nano-banana-pro` | 18-24 |
12
+ | Video (best quality) | Kling 3.0 | `kling-3.0/video` | 20-40/s |
13
+ | Background removal | Recraft | `recraft/remove-background` | 2 |
14
+
15
+ ## Two API Patterns
16
+
17
+ ### 1. Dedicated Endpoints (Legacy models)
18
+ Specific URL per model. Used by: Runway, Veo3, 4o Image, Flux Kontext.
19
+
20
+ ### 2. Market Unified Endpoint (Newer models)
21
+ All use `POST /api/v1/jobs/createTask` with `model` field. Status: `GET /api/v1/jobs/recordInfo?taskId={id}`.
22
+
23
+ ---
24
+
25
+ ## IMAGE MODELS
26
+
27
+ ### 4o Image (GPT-4o)
28
+ - **Endpoint**: `POST /api/v1/gpt4o-image/generate`
29
+ - **Status**: `POST /api/v1/gpt4o-image/record-info` (GET with taskId query)
30
+ - **Download**: `POST /api/v1/gpt4o-image/download-url`
31
+ - **Parameters**:
32
+ | Param | Type | Required | Values |
33
+ |-------|------|----------|--------|
34
+ | prompt | string | Yes* | Max text (*at least prompt or filesUrl) |
35
+ | filesUrl | string[] | Yes* | Up to 5 image URLs |
36
+ | size | string | Yes | `1:1`, `3:2`, `2:3` |
37
+ | maskUrl | string | No | Mask URL (black=modify, white=preserve) |
38
+ | callBackUrl | string | No | Webhook URL |
39
+ | isEnhance | boolean | No | Prompt enhancement (default: false) |
40
+ | enableFallback | boolean | No | Auto-fallback (default: false) |
41
+ | fallbackModel | string | No | `GPT_IMAGE_1`, `FLUX_MAX` |
42
+
43
+ ### Flux Kontext
44
+ - **Endpoint**: `POST /api/v1/flux/kontext/generate`
45
+ - **Status**: `GET /api/v1/flux/kontext/record-info?taskId={id}`
46
+ - **Parameters**:
47
+ | Param | Type | Required | Values |
48
+ |-------|------|----------|--------|
49
+ | prompt | string | Yes | English preferred |
50
+ | inputImage | string | No | URL for edit mode |
51
+ | model | string | No | `flux-kontext-pro`, `flux-kontext-max` |
52
+ | aspectRatio | string | No | `21:9`,`16:9`,`4:3`,`1:1`,`3:4`,`9:16` |
53
+ | outputFormat | string | No | `jpeg`, `png` |
54
+ | promptUpsampling | boolean | No | Better quality, slower |
55
+ | safetyTolerance | int | No | 0-6 (gen), 0-2 (edit) |
56
+ | watermark | string | No | Watermark text |
57
+ | enableTranslation | boolean | No | Auto-translate (default: true) |
58
+
59
+ ### Nano Banana 2 (Google Gemini 3.1 Flash Image)
60
+ - **Model ID**: `nano-banana-2`
61
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
62
+ - **Parameters**:
63
+ | Param | Type | Required | Values |
64
+ |-------|------|----------|--------|
65
+ | prompt | string | Yes | Max 20,000 chars |
66
+ | image_input | string[] | No | Up to 14 images (JPEG/PNG/WebP, 30MB each) |
67
+ | google_search | boolean | No | Real-time search grounding |
68
+ | aspect_ratio | string | No | `1:1`,`1:4`,`1:8`,`2:3`,`3:2`,`3:4`,`4:1`,`4:3`,`4:5`,`5:4`,`8:1`,`9:16`,`16:9`,`21:9`,`auto` |
69
+ | resolution | string | No | `1K`,`2K`,`4K` (default: 1K) |
70
+ | output_format | string | No | `png`, `jpg` |
71
+ - **Pricing**: 8 credits (1K), 12 credits (2K), 18 credits (4K)
72
+
73
+ ### Nano Banana Pro (Google Gemini 3.0 Pro Image)
74
+
75
+ - **Model ID**: `nano-banana-pro`
76
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
77
+ - **Parameters**:
78
+ | Param | Type | Required | Values |
79
+ |-------|------|----------|--------|
80
+ | prompt | string | Yes | Max 10,000 chars |
81
+ | image_input | string[] | No | Up to 8 images (JPEG/PNG/WebP, 30MB each) |
82
+ | aspect_ratio | string | No | `1:1`,`2:3`,`3:2`,`3:4`,`4:3`,`4:5`,`5:4`,`9:16`,`16:9`,`21:9`,`auto` |
83
+ | resolution | string | No | `1K`,`2K`,`4K` (default: 1K) |
84
+ | output_format | string | No | `png`, `jpg` |
85
+ - **Pricing**: 18 credits (1K-2K), 24 credits (4K)
86
+ - **Use when**: max fidelity needed, complex text rendering, UI/label readability, deeper reasoning
87
+
88
+ ### Google Imagen 4
89
+ - **Model ID**: `google/imagen4`
90
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
91
+ - **Parameters**:
92
+ | Param | Type | Required | Values |
93
+ |-------|------|----------|--------|
94
+ | prompt | string | Yes | Max 5000 chars |
95
+ | negative_prompt | string | No | Elements to avoid |
96
+ | aspect_ratio | string | No | `1:1`,`16:9`,`9:16`,`3:4`,`4:3` |
97
+ | seed | string | No | Reproducibility |
98
+ - **Variants**: `google/imagen4-fast`, `google/imagen4-ultra`
99
+
100
+ ### Seedream Series (ByteDance)
101
+
102
+ | Version | Model ID | Notes |
103
+ |---------|----------|-------|
104
+ | v4 | `bytedance/seedream-v4-text-to-image` | Legacy naming |
105
+ | v4.5 | `seedream/4.5-text-to-image` | Current naming |
106
+ | v5.0 Lite | `seedream/5.0-lite-text-to-image` | Reasoning model, up to 6 images |
107
+ | v5.0 Lite (I2I) | `seedream/5.0-lite-image-to-image` | Edit variant |
108
+
109
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
110
+ - **Common Parameters**:
111
+ | Param | Type | Required | Values |
112
+ |-------|------|----------|--------|
113
+ | prompt | string | Yes | Max 5000 chars |
114
+ | image_size | string | No | `square`,`square_hd`,`portrait_4_3`,`portrait_3_2`,`portrait_16_9`,`landscape_4_3`,`landscape_3_2`,`landscape_16_9`,`landscape_21_9` |
115
+ | image_resolution | string | No | `1K`,`2K`,`4K` |
116
+ | max_images | number | No | 1-6 |
117
+ | seed | integer | No | Reproducibility |
118
+ - **Edit variants** also accept `image_urls` for image-to-image
119
+
120
+ ### Flux-2 Series
121
+ - **Model IDs**: `flux-2/pro-text-to-image`, `flux-2/pro-image-to-image`, `flux-2/flex-text-to-image`, `flux-2/flex-image-to-image`
122
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
123
+
124
+ ### Other Image Models
125
+ - **Grok Imagine**: `grok-imagine/text-to-image`, `grok-imagine/image-to-image`
126
+ - **GPT Image 1.5**: `gpt-image-1.5/text-to-image`, `gpt-image-1.5/image-to-image`
127
+ - **Qwen**: `qwen/text-to-image`, `qwen/image-to-image`, `qwen/image-edit`
128
+ - **Ideogram**: `ideogram/v3-reframe`, `ideogram/character`, `ideogram/character-edit`, `ideogram/character-remix`
129
+ - **Z-Image**: `z-image` (check docs)
130
+ - **Recraft**: `recraft/remove-background`, `recraft/crisp-upscale`
131
+ - **Topaz**: `topaz/image-upscale`
132
+
133
+ ---
134
+
135
+ ## VIDEO MODELS
136
+
137
+ ### Runway Gen-4 / Gen-4 Turbo
138
+
139
+ - **Endpoint**: `POST /api/v1/runway/generate`
140
+ - **Status**: `GET /api/v1/runway/record-info?taskId={id}`
141
+ - **Extend**: `POST /api/v1/runway/extend`
142
+ - **Parameters**:
143
+ | Param | Type | Required | Values |
144
+ |-------|------|----------|--------|
145
+ | prompt | string | Yes | Max 1800 chars |
146
+ | imageUrl | string | No | Reference image |
147
+ | duration | number | Yes | `5`, `10` |
148
+ | quality | string | Yes | `720p`, `1080p` (1080p only with 5s) |
149
+ | aspectRatio | string | No* | `16:9`,`4:3`,`1:1`,`3:4`,`9:16` (*required for text-to-video) |
150
+ | waterMark | string | No | Watermark text |
151
+ | callBackUrl | string | Yes | Webhook URL |
152
+ - **Pricing**: 5s 720p = 12 cr, 10s 720p / 5s 1080p = 30 cr
153
+ - **Gen-4 Turbo**: ~5x faster generation (5-8s videos in ~1 minute)
154
+
155
+ ### Runway Aleph (Video-to-Video, Relighting, VFX)
156
+
157
+ - **Endpoint**: `POST /api/v1/aleph/generate`
158
+ - **Status**: `GET /api/v1/aleph/record-info?taskId={id}`
159
+ - **Capabilities**: video-to-video, relighting, scene edits, VFX via text/image prompts
160
+
161
+ ### Veo 3.1 (Google)
162
+ - **Endpoint**: `POST /api/v1/veo/generate`
163
+ - **Status**: `GET /api/v1/veo/record-info?taskId={id}`
164
+ - **1080P**: `POST /api/v1/veo/get-1080p`
165
+ - **4K**: `POST /api/v1/veo/get-4k`
166
+ - **Parameters**:
167
+ | Param | Type | Required | Values |
168
+ |-------|------|----------|--------|
169
+ | prompt | string | Yes | Scene description |
170
+ | imageUrls | string[] | No | 1-2 images (I2V mode) |
171
+ | model | string | No | `veo3`, `veo3_fast` (default: veo3_fast) |
172
+ | generationType | string | No | `TEXT_2_VIDEO`, `FIRST_AND_LAST_FRAMES_2_VIDEO`, `REFERENCE_2_VIDEO` |
173
+ | aspect_ratio | string | No | `16:9`, `9:16`, `Auto` |
174
+ | seeds | integer | No | 10000-99999 |
175
+ | enableTranslation | boolean | No | Auto-translate (default: true) |
176
+ | watermark | string | No | Watermark text |
177
+
178
+ ### Kling 3.0
179
+ - **Model ID**: `kling-3.0/video`
180
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
181
+ - **Parameters**:
182
+ | Param | Type | Required | Values |
183
+ |-------|------|----------|--------|
184
+ | prompt | string | Yes* | Max 2500 chars (*required when multi_shots=false) |
185
+ | image_urls | string[] | No | Max 2 (start/end frame) |
186
+ | sound | boolean | Yes | Audio generation |
187
+ | duration | string | Yes | `3` to `15` seconds |
188
+ | aspect_ratio | string | Yes* | `16:9`, `9:16`, `1:1` |
189
+ | mode | string | Yes | `std` (720p), `pro` (1080p) |
190
+ | multi_shots | boolean | Yes | Multi-shot storytelling |
191
+ | multi_prompt | array | No* | [{prompt, duration}] max 5 shots (*required when multi_shots=true) |
192
+ | kling_elements | array | No | Character consistency elements |
193
+ - **Pricing**: std 20 cr/s, pro 27 cr/s (+10 cr/s with audio)
194
+
195
+ ### Sora 2 (OpenAI)
196
+ - **Model IDs**: `sora-2-text-to-video`, `sora-2-image-to-video`, `sora-2-pro-text-to-video`, `sora-2-pro-image-to-video`, `sora-2-characters`, `sora-2-characters-pro`, `sora-watermark-remover`, `sora-2-pro-storyboard`
197
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
198
+ - **Text-to-Video Parameters**:
199
+ | Param | Type | Required | Values |
200
+ |-------|------|----------|--------|
201
+ | prompt | string | Yes | Max 10,000 chars |
202
+ | aspect_ratio | string | No | `portrait`, `landscape` |
203
+ | n_frames | string | No | `10`, `15` |
204
+ | remove_watermark | boolean | No | Remove watermark |
205
+ | character_id_list | string[] | No | Max 5 character IDs |
206
+
207
+ ### Wan Series (Alibaba)
208
+ - **Model IDs**: `wan/2-6-text-to-video`, `wan/2-6-image-to-video`, `wan/2-6-video-to-video`, `wan/2-6-flash-image-to-video`, `wan/2-6-flash-video-to-video`
209
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
210
+ - **Common Parameters**:
211
+ | Param | Type | Required | Values |
212
+ |-------|------|----------|--------|
213
+ | prompt | string | Yes | 2-1500 chars |
214
+ | image_urls | string[] | Varies | Reference images |
215
+ | duration | string | No | `5`, `10`, `15` |
216
+ | resolution | string | No | `720p`, `1080p` |
217
+ | audio | boolean | Yes | Audio generation |
218
+ | multi_shots | boolean | No | Multiple shots |
219
+
220
+ ### Hailuo Series
221
+ - **Model IDs**: `hailuo/2.3-pro-image-to-video`, `hailuo/2.3-standard-image-to-video`, `hailuo/pro-text-to-video`, etc.
222
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
223
+
224
+ ### Bytedance Video (Seedance)
225
+ - **Model IDs**: `bytedance/seedance-1.5-pro`, `bytedance/v1-pro-image-to-video`, `bytedance/v1-lite-text-to-video`, etc.
226
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
227
+
228
+ ---
229
+
230
+ ## AUDIO MODELS
231
+
232
+ ### Suno V4 (Music)
233
+ - **Endpoint**: `POST /api/v1/generate/music`
234
+ - **Capabilities**: Generate, extend, cover, stems, MIDI, lyrics, music video
235
+
236
+ ### ElevenLabs
237
+ - **Model IDs**: `elevenlabs/text-to-speech-multilingual-v2`, `elevenlabs/turbo-2.5`, `elevenlabs/text-to-dialogue-v3`, `elevenlabs/speech-to-text`, `elevenlabs/sound-effect-v2`, `elevenlabs/audio-isolation`
238
+ - **Endpoint**: `POST /api/v1/jobs/createTask`
239
+
240
+ ---
241
+
242
+ ## CHAT/LLM MODELS
243
+
244
+ - `gemini/3-pro`, `gemini/2.5-flash`, `gemini/2.5-pro`
245
+ - `gpt/5-2`
246
+ - `claude/sonnet-4.5`, `claude/opus-4.5`
247
+
248
+ ---
249
+
250
+ ## COMMON ENDPOINTS
251
+
252
+ | Endpoint | Method | Purpose |
253
+ |----------|--------|---------|
254
+ | `/api/v1/chat/credit` | GET | Check remaining credits |
255
+ | `/api/v1/jobs/recordInfo?taskId={id}` | GET | Market task status |
256
+ | `/api/v1/common/download-url` | POST | Get direct download URL (20min valid) |
257
+
258
+ ### Task States (Market unified)
259
+ - `waiting` → `queuing` → `generating` → `success` / `fail`
260
+
261
+ ### Task States (Dedicated endpoints)
262
+ - `successFlag`: 0=generating, 1=success, 2=failed, 3=generation_failed
263
+
264
+ ## FILE UPLOAD
265
+
266
+ | Method | Endpoint | Best For |
267
+ |--------|----------|----------|
268
+ | Base64 | `POST https://kieai.redpandaai.co/api/file-base64-upload` | Small files ≤10MB |
269
+ | Stream | `POST https://kieai.redpandaai.co/api/file-stream-upload` | Large local files |
270
+ | URL | `POST https://kieai.redpandaai.co/api/file-url-upload` | Remote files ≤100MB |
271
+
272
+ Uploaded files expire after 3 days. Generated files expire after 14 days.