Skip to content

Commit b9007ef

Browse files
feat: re-gen kling o1 i2v
1 parent 83a14f4 commit b9007ef

2 files changed

Lines changed: 188 additions & 6 deletions

File tree

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
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+
"/v2/video/generations": {
14+
"post": {
15+
"operationId": "_v2_video_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/video-o1-image-to-video"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"maxLength": 2500,
32+
"description": "The text description of the scene, subject, or action to generate in the video."
33+
},
34+
"image_url": {
35+
"type": "string",
36+
"format": "uri",
37+
"description": "A direct link to an online image or a Base64-encoded local image that will serve as the visual base or the first frame for the video."
38+
},
39+
"last_image_url": {
40+
"type": "string",
41+
"format": "uri",
42+
"description": "A direct link to an online image or a Base64-encoded local image to be used as the last frame of the video."
43+
},
44+
"duration": {
45+
"type": "integer",
46+
"description": "The length of the output video in seconds.",
47+
"enum": [
48+
5,
49+
10
50+
],
51+
"default": "5"
52+
}
53+
},
54+
"required": [
55+
"model",
56+
"prompt",
57+
"image_url"
58+
],
59+
"title": "klingai/video-o1-image-to-video"
60+
}
61+
}
62+
}
63+
},
64+
"responses": {
65+
"200": {
66+
"content": {
67+
"application/json": {
68+
"schema": {
69+
"type": "object",
70+
"properties": {
71+
"id": {
72+
"type": "string",
73+
"description": "The ID of the generated video.",
74+
"example": "60ac7c34-3224-4b14-8e7d-0aa0db708325"
75+
},
76+
"status": {
77+
"type": "string",
78+
"enum": [
79+
"queued",
80+
"generating",
81+
"completed",
82+
"error"
83+
],
84+
"description": "The current status of the generation task.",
85+
"example": "completed"
86+
},
87+
"video": {
88+
"type": "object",
89+
"nullable": true,
90+
"properties": {
91+
"url": {
92+
"type": "string",
93+
"format": "uri",
94+
"description": "The URL where the file can be downloaded from.",
95+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
96+
}
97+
},
98+
"required": [
99+
"url"
100+
]
101+
},
102+
"error": {
103+
"type": "object",
104+
"nullable": true,
105+
"properties": {
106+
"name": {
107+
"type": "string"
108+
},
109+
"message": {
110+
"type": "string"
111+
}
112+
},
113+
"required": [
114+
"name",
115+
"message"
116+
],
117+
"description": "Description of the error, if any."
118+
},
119+
"meta": {
120+
"type": "object",
121+
"nullable": true,
122+
"properties": {
123+
"usage": {
124+
"type": "object",
125+
"nullable": true,
126+
"properties": {
127+
"credits_used": {
128+
"type": "number",
129+
"description": "The number of tokens consumed during generation.",
130+
"example": 120000
131+
}
132+
},
133+
"required": [
134+
"credits_used"
135+
]
136+
}
137+
},
138+
"description": "Additional details about the generation."
139+
}
140+
},
141+
"required": [
142+
"id",
143+
"status"
144+
]
145+
}
146+
}
147+
}
148+
}
149+
},
150+
"x-hideTryItPanel": true,
151+
"x-codeSamples": [
152+
{
153+
"lang": "JavaScript",
154+
"source": "async function main() {\n const response = await fetch('https://api.aimlapi.com/v2/video/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/video-o1-image-to-video\",\n \"prompt\": \"Mona Lisa puts on glasses with her hands.\",\n \"image_url\": \"https://s2-111386.kwimgs.com/bs2/mmu-aiplatform-temp/kling/20240620/1.jpeg\"\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
155+
},
156+
{
157+
"lang": "Python",
158+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v2/video/generations\",\n headers={\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n },\n json={\n \"model\": \"klingai/video-o1-image-to-video\",\n \"prompt\": \"Mona Lisa puts on glasses with her hands.\",\n \"image_url\": \"https://s2-111386.kwimgs.com/bs2/mmu-aiplatform-temp/kling/20240620/1.jpeg\"\n }\n)\n\ndata = response.json()\nprint(data)"
159+
},
160+
{
161+
"lang": "cURL",
162+
"source": "curl -L \\\n --request POST \\\n --url 'https://api.aimlapi.com/v2/video/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"model\": \"klingai/video-o1-image-to-video\",\n \"prompt\": \"Mona Lisa puts on glasses with her hands.\",\n \"image_url\": \"https://s2-111386.kwimgs.com/bs2/mmu-aiplatform-temp/kling/20240620/1.jpeg\"\n }'"
163+
},
164+
{
165+
"lang": "HTTP",
166+
"source": "POST / HTTP/1.1\nHost: test.com\nAuthorization: Bearer <YOUR_AIMLAPI_KEY>\nContent-Type: application/json\nAccept: */*\n\n{\n \"model\": \"klingai/video-o1-image-to-video\",\n \"prompt\": \"Mona Lisa puts on glasses with her hands.\",\n \"image_url\": \"https://s2-111386.kwimgs.com/bs2/mmu-aiplatform-temp/kling/20240620/1.jpeg\"\n}"
167+
}
168+
]
169+
}
170+
}
171+
},
172+
"components": {
173+
"securitySchemes": {
174+
"access-token": {
175+
"scheme": "bearer",
176+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
177+
"type": "http",
178+
"description": "Bearer key"
179+
}
180+
}
181+
}
182+
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"name": "openai/gpt-5-2-pro",
4-
"url": "https://ai.aimlapi.com/docs-json?model=openai/gpt-5-2-pro&endpoint=openai/responses",
5-
"alias": "gpt-5-2-pro-RESPONSES",
6-
"category": "text-models-llm",
7-
"vendor": "OpenAI",
8-
"codeSamples": "chat-completion"
3+
"name": "klingai/video-o1-image-to-video",
4+
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=klingai/video-o1-image-to-video",
5+
"alias": "video-o1-image-to-video",
6+
"category": "video-models",
7+
"vendor": "Kling AI",
8+
"codeSamples": "video:video"
99
}
1010
]

0 commit comments

Comments
 (0)