Skip to content

Commit 5d78a56

Browse files
feat: gen klingai/image-o1
1 parent 6c3709e commit 5d78a56

2 files changed

Lines changed: 190 additions & 102 deletions

File tree

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/v1/images/generations": {
14+
"post": {
15+
"operationId": "_v1_images_generations",
16+
"requestBody": {
17+
"required": true,
18+
"content": {
19+
"application/json": {
20+
"schema": {
21+
"type": "object",
22+
"properties": {
23+
"model": {
24+
"type": "string",
25+
"enum": [
26+
"klingai/image-o1"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"maxLength": 4000,
32+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
33+
},
34+
"image_urls": {
35+
"type": "array",
36+
"items": {
37+
"type": "string",
38+
"format": "uri"
39+
},
40+
"minItems": 1,
41+
"maxItems": 10,
42+
"description": "List of URLs or local Base64 encoded images to edit."
43+
},
44+
"aspect_ratio": {
45+
"type": "string",
46+
"enum": [
47+
"21:9",
48+
"16:9",
49+
"4:3",
50+
"3:2",
51+
"1:1",
52+
"2:3",
53+
"3:4",
54+
"9:16"
55+
],
56+
"default": "16:9",
57+
"description": "The aspect ratio of the generated image."
58+
},
59+
"resolution": {
60+
"type": "string",
61+
"enum": [
62+
"1K",
63+
"2K"
64+
],
65+
"default": "1K",
66+
"description": "The resolution of the output image."
67+
},
68+
"output_format": {
69+
"type": "string",
70+
"enum": [
71+
"jpeg",
72+
"png",
73+
"webp"
74+
],
75+
"default": "png",
76+
"description": "The format of the generated image."
77+
},
78+
"num_images": {
79+
"type": "number",
80+
"minimum": 1,
81+
"maximum": 9,
82+
"default": 1,
83+
"description": "The number of images to generate."
84+
}
85+
},
86+
"required": [
87+
"model",
88+
"prompt",
89+
"image_urls"
90+
],
91+
"title": "klingai/image-o1"
92+
}
93+
}
94+
}
95+
},
96+
"responses": {
97+
"200": {
98+
"content": {
99+
"application/json": {
100+
"schema": {
101+
"type": "object",
102+
"properties": {
103+
"data": {
104+
"type": "array",
105+
"nullable": true,
106+
"items": {
107+
"type": "object",
108+
"properties": {
109+
"url": {
110+
"type": "string",
111+
"nullable": true,
112+
"description": "The URL where the file can be downloaded from.",
113+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
114+
},
115+
"b64_json": {
116+
"type": "string",
117+
"nullable": true,
118+
"description": "The base64-encoded JSON of the generated image.",
119+
"example": null
120+
}
121+
}
122+
},
123+
"description": "The list of generated images."
124+
},
125+
"meta": {
126+
"type": "object",
127+
"nullable": true,
128+
"properties": {
129+
"usage": {
130+
"type": "object",
131+
"nullable": true,
132+
"properties": {
133+
"credits_used": {
134+
"type": "number",
135+
"description": "The number of tokens consumed during generation.",
136+
"example": 120000
137+
}
138+
},
139+
"required": [
140+
"credits_used"
141+
]
142+
}
143+
},
144+
"description": "Additional details about the generation."
145+
}
146+
}
147+
}
148+
}
149+
}
150+
}
151+
},
152+
"x-hideTryItPanel": true,
153+
"x-codeSamples": [
154+
{
155+
"lang": "JavaScript",
156+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"klingai/image-o1\",\n \"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n \"image_urls\": [\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
157+
},
158+
{
159+
"lang": "Python",
160+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Content-Type\":\"application/json\", \n \"Authorization\":\"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\": \"klingai/image-o1\",\n \"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n \"image_urls\": [\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n }\n)\n\ndata = response.json()\nprint(data)"
161+
},
162+
{
163+
"lang": "cURL",
164+
"source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"klingai/image-o1\",\n \"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n \"image_urls\": [\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n }'"
165+
},
166+
{
167+
"lang": "HTTP",
168+
"source": "POST /v1/images/generations HTTP/1.1\nHost: api.aimlapi.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"klingai/image-o1\",\n \"prompt\": \"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect.\",\n \"image_urls\": [\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\",\n \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/blue-mug.jpg\"\n ]\n}"
169+
}
170+
]
171+
}
172+
}
173+
},
174+
"components": {
175+
"securitySchemes": {
176+
"access-token": {
177+
"scheme": "bearer",
178+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
179+
"type": "http",
180+
"description": "Bearer key"
181+
}
182+
}
183+
}
184+
}
Lines changed: 6 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,10 @@
11
[
22
{
3-
"name": "alibaba/wan2.1-t2v-plus",
4-
"alias": "wan2.1-t2v-plus",
5-
"category": "video-models",
6-
"vendor": "Alibaba Cloud",
7-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.1-t2v-plus",
8-
"codeSamples": "video:video"
9-
},
10-
{
11-
"name": "alibaba/wan2.1-t2v-turbo",
12-
"alias": "wan2.1-t2v-turbo",
13-
"category": "video-models",
14-
"vendor": "Alibaba Cloud",
15-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.1-t2v-turbo",
16-
"codeSamples": "video:video"
17-
},
18-
{
19-
"name": "alibaba/wan2.2-t2v-plus",
20-
"alias": "wan2.2-t2v-plus",
21-
"category": "video-models",
22-
"vendor": "Alibaba Cloud",
23-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-t2v-plus",
24-
"codeSamples": "video:video"
25-
},
26-
{
27-
"name": "alibaba/wan2.2-i2v-plus",
28-
"alias": "wan2.2-i2v-plus",
29-
"category": "video-models",
30-
"vendor": "Alibaba Cloud",
31-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-i2v-plus",
32-
"codeSamples": "video:video"
33-
},
34-
{
35-
"name": "alibaba/wan2.2-14b-animate-replace",
36-
"alias": "wan2.2-14b-animate-replace",
37-
"category": "video-models",
38-
"vendor": "Alibaba Cloud",
39-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-14b-animate-replace",
40-
"codeSamples": "video:video"
41-
},
42-
{
43-
"name": "alibaba/wan2.2-14b-animate-move",
44-
"alias": "wan2.2-14b-animate-move",
45-
"category": "video-models",
46-
"vendor": "Alibaba Cloud",
47-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-14b-animate-move",
48-
"codeSamples": "video:video"
49-
},
50-
{
51-
"name": "alibaba/wan2.2-vace-fun-a14b-reframe",
52-
"alias": "wan2.2-vace-fun-a14b-reframe",
53-
"category": "video-models",
54-
"vendor": "Alibaba Cloud",
55-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-vace-fun-a14b-reframe",
56-
"codeSamples": "video:video"
57-
},
58-
{
59-
"name": "alibaba/wan2.2-vace-fun-a14b-outpainting",
60-
"alias": "wan2.2-vace-fun-a14b-outpainting",
61-
"category": "video-models",
62-
"vendor": "Alibaba Cloud",
63-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-vace-fun-a14b-outpainting",
64-
"codeSamples": "video:video"
65-
},
66-
{
67-
"name": "alibaba/wan2.2-vace-fun-a14b-inpainting",
68-
"alias": "wan2.2-vace-fun-a14b-inpainting",
69-
"category": "video-models",
70-
"vendor": "Alibaba Cloud",
71-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-vace-fun-a14b-inpainting",
72-
"codeSamples": "video:video"
73-
},
74-
{
75-
"name": "alibaba/wan2.2-vace-fun-a14b-pose",
76-
"alias": "wan2.2-vace-fun-a14b-pose",
77-
"category": "video-models",
78-
"vendor": "Alibaba Cloud",
79-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-vace-fun-a14b-pose",
80-
"codeSamples": "video:video"
81-
},
82-
{
83-
"name": "alibaba/wan2.2-vace-fun-a14b-depth",
84-
"alias": "wan2.2-i2v-plus",
85-
"category": "video-models",
86-
"vendor": "Alibaba Cloud",
87-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.2-vace-fun-a14b-depth",
88-
"codeSamples": "video:video"
89-
},
90-
{
91-
"name": "alibaba/wan2.5-t2v-preview",
92-
"alias": "wan2.5-t2v-preview",
93-
"category": "video-models",
94-
"vendor": "Alibaba Cloud",
95-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.5-t2v-preview",
96-
"codeSamples": "video:lipsync"
97-
},
98-
{
99-
"name": "alibaba/wan2.5-i2v-preview",
100-
"alias": "wan2.5-i2v-preview",
101-
"category": "video-models",
102-
"vendor": "Alibaba Cloud",
103-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=alibaba/wan2.5-i2v-preview",
104-
"codeSamples": "video:video"
3+
"name": "klingai/image-o1",
4+
"url": "https://ai.aimlapi.com/docs-json?endpoint=openai/image-generations&model=klingai/image-o1",
5+
"alias": "image-o1",
6+
"category": "image-models",
7+
"vendor": "Kling AI",
8+
"codeSamples": "image-models:image_url(s)"
1059
}
10610
]

0 commit comments

Comments
 (0)