You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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}"
0 commit comments