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+ " tencent/hunyuan-part"
27+ ]
28+ },
29+ "mesh_url" : {
30+ "type" : " string" ,
31+ "format" : " uri" ,
32+ "description" : " URL of the 3D model file (.glb or .obj) to process for segmentation."
33+ },
34+ "point_prompt_x" : {
35+ "type" : " number" ,
36+ "minimum" : -1 ,
37+ "maximum" : 1 ,
38+ "description" : " X coordinate of the point prompt for segmentation."
39+ },
40+ "point_prompt_y" : {
41+ "type" : " number" ,
42+ "minimum" : -1 ,
43+ "maximum" : 1 ,
44+ "description" : " Y coordinate of the point prompt for segmentation."
45+ },
46+ "point_prompt_z" : {
47+ "type" : " number" ,
48+ "minimum" : -1 ,
49+ "maximum" : 1 ,
50+ "description" : " Z coordinate of the point prompt for segmentation."
51+ },
52+ "point_num" : {
53+ "type" : " integer" ,
54+ "default" : 100000 ,
55+ "description" : " Number of points to sample from the mesh."
56+ },
57+ "use_normal" : {
58+ "type" : " boolean" ,
59+ "default" : true ,
60+ "description" : " Whether to use normal information for segmentation."
61+ },
62+ "noise_std" : {
63+ "type" : " number" ,
64+ "description" : " Standard deviation of noise to add to sampled points."
65+ },
66+ "seed" : {
67+ "type" : " integer" ,
68+ "minimum" : 1 ,
69+ "description" : " The same seed and the same prompt given to the same version of the model will output the same image every time."
70+ }
71+ },
72+ "required" : [
73+ " model" ,
74+ " mesh_url"
75+ ],
76+ "title" : " tencent/hunyuan-part"
77+ }
78+ }
79+ }
80+ },
81+ "responses" : {
82+ "200" : {
83+ "content" : {
84+ "application/json" : {
85+ "schema" : {
86+ "type" : " object" ,
87+ "properties" : {
88+ "data" : {
89+ "type" : " array" ,
90+ "nullable" : true ,
91+ "items" : {
92+ "type" : " object" ,
93+ "properties" : {
94+ "url" : {
95+ "type" : " string" ,
96+ "nullable" : true ,
97+ "description" : " The URL where the file can be downloaded from." ,
98+ "example" : " https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
99+ },
100+ "b64_json" : {
101+ "type" : " string" ,
102+ "nullable" : true ,
103+ "description" : " The base64-encoded JSON of the generated image." ,
104+ "example" : null
105+ }
106+ }
107+ },
108+ "description" : " The list of generated images."
109+ },
110+ "meta" : {
111+ "type" : " object" ,
112+ "nullable" : true ,
113+ "properties" : {
114+ "usage" : {
115+ "type" : " object" ,
116+ "nullable" : true ,
117+ "properties" : {
118+ "credits_used" : {
119+ "type" : " number" ,
120+ "description" : " The number of tokens consumed during generation." ,
121+ "example" : 120000
122+ }
123+ },
124+ "required" : [
125+ " credits_used"
126+ ]
127+ }
128+ },
129+ "description" : " Additional details about the generation."
130+ }
131+ }
132+ }
133+ }
134+ }
135+ }
136+ },
137+ "x-hideTryItPanel" : true ,
138+ "x-codeSamples" : [
139+ {
140+ "lang" : " JavaScript" ,
141+ "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\" : \" tencent/hunyuan-part\" ,\n \" mesh_url\" : \" https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb\"\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n }\n\n main();"
142+ },
143+ {
144+ "lang" : " Python" ,
145+ "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\" : \" tencent/hunyuan-part\" ,\n \" mesh_url\" : \" https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb\"\n }\n )\n\n data = response.json()\n print(data)"
146+ },
147+ {
148+ "lang" : " cURL" ,
149+ "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\" : \" tencent/hunyuan-part\" ,\n \" mesh_url\" : \" https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb\"\n }'"
150+ },
151+ {
152+ "lang" : " HTTP" ,
153+ "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\" : \" tencent/hunyuan-part\" ,\n \" mesh_url\" : \" https://storage.googleapis.com/falserverless/model_tests/video_models/base_basic_shaded.glb\"\n }"
154+ }
155+ ]
156+ }
157+ }
158+ },
159+ "components" : {
160+ "securitySchemes" : {
161+ "access-token" : {
162+ "scheme" : " bearer" ,
163+ "bearerFormat" : " <YOUR_AIMLAPI_KEY>" ,
164+ "type" : " http" ,
165+ "description" : " Bearer key"
166+ }
167+ }
168+ }
169+ }
0 commit comments