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\n main();"
120+ },
121+ {
122+ "lang" : " Python" ,
123+ "source" : " import requests\n\n response = 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\n data = response.json()\n print(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\n Host: api.aimlapi.com\n Authorization: Bearer <YOUR_AIMLAPI_KEY>\n Content-Type: application/json\n Accept: */*\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+ }
0 commit comments