kie-ruby 0.1.0 → 0.2.0

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/.claude/commands/add-model.md +155 -0
  3. data/.claude/commands/release.md +118 -0
  4. data/.claude/commands/update-model.md +177 -0
  5. data/CLAUDE.md +1 -0
  6. data/README.md +137 -2
  7. data/docs/api/INDEX.md +12 -0
  8. data/docs/api/general/INDEX.md +59 -0
  9. data/docs/api/general/flux-2-flex-image-to-image.md +257 -0
  10. data/docs/api/general/flux-2-flex-text-to-image.md +237 -0
  11. data/docs/api/general/flux-2-pro-image-to-image.md +257 -0
  12. data/docs/api/general/grok-imagine-image-to-image.md +232 -0
  13. data/docs/api/general/grok-imagine-image-to-video.md +257 -0
  14. data/docs/api/general/grok-imagine-text-to-image.md +237 -0
  15. data/docs/api/general/grok-imagine-text-to-video.md +245 -0
  16. data/docs/api/general/grok-imagine-upscale.md +217 -0
  17. data/docs/api/general/nano-banana-pro.md +275 -0
  18. data/docs/api/general/seedream-4-5-edit.md +252 -0
  19. data/docs/api/general/seedream-4-5-text-to-image.md +245 -0
  20. data/docs/api/overview.md +92 -0
  21. data/docs/api/suno/INDEX.md +44 -0
  22. data/docs/api/suno/generate.md +154 -0
  23. data/docs/api/suno/models.md +95 -0
  24. data/docs/api/suno/task-status.md +150 -0
  25. data/docs/development/INDEX.md +1 -0
  26. data/docs/development/adding-new-model.md +195 -0
  27. data/docs/development/technical-design.md +2 -8
  28. data/lib/kie/models/flux_2_flex_image_to_image.rb +16 -0
  29. data/lib/kie/models/flux_2_flex_text_to_image.rb +15 -0
  30. data/lib/kie/models/flux_2_pro_image_to_image.rb +16 -0
  31. data/lib/kie/models/grok_imagine_image_to_image.rb +15 -0
  32. data/lib/kie/models/grok_imagine_image_to_video.rb +19 -0
  33. data/lib/kie/models/grok_imagine_text_to_image.rb +14 -0
  34. data/lib/kie/models/grok_imagine_text_to_video.rb +15 -0
  35. data/lib/kie/models/grok_imagine_upscale.rb +12 -0
  36. data/lib/kie/models/seedream_4_5_edit.rb +16 -0
  37. data/lib/kie/models/seedream_4_5_text_to_image.rb +15 -0
  38. data/lib/kie/version.rb +1 -1
  39. data/lib/kie.rb +10 -0
  40. metadata +33 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dd09714cf184a6e1d88ece305cbe3a9172fd1c78654f2f51ae63cc3bf31e45a
4
- data.tar.gz: 0aca4c4baa773b8624fde53c8b07461a265da97690e7887fda4b794042f569a3
3
+ metadata.gz: 9326141b2852ca727f590ad08f9d5a68a86bf22c74e1ced750af84c061680fca
4
+ data.tar.gz: 00dd702a9e12f1df1b9673d3cc241a9ba1a222015b3028e1e97d663e2cfffdaf
5
5
  SHA512:
6
- metadata.gz: fc5f8f445fab1a86fa92b9e36d5487bc02bc7d84aa1132051216fdaf77b4b3ae4bc318d60db5e67cce8392b60de31a03cc5068731ce7711604608a3b9fce0de0
7
- data.tar.gz: ab44c6a1c1f46c6d8ddc09eda3815ba0a144c01c5c82129a14498bada390f46bde281222108d6da01ab214551b063e572ec9992bbdf7c2b9b048813c9fde7606
6
+ metadata.gz: 74eb2a06b59d1e56142f65773c0640b92e54bc00c889473f0ea89093ff22d5f2758245cb6f2e414a9ebf25cfde968ac6b077b2b9b189bf02d53772ce21990a8f
7
+ data.tar.gz: 94550ab428f669f33ce8c26e0a126623f8dd6e58aa52f2dfd80a004bcfe2827d8a00834f331fdb43d7c7025be810ccdc2a4152a7bb191269d046b69d31818d55
@@ -0,0 +1,155 @@
1
+ ---
2
+ allowed-tools: TodoWrite, TodoRead, Bash, Read, Grep, Glob, WebFetch, AskUserQuestion
3
+ description: "Create GitHub Issue for adding new model"
4
+ ---
5
+
6
+ ## Overview
7
+
8
+ Create a GitHub Issue for adding a new model to the Kie.ai Ruby Client.
9
+
10
+ ---
11
+
12
+ ## Arguments
13
+
14
+ - `$ARGUMENTS`: API documentation URL (e.g., https://kie.ai/model/seedream/4.5-edit.md)
15
+
16
+ If no URL is provided, ask the user using AskUserQuestion.
17
+
18
+ ---
19
+
20
+ ## Critical Notes
21
+
22
+ 1. **List ALL change targets without omissions** - Refer to `docs/development/adding-new-model.md` and list every required file
23
+ 2. **Always include the API documentation URL** - The URL must be included in the Issue body exactly as provided
24
+ 3. **Always reference the guide document** - Include `docs/development/adding-new-model.md` in the Issue body
25
+
26
+ ---
27
+
28
+ ## Execution Steps
29
+
30
+ ### 1. Validate Arguments
31
+
32
+ - Check if `$ARGUMENTS` contains a valid URL
33
+ - If not provided or invalid, use AskUserQuestion to ask for the API documentation URL
34
+
35
+ ### 2. Read the Adding Model Guide
36
+
37
+ - Read `docs/development/adding-new-model.md`
38
+ - Extract the checklist of all files that need to be created/modified
39
+
40
+ ### 3. Fetch API Documentation
41
+
42
+ - Use WebFetch to retrieve the API documentation from the provided URL
43
+ - Extract:
44
+ - Model name
45
+ - Category (suno, general, etc.)
46
+ - Input constraints
47
+ - Parameters
48
+ - Any other relevant specifications
49
+
50
+ ### 4. Investigate Existing Implementations
51
+
52
+ - Search for similar model implementations in `lib/kie/models/`
53
+ - Check corresponding specs in `spec/kie/models/`
54
+ - Understand the patterns used for similar model types
55
+
56
+ ### 5. Determine Implementation Approach
57
+
58
+ Based on the API documentation and existing implementations:
59
+ - Identify which category the model belongs to
60
+ - List specific files to create/modify with details
61
+ - Note any special considerations or deviations from standard patterns
62
+
63
+ ### 6. Create Issue Body
64
+
65
+ Save the issue body to `.tmp/issue-add-model-<model-name>.md`
66
+
67
+ Use the following template:
68
+
69
+ ```markdown
70
+ # Add Model: <MODEL_NAME>
71
+
72
+ ## Overview
73
+
74
+ Add support for the `<MODEL_NAME>` model to the Kie.ai Ruby Client.
75
+
76
+ ## API Documentation
77
+
78
+ - <API_DOCUMENTATION_URL>
79
+
80
+ ## Reference
81
+
82
+ - Implementation guide: `docs/development/adding-new-model.md`
83
+
84
+ ## Change Targets
85
+
86
+ ### Code Changes (Required)
87
+
88
+ | File | Action | Description |
89
+ |:-----|:-------|:------------|
90
+ | `lib/kie/models/<model_name>.rb` | Create | Model definition |
91
+ | `lib/kie.rb` | Modify | Add require statement |
92
+
93
+ ### Test Changes (Required)
94
+
95
+ | File | Action | Description |
96
+ |:-----|:-------|:------------|
97
+ | `spec/kie/models/<model_name>_spec.rb` | Create | Model spec |
98
+ | `spec/integration/model_routing_spec.rb` | Modify | Add routing test |
99
+
100
+ ### Documentation Changes (Required)
101
+
102
+ | File | Action | Description |
103
+ |:-----|:-------|:------------|
104
+ | `README.md` | Modify | Add to Supported Models table |
105
+ | `docs/api/<category>/<model>.md` | Create | API specification |
106
+ | `docs/api/<category>/INDEX.md` | Modify | Add reference |
107
+
108
+ ## Implementation Notes
109
+
110
+ <Notes about implementation approach based on investigation>
111
+
112
+ ## Model Specifications
113
+
114
+ Based on the API documentation:
115
+
116
+ - **Category**: <category>
117
+ - **Input Constraints**: <details>
118
+ - **Parameters**: <details>
119
+
120
+ ## Checklist
121
+
122
+ - [ ] Model definition file created
123
+ - [ ] require added to lib/kie.rb
124
+ - [ ] Model spec created
125
+ - [ ] Routing test updated
126
+ - [ ] README updated
127
+ - [ ] API documentation created
128
+ - [ ] API INDEX updated
129
+ - [ ] All tests pass (`bundle exec rspec`)
130
+ - [ ] Lint passes (`bundle exec rubocop`)
131
+ ```
132
+
133
+ ### 7. Create GitHub Issue
134
+
135
+ ```bash
136
+ gh issue create \
137
+ --title "Add Model: <MODEL_NAME>" \
138
+ --label "soba:todo" \
139
+ --body-file .tmp/issue-add-model-<model-name>.md
140
+ ```
141
+
142
+ ### 8. Report Result
143
+
144
+ Display the created Issue URL to the user.
145
+
146
+ ---
147
+
148
+ ## Validation
149
+
150
+ Before creating the issue, verify:
151
+
152
+ - [ ] API documentation URL is included in the issue body
153
+ - [ ] `docs/development/adding-new-model.md` is referenced
154
+ - [ ] All files from the checklist are listed as change targets
155
+ - [ ] Model specifications are extracted from the API documentation
@@ -0,0 +1,118 @@
1
+ ---
2
+ allowed-tools: TodoWrite, Bash, Read, Edit, Write, AskUserQuestion
3
+ description: "Create a PR to bump version for release"
4
+ ---
5
+
6
+ ## Overview
7
+
8
+ Create a Pull Request to bump the gem version for release.
9
+
10
+ ---
11
+
12
+ ## Arguments
13
+
14
+ - `$ARGUMENTS`: Version number (e.g., `0.2.0`, `1.0.0`)
15
+
16
+ If no version is provided, ask the user using AskUserQuestion.
17
+
18
+ ---
19
+
20
+ ## Execution Steps
21
+
22
+ ### 1. Validate Arguments
23
+
24
+ - Check if `$ARGUMENTS` contains a valid semver version (e.g., `0.2.0`)
25
+ - Do NOT include `v` prefix - just the version number
26
+ - If not provided or invalid, use AskUserQuestion to ask for the version
27
+
28
+ ### 2. Check Current State
29
+
30
+ ```bash
31
+ git status
32
+ git branch --show-current
33
+ ```
34
+
35
+ - Ensure working directory is clean
36
+ - Ensure on `main` branch
37
+
38
+ If not clean or not on main, warn the user and ask how to proceed.
39
+
40
+ ### 3. Read Current Version
41
+
42
+ - Read `lib/kie/version.rb`
43
+ - Extract current version
44
+ - Validate that new version is greater than current version
45
+
46
+ ### 4. Create Release Branch
47
+
48
+ ```bash
49
+ git checkout -b release/v<VERSION>
50
+ ```
51
+
52
+ ### 5. Update Version File
53
+
54
+ Edit `lib/kie/version.rb` to update the VERSION constant:
55
+
56
+ ```ruby
57
+ VERSION = "<NEW_VERSION>"
58
+ ```
59
+
60
+ ### 6. Update Gemfile.lock
61
+
62
+ ```bash
63
+ bundle install
64
+ ```
65
+
66
+ This updates the gem version in `Gemfile.lock` to match the new version.
67
+
68
+ ### 7. Verify the Changes
69
+
70
+ - Read `lib/kie/version.rb` to confirm the change was applied correctly
71
+ - Verify `Gemfile.lock` contains the new version
72
+
73
+ ### 8. Commit and Push
74
+
75
+ ```bash
76
+ git add lib/kie/version.rb Gemfile.lock
77
+ git commit -m "chore: bump version to <VERSION>"
78
+ git push -u origin release/v<VERSION>
79
+ ```
80
+
81
+ ### 9. Create Pull Request
82
+
83
+ ```bash
84
+ gh pr create \
85
+ --title "chore: bump version to <VERSION>" \
86
+ --body "$(cat <<'EOF'
87
+ ## Summary
88
+
89
+ - Bump version to `<VERSION>` for release
90
+
91
+ ## After Merge
92
+
93
+ 1. Go to GitHub Releases
94
+ 2. Create a new release with tag `v<VERSION>`
95
+ 3. The gem will be automatically published to RubyGems
96
+
97
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
98
+ EOF
99
+ )"
100
+ ```
101
+
102
+ ### 10. Report Result
103
+
104
+ Display:
105
+ - PR URL
106
+ - Next steps (merge PR, then create GitHub Release with tag `v<VERSION>`)
107
+
108
+ ---
109
+
110
+ ## Validation
111
+
112
+ Before creating the PR, verify:
113
+
114
+ - [ ] Version follows semver format
115
+ - [ ] New version is greater than current version
116
+ - [ ] `lib/kie/version.rb` has been updated correctly
117
+ - [ ] `Gemfile.lock` has been updated correctly
118
+ - [ ] Branch is pushed to remote
@@ -0,0 +1,177 @@
1
+ ---
2
+ allowed-tools: TodoWrite, TodoRead, Bash, Read, Grep, Glob, WebFetch, AskUserQuestion
3
+ description: "Create GitHub Issue for updating existing model"
4
+ ---
5
+
6
+ ## Overview
7
+
8
+ Create a GitHub Issue for updating an existing model in the Kie.ai Ruby Client when the API specification has changed.
9
+
10
+ ---
11
+
12
+ ## Arguments
13
+
14
+ - `$ARGUMENTS`: Model name (e.g., `nano-banana-pro`) or API documentation URL (e.g., https://kie.ai/model/seedream/4.5-edit.md)
15
+
16
+ If no argument is provided, ask the user using AskUserQuestion.
17
+
18
+ ---
19
+
20
+ ## Critical Notes
21
+
22
+ 1. **Compare current implementation with latest API documentation** - Identify all differences
23
+ 2. **List ALL change targets without omissions** - Include all files that need modification
24
+ 3. **Always include the API documentation URL** - The URL must be included in the Issue body
25
+ 4. **Preserve backward compatibility considerations** - Note any breaking changes
26
+
27
+ ---
28
+
29
+ ## Execution Steps
30
+
31
+ ### 1. Validate Arguments
32
+
33
+ - Check if `$ARGUMENTS` is provided
34
+ - If it's a URL, extract the model name from it
35
+ - If it's a model name, construct the API documentation URL or ask the user
36
+ - If not provided, use AskUserQuestion to ask for the model name or URL
37
+
38
+ ### 2. Find Existing Implementation
39
+
40
+ - Search for the model definition in `lib/kie/models/`
41
+ - Read the current model definition file
42
+ - Read the corresponding spec file in `spec/kie/models/`
43
+ - Read the API documentation in `docs/api/<category>/`
44
+ - Note all current specifications:
45
+ - Input constraints
46
+ - Parameters
47
+ - Category
48
+
49
+ ### 3. Fetch Latest API Documentation
50
+
51
+ - Use WebFetch to retrieve the latest API documentation
52
+ - Extract:
53
+ - Model name
54
+ - Category (suno, general, etc.)
55
+ - Input constraints
56
+ - Parameters
57
+ - Any other relevant specifications
58
+
59
+ ### 4. Compare and Identify Changes
60
+
61
+ Compare the current implementation with the latest API documentation:
62
+ - New parameters added
63
+ - Parameters removed
64
+ - Parameter types changed
65
+ - Input constraints changed
66
+ - Default values changed
67
+ - Any other specification changes
68
+
69
+ ### 5. Determine Update Scope
70
+
71
+ Based on the comparison:
72
+ - List all files that need to be modified
73
+ - Categorize changes as:
74
+ - **Breaking**: Changes that may affect existing users
75
+ - **Non-breaking**: Additive changes or internal improvements
76
+ - Note any migration considerations
77
+
78
+ ### 6. Create Issue Body
79
+
80
+ Save the issue body to `.tmp/issue-update-model-<model-name>.md`
81
+
82
+ Use the following template:
83
+
84
+ ```markdown
85
+ # Update Model: <MODEL_NAME>
86
+
87
+ ## Overview
88
+
89
+ Update the `<MODEL_NAME>` model implementation to match the latest API specification.
90
+
91
+ ## API Documentation
92
+
93
+ - <API_DOCUMENTATION_URL>
94
+
95
+ ## Reference
96
+
97
+ - Implementation guide: `docs/development/adding-new-model.md`
98
+
99
+ ## Current vs New Specification
100
+
101
+ ### Input Constraints
102
+
103
+ | Constraint | Current | New | Change Type |
104
+ |:-----------|:--------|:----|:------------|
105
+ | prompt.max_length | <current> | <new> | <breaking/non-breaking> |
106
+ | ... | ... | ... | ... |
107
+
108
+ ### Parameters
109
+
110
+ | Parameter | Current | New | Change Type |
111
+ |:----------|:--------|:----|:------------|
112
+ | aspect_ratio.values | <current> | <new> | <breaking/non-breaking> |
113
+ | ... | ... | ... | ... |
114
+
115
+ ## Change Targets
116
+
117
+ ### Code Changes (Required)
118
+
119
+ | File | Action | Description |
120
+ |:-----|:-------|:------------|
121
+ | `lib/kie/models/<model_name>.rb` | Modify | Update model definition |
122
+
123
+ ### Test Changes (Required)
124
+
125
+ | File | Action | Description |
126
+ |:-----|:-------|:------------|
127
+ | `spec/kie/models/<model_name>_spec.rb` | Modify | Update spec for new constraints |
128
+
129
+ ### Documentation Changes (Required)
130
+
131
+ | File | Action | Description |
132
+ |:-----|:-------|:------------|
133
+ | `docs/api/<category>/<model>.md` | Modify | Update API specification |
134
+
135
+ ## Breaking Changes
136
+
137
+ <List any breaking changes and migration notes, or "None" if no breaking changes>
138
+
139
+ ## Implementation Notes
140
+
141
+ <Notes about implementation approach>
142
+
143
+ ## Checklist
144
+
145
+ - [ ] Model definition updated (`lib/kie/models/<model_name>.rb`)
146
+ - [ ] Model spec updated (`spec/kie/models/<model_name>_spec.rb`)
147
+ - [ ] API documentation updated (`docs/api/<category>/<model>.md`)
148
+ - [ ] README updated (if needed)
149
+ - [ ] All tests pass (`bundle exec rspec`)
150
+ - [ ] Lint passes (`bundle exec rubocop`)
151
+ ```
152
+
153
+ ### 7. Create GitHub Issue
154
+
155
+ ```bash
156
+ gh issue create \
157
+ --title "Update Model: <MODEL_NAME>" \
158
+ --label "soba:todo" \
159
+ --body-file .tmp/issue-update-model-<model-name>.md
160
+ ```
161
+
162
+ ### 8. Report Result
163
+
164
+ Display the created Issue URL to the user.
165
+
166
+ ---
167
+
168
+ ## Validation
169
+
170
+ Before creating the issue, verify:
171
+
172
+ - [ ] Current implementation has been read and analyzed
173
+ - [ ] Latest API documentation has been fetched
174
+ - [ ] All differences have been identified and listed
175
+ - [ ] Breaking changes are clearly marked
176
+ - [ ] All affected files are listed as change targets
177
+ - [ ] API documentation URL is included in the issue body
data/CLAUDE.md CHANGED
@@ -17,4 +17,5 @@
17
17
 
18
18
  - Business: @docs/business/INDEX.md
19
19
  - Development: @docs/development/INDEX.md
20
+ - API: @docs/api/INDEX.md
20
21
 
data/README.md CHANGED
@@ -255,8 +255,18 @@ end
255
255
  | Model | Description |
256
256
  |:------|:------------|
257
257
  | `nano-banana-pro` | High-quality image generation |
258
-
259
- **General model parameters:**
258
+ | `seedream/4.5-edit` | AI-powered image editing |
259
+ | `seedream/4.5-text-to-image` | High-quality text-to-image generation |
260
+ | `flux-2/pro-image-to-image` | Reference-based image-to-image generation |
261
+ | `flux-2/flex-image-to-image` | Flexible reference-based image-to-image generation |
262
+ | `flux-2/flex-text-to-image` | Flexible text-to-image generation |
263
+ | `grok-imagine/image-to-video` | Image-to-video generation |
264
+ | `grok-imagine/text-to-video` | Text-to-video generation |
265
+ | `grok-imagine/image-to-image` | Image-to-image transformation |
266
+ | `grok-imagine/text-to-image` | Text-to-image generation (6 images per request) |
267
+ | `grok-imagine/upscale` | Upscale Kie AI-generated images |
268
+
269
+ **nano-banana-pro parameters:**
260
270
 
261
271
  | Parameter | Values | Default |
262
272
  |:----------|:-------|:--------|
@@ -264,6 +274,131 @@ end
264
274
  | `resolution` | `1K`, `2K`, `4K` | `1K` |
265
275
  | `output_format` | `png`, `jpg` | `png` |
266
276
 
277
+ **seedream/4.5-edit parameters:**
278
+
279
+ | Parameter | Values | Default |
280
+ |:----------|:-------|:--------|
281
+ | `aspect_ratio` | `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `2:3`, `3:2`, `21:9` | `1:1` |
282
+ | `quality` | `basic` (2K), `high` (4K) | `basic` |
283
+
284
+ **seedream/4.5-edit input:**
285
+
286
+ | Parameter | Type | Description |
287
+ |:----------|:-----|:------------|
288
+ | `prompt` | String | Edit instructions (max 3000 chars, required) |
289
+ | `image_urls` | Array | Input image URLs (required) |
290
+
291
+ **seedream/4.5-text-to-image parameters:**
292
+
293
+ | Parameter | Values | Default |
294
+ |:----------|:-------|:--------|
295
+ | `aspect_ratio` | `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `2:3`, `3:2`, `21:9` | `1:1` |
296
+ | `quality` | `basic` (2K), `high` (4K) | `basic` |
297
+
298
+ **seedream/4.5-text-to-image input:**
299
+
300
+ | Parameter | Type | Description |
301
+ |:----------|:-----|:------------|
302
+ | `prompt` | String | Image description (max 3000 chars, required) |
303
+
304
+ **flux-2/pro-image-to-image parameters:**
305
+
306
+ | Parameter | Values | Default |
307
+ |:----------|:-------|:--------|
308
+ | `aspect_ratio` | `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, `auto` | `4:3` |
309
+ | `resolution` | `1K`, `2K` | `1K` |
310
+
311
+ **flux-2/pro-image-to-image input:**
312
+
313
+ | Parameter | Type | Description |
314
+ |:----------|:-----|:------------|
315
+ | `prompt` | String | Transformation instructions (max 5000 chars, required) |
316
+ | `input_urls` | Array | Reference image URLs (1-8 images, max 10MB each, required) |
317
+
318
+ **flux-2/flex-image-to-image parameters:**
319
+
320
+ | Parameter | Values | Default |
321
+ |:----------|:-------|:--------|
322
+ | `aspect_ratio` | `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, `auto` | `1:1` |
323
+ | `resolution` | `1K`, `2K` | `1K` |
324
+
325
+ **flux-2/flex-image-to-image input:**
326
+
327
+ | Parameter | Type | Description |
328
+ |:----------|:-----|:------------|
329
+ | `prompt` | String | Transformation instructions (max 5000 chars, required) |
330
+ | `input_urls` | Array | Reference image URLs (1-8 images, max 10MB each, required) |
331
+
332
+ **flux-2/flex-text-to-image parameters:**
333
+
334
+ | Parameter | Values | Default |
335
+ |:----------|:-------|:--------|
336
+ | `aspect_ratio` | `1:1`, `4:3`, `3:4`, `16:9`, `9:16`, `3:2`, `2:3`, `auto` | `1:1` |
337
+ | `resolution` | `1K`, `2K` | `1K` |
338
+
339
+ **flux-2/flex-text-to-image input:**
340
+
341
+ | Parameter | Type | Description |
342
+ |:----------|:-----|:------------|
343
+ | `prompt` | String | Image description (max 5000 chars, required) |
344
+
345
+ **grok-imagine/image-to-video parameters:**
346
+
347
+ | Parameter | Values | Default |
348
+ |:----------|:-------|:--------|
349
+ | `mode` | `fun`, `normal`, `spicy` | `normal` |
350
+
351
+ **grok-imagine/image-to-video input:**
352
+
353
+ | Parameter | Type | Description |
354
+ |:----------|:-----|:------------|
355
+ | `prompt` | String | Motion description (max 5000 chars, optional) |
356
+ | `image_urls` | Array | Source image URL (max 1 image, max 10MB, optional) |
357
+ | `task_id` | String | Reference to prior Grok task (max 100 chars, optional) |
358
+ | `index` | Number | Image index from referenced task (0-5, optional) |
359
+
360
+ Note: `image_urls` and `task_id`+`index` are mutually exclusive input methods.
361
+
362
+ **grok-imagine/text-to-video parameters:**
363
+
364
+ | Parameter | Values | Default |
365
+ |:----------|:-------|:--------|
366
+ | `aspect_ratio` | `2:3`, `3:2`, `1:1`, `9:16`, `16:9` | `2:3` |
367
+ | `mode` | `fun`, `normal`, `spicy` | `normal` |
368
+
369
+ **grok-imagine/text-to-video input:**
370
+
371
+ | Parameter | Type | Description |
372
+ |:----------|:-----|:------------|
373
+ | `prompt` | String | Video description (max 5000 chars, required) |
374
+
375
+ **grok-imagine/image-to-image input:**
376
+
377
+ | Parameter | Type | Description |
378
+ |:----------|:-----|:------------|
379
+ | `prompt` | String | Style/content description (max 390,000 chars, optional) |
380
+ | `image_urls` | Array | Source image URL (1 image, max 10MB, required) |
381
+
382
+ **grok-imagine/text-to-image parameters:**
383
+
384
+ | Parameter | Values | Default |
385
+ |:----------|:-------|:--------|
386
+ | `aspect_ratio` | `2:3`, `3:2`, `1:1`, `9:16`, `16:9` | `3:2` |
387
+
388
+ **grok-imagine/text-to-image input:**
389
+
390
+ | Parameter | Type | Description |
391
+ |:----------|:-----|:------------|
392
+ | `prompt` | String | Image description (max 5000 chars, required) |
393
+
394
+ **grok-imagine/upscale input:**
395
+
396
+ | Parameter | Type | Description |
397
+ |:----------|:-----|:------------|
398
+ | `task_id` | String | Reference to prior Kie AI task (max 100 chars, required) |
399
+
400
+ Note: This model only works with Kie AI-generated images. External image URLs are not supported.
401
+
267
402
  ## Platform Limits
268
403
 
269
404
  | Item | Limit |
data/docs/api/INDEX.md ADDED
@@ -0,0 +1,12 @@
1
+ # API Documents
2
+
3
+ Kie.ai API のリファレンスドキュメント。
4
+
5
+ ## 概要
6
+
7
+ - `overview.md`: API 共通仕様(レスポンス形式、ステータスコード、コールバック)
8
+
9
+ ## カテゴリ別
10
+
11
+ - `suno/INDEX.md`: Suno 音楽生成 API
12
+ - `general/INDEX.md`: General API(画像生成等)
@@ -0,0 +1,59 @@
1
+ # General API
2
+
3
+ General API(画像生成等)のドキュメント。
4
+
5
+ ## ドキュメント一覧
6
+
7
+ - `nano-banana-pro.md`: Nano Banana Pro 画像生成 API
8
+ - `seedream-4-5-edit.md`: Seedream 4.5 Edit 画像編集 API
9
+ - `seedream-4-5-text-to-image.md`: Seedream 4.5 Text-to-Image 画像生成 API
10
+ - `flux-2-pro-image-to-image.md`: Flux 2 Pro Image-to-Image 画像変換 API
11
+ - `flux-2-flex-image-to-image.md`: Flux 2 Flex Image-to-Image 画像変換 API
12
+ - `flux-2-flex-text-to-image.md`: Flux 2 Flex Text-to-Image 画像生成 API
13
+ - `grok-imagine-image-to-video.md`: Grok Imagine Image-to-Video 動画生成 API
14
+ - `grok-imagine-text-to-video.md`: Grok Imagine Text-to-Video 動画生成 API
15
+ - `grok-imagine-image-to-image.md`: Grok Imagine Image-to-Image 画像変換 API
16
+ - `grok-imagine-text-to-image.md`: Grok Imagine Text-to-Image 画像生成 API
17
+ - `grok-imagine-upscale.md`: Grok Imagine Upscale 画像アップスケーリング API
18
+
19
+ ## 概要
20
+
21
+ General API は汎用的な生成タスクを提供する。現在は画像生成モデル Nano Banana Pro、画像編集モデル Seedream 4.5 Edit、テキストから画像を生成する Seedream 4.5 Text-to-Image、参照画像から画像を生成する Flux 2 Pro Image-to-Image および Flux 2 Flex Image-to-Image、テキストから画像を生成する Flux 2 Flex Text-to-Image、静止画から動画を生成する Grok Imagine Image-to-Video、テキストから動画を生成する Grok Imagine Text-to-Video、画像から画像を変換する Grok Imagine Image-to-Image、テキストから 6 枚の画像を生成する Grok Imagine Text-to-Image、Kie AI 生成画像をアップスケールする Grok Imagine Upscale に対応。
22
+
23
+ ### エンドポイント
24
+
25
+ | 操作 | エンドポイント | メソッド |
26
+ |------|---------------|---------|
27
+ | タスク作成 | `/api/v1/jobs/createTask` | POST |
28
+ | ステータス取得 | `/api/v1/jobs/queryTask` | GET |
29
+
30
+ ### Ruby クライアントでの使用例
31
+
32
+ ```ruby
33
+ client = Kie::Client.new(api_key: "your-api-key")
34
+
35
+ # 画像を生成
36
+ task = client.generate(
37
+ model: "nano-banana-pro",
38
+ input: {
39
+ prompt: "A beautiful sunset over the ocean"
40
+ },
41
+ aspect_ratio: "16:9",
42
+ resolution: "2K"
43
+ )
44
+
45
+ # 結果を取得
46
+ result = task.wait
47
+ ```
48
+
49
+ ## 今後の拡張予定
50
+
51
+ 新しいモデルが追加された場合、このディレクトリに個別のドキュメントを追加する。
52
+
53
+ 例:
54
+ - `flux-pro.md`: Flux Pro API(予定)
55
+
56
+ ## 関連ドキュメント
57
+
58
+ - [API 共通仕様](../overview.md)
59
+ - [Suno API](../suno/INDEX.md)