Skip to content

Commit a92e72c

Browse files
feat: gen openai/gpt-image-1-mini
1 parent a7e3a69 commit a92e72c

2 files changed

Lines changed: 211 additions & 12 deletions

File tree

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
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+
"openai/gpt-image-1-mini"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"maxLength": 32000,
32+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
33+
},
34+
"background": {
35+
"type": "string",
36+
"enum": [
37+
"transparent",
38+
"opaque",
39+
"auto"
40+
],
41+
"default": "auto",
42+
"description": "Allows to set transparency for the background of the generated image(s). When auto is used, the model will automatically determine the best background for the image.\nIf transparent, the output format needs to support transparency, so it should be set to either png (default value) or webp."
43+
},
44+
"moderation": {
45+
"type": "string",
46+
"enum": [
47+
"low",
48+
"auto"
49+
],
50+
"default": "auto",
51+
"description": "Control the content-moderation level for images."
52+
},
53+
"n": {
54+
"type": "number",
55+
"enum": [
56+
1
57+
],
58+
"default": 1,
59+
"description": "The number of images to generate."
60+
},
61+
"output_compression": {
62+
"type": "integer",
63+
"minimum": 0,
64+
"maximum": 100,
65+
"default": 100,
66+
"description": "The compression level (0-100%) for the generated images."
67+
},
68+
"output_format": {
69+
"type": "string",
70+
"enum": [
71+
"png",
72+
"jpeg",
73+
"webp"
74+
],
75+
"default": "png",
76+
"description": "The format of the generated image."
77+
},
78+
"quality": {
79+
"type": "string",
80+
"enum": [
81+
"low",
82+
"high",
83+
"medium"
84+
],
85+
"default": "medium",
86+
"description": "The quality of the image that will be generated."
87+
},
88+
"size": {
89+
"type": "string",
90+
"enum": [
91+
"1024x1024",
92+
"1024x1536",
93+
"1536x1024"
94+
],
95+
"default": "1024x1024",
96+
"description": "The size of the generated image."
97+
},
98+
"response_format": {
99+
"type": "string",
100+
"enum": [
101+
"url",
102+
"b64_json"
103+
],
104+
"default": "url",
105+
"description": "The format in which the generated images are returned."
106+
}
107+
},
108+
"required": [
109+
"model",
110+
"prompt"
111+
],
112+
"title": "openai/gpt-image-1-mini"
113+
}
114+
}
115+
}
116+
},
117+
"responses": {
118+
"200": {
119+
"content": {
120+
"application/json": {
121+
"schema": {
122+
"type": "object",
123+
"properties": {
124+
"data": {
125+
"type": "array",
126+
"nullable": true,
127+
"items": {
128+
"type": "object",
129+
"properties": {
130+
"url": {
131+
"type": "string",
132+
"nullable": true,
133+
"description": "The URL where the file can be downloaded from.",
134+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
135+
},
136+
"b64_json": {
137+
"type": "string",
138+
"nullable": true,
139+
"description": "The base64-encoded JSON of the generated image.",
140+
"example": null
141+
}
142+
}
143+
},
144+
"description": "The list of generated images."
145+
},
146+
"meta": {
147+
"type": "object",
148+
"nullable": true,
149+
"properties": {
150+
"usage": {
151+
"type": "object",
152+
"nullable": true,
153+
"properties": {
154+
"credits_used": {
155+
"type": "number",
156+
"description": "The number of tokens consumed during generation.",
157+
"example": 120000
158+
}
159+
},
160+
"required": [
161+
"credits_used"
162+
]
163+
}
164+
},
165+
"description": "Additional details about the generation."
166+
}
167+
}
168+
}
169+
}
170+
}
171+
}
172+
},
173+
"x-hideTryItPanel": true,
174+
"x-codeSamples": [
175+
{
176+
"lang": "JavaScript",
177+
"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: 'openai/gpt-image-1-mini',\n prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',\n }),\n });\n\n const data = await response.json();\n console.log(JSON.stringify(data, null, 2));\n}\n\nmain();"
178+
},
179+
{
180+
"lang": "Python",
181+
"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\":\"openai/gpt-image-1-mini\",\n \"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }\n)\n\ndata = response.json()\nprint(data)"
182+
},
183+
{
184+
"lang": "cURL",
185+
"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\": \"openai/gpt-image-1-mini\",\n \"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n }'"
186+
},
187+
{
188+
"lang": "HTTP",
189+
"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\": \"openai/gpt-image-1-mini\",\n \"prompt\": \"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.\"\n}"
190+
}
191+
]
192+
}
193+
}
194+
},
195+
"components": {
196+
"securitySchemes": {
197+
"access-token": {
198+
"scheme": "bearer",
199+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
200+
"type": "http",
201+
"description": "Bearer key"
202+
}
203+
}
204+
}
205+
}
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
[
22
{
3-
"name": "klingai/video-v2-6-pro-motion-control",
4-
"url": "https://ai.aimlapi.com/docs-json?endpoint=internal/video-generations/submit&model=klingai/video-v2-6-pro-motion-control",
5-
"alias": "video-v2-6-pro-motion-control",
6-
"category": "video-models",
7-
"vendor": "Kling AI",
8-
"codeSamples": "custom",
9-
"customUrlApi": "https://api.aimlapi.com/v2/video/generations",
10-
"customParams":{
11-
"model": "klingai/video-v2-6-pro-motion-control",
12-
"image_url": "https://cdn.aimlapi.com/flamingo/files/b/0a875302/8NaxQrQxDNHppHtqcchMm.png",
13-
"video_url": "https://cdn.aimlapi.com/flamingo/files/b/0a8752bc/2xrNS217ngQ3wzXqA7LXr_output.mp4"
14-
}
3+
"name": "openai/gpt-image-1-mini",
4+
"url": "https://ai.aimlapi.com/docs-json?endpoint=openai/image-generations&model=openai/gpt-image-1-mini",
5+
"alias": "gpt-image-1-mini",
6+
"category": "image-models",
7+
"vendor": "OpenAI",
8+
"codeSamples": "image-models:prompt"
159
}
1610
]

0 commit comments

Comments
 (0)