Skip to content

Commit e2c2bb9

Browse files
feat: gen 4 magics
1 parent ffd2a39 commit e2c2bb9

5 files changed

Lines changed: 690 additions & 9 deletions

File tree

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
"magic/image-to-3d"
27+
]
28+
},
29+
"front_image_url": {
30+
"type": "string",
31+
"format": "uri",
32+
"description": "An image (supplied via URL or Base64) that represents the front view of the object."
33+
},
34+
"left_image_url": {
35+
"type": "string",
36+
"format": "uri",
37+
"description": "An image (supplied via URL or Base64) that represents the left-side view of the object."
38+
},
39+
"back_image_url": {
40+
"type": "string",
41+
"format": "uri",
42+
"description": "An image (supplied via URL or Base64) that represents the back view of the object."
43+
},
44+
"right_image_url": {
45+
"type": "string",
46+
"format": "uri",
47+
"description": "An image (supplied via URL or Base64) that represents the right-side view of the object."
48+
}
49+
},
50+
"required": [
51+
"model",
52+
"front_image_url"
53+
],
54+
"title": "magic/image-to-3d"
55+
}
56+
}
57+
}
58+
},
59+
"responses": {
60+
"200": {
61+
"content": {
62+
"application/json": {
63+
"schema": {
64+
"type": "object",
65+
"properties": {
66+
"data": {
67+
"type": "array",
68+
"nullable": true,
69+
"items": {
70+
"type": "object",
71+
"properties": {
72+
"url": {
73+
"type": "string",
74+
"nullable": true,
75+
"description": "The URL where the file can be downloaded from.",
76+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
77+
},
78+
"b64_json": {
79+
"type": "string",
80+
"nullable": true,
81+
"description": "The base64-encoded JSON of the generated image.",
82+
"example": null
83+
}
84+
}
85+
},
86+
"description": "The list of generated images."
87+
},
88+
"meta": {
89+
"type": "object",
90+
"nullable": true,
91+
"properties": {
92+
"usage": {
93+
"type": "object",
94+
"nullable": true,
95+
"properties": {
96+
"credits_used": {
97+
"type": "number",
98+
"description": "The number of tokens consumed during generation.",
99+
"example": 120000
100+
}
101+
},
102+
"required": [
103+
"credits_used"
104+
]
105+
}
106+
},
107+
"description": "Additional details about the generation."
108+
}
109+
}
110+
}
111+
}
112+
}
113+
}
114+
},
115+
"x-hideTryItPanel": true,
116+
"x-codeSamples": [
117+
{
118+
"lang": "JavaScript",
119+
"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\": \"magic/image-to-3d\",\n \"front_image_url\": \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\"\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
120+
},
121+
{
122+
"lang": "Python",
123+
"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\": \"magic/image-to-3d\",\n \"front_image_url\": \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\"\n }\n)\n\ndata = response.json()\nprint(data)"
124+
},
125+
{
126+
"lang": "cURL",
127+
"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\": \"magic/image-to-3d\",\n \"front_image_url\": \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\"\n }'"
128+
},
129+
{
130+
"lang": "HTTP",
131+
"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\": \"magic/image-to-3d\",\n \"front_image_url\": \"https://raw.githubusercontent.com/aimlapi/api-docs/main/reference-files/t-rex.png\"\n}"
132+
}
133+
]
134+
}
135+
}
136+
},
137+
"components": {
138+
"securitySchemes": {
139+
"access-token": {
140+
"scheme": "bearer",
141+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
142+
"type": "http",
143+
"description": "Bearer key"
144+
}
145+
}
146+
}
147+
}
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
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+
"magic/image-to-video"
27+
]
28+
},
29+
"image_url": {
30+
"type": "string",
31+
"format": "uri",
32+
"description": "An image (supplied via URL or Base64) that will be inserted into the selected video template as the embedded ad content."
33+
},
34+
"template": {
35+
"type": "string",
36+
"enum": [
37+
"Thailand Street",
38+
"Times Square Billboard",
39+
"New York Times Square (77)",
40+
"Phone Social",
41+
"Art Gallery",
42+
"New York Times Square (66)",
43+
"Dubai Museum",
44+
"Digital Float",
45+
"Rotating Cards",
46+
"Desktop Reveal",
47+
"Egypt Pyramid",
48+
"Frames Drop",
49+
"Cappadocia Balloons",
50+
"Times Square Round Screen",
51+
"Stockholm Metro",
52+
"Tokyo Billboard",
53+
"San Francisco Skyscrapers",
54+
"Malaysia Shop",
55+
"Las Vegas LED",
56+
"Phone App",
57+
"Paris Eiffel Tower"
58+
],
59+
"default": "Thailand Street",
60+
"description": "Video design template."
61+
}
62+
},
63+
"required": [
64+
"model",
65+
"image_url"
66+
],
67+
"title": "magic/image-to-video"
68+
}
69+
}
70+
}
71+
},
72+
"responses": {
73+
"200": {
74+
"content": {
75+
"application/json": {
76+
"schema": {
77+
"type": "object",
78+
"properties": {
79+
"id": {
80+
"type": "string",
81+
"description": "The ID of the generated video.",
82+
"example": "60ac7c34-3224-4b14-8e7d-0aa0db708325"
83+
},
84+
"status": {
85+
"type": "string",
86+
"enum": [
87+
"queued",
88+
"generating",
89+
"completed",
90+
"error"
91+
],
92+
"description": "The current status of the generation task.",
93+
"example": "completed"
94+
},
95+
"video": {
96+
"type": "object",
97+
"nullable": true,
98+
"properties": {
99+
"url": {
100+
"type": "string",
101+
"format": "uri",
102+
"description": "The URL where the file can be downloaded from.",
103+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1759866285599-0cdfb138-c03a-49d4-a601-4f6413e27b15.mp4"
104+
}
105+
},
106+
"required": [
107+
"url"
108+
]
109+
},
110+
"error": {
111+
"type": "object",
112+
"nullable": true,
113+
"properties": {
114+
"name": {
115+
"type": "string"
116+
},
117+
"message": {
118+
"type": "string"
119+
}
120+
},
121+
"required": [
122+
"name",
123+
"message"
124+
],
125+
"description": "Description of the error, if any."
126+
},
127+
"meta": {
128+
"type": "object",
129+
"nullable": true,
130+
"properties": {
131+
"usage": {
132+
"type": "object",
133+
"nullable": true,
134+
"properties": {
135+
"credits_used": {
136+
"type": "number",
137+
"description": "The number of tokens consumed during generation.",
138+
"example": 120000
139+
}
140+
},
141+
"required": [
142+
"credits_used"
143+
]
144+
}
145+
},
146+
"description": "Additional details about the generation."
147+
}
148+
},
149+
"required": [
150+
"id",
151+
"status"
152+
]
153+
}
154+
}
155+
}
156+
}
157+
},
158+
"x-hideTryItPanel": true
159+
}
160+
}
161+
},
162+
"components": {
163+
"securitySchemes": {
164+
"access-token": {
165+
"scheme": "bearer",
166+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
167+
"type": "http",
168+
"description": "Bearer key"
169+
}
170+
}
171+
}
172+
}

0 commit comments

Comments
 (0)