Skip to content

Commit 4e9cb03

Browse files
authored
docs: add luma/uni-1 (#276)
1 parent b416f1c commit 4e9cb03

5 files changed

Lines changed: 328 additions & 1 deletion

File tree

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@
266266
* [Nano Banana 2 Lite](api-references/image-models/Google/gemini-3.1-flash-lite-image.md)
267267
* [Kling AI](api-references/image-models/kling-ai/README.md)
268268
* [Image o1](api-references/image-models/kling-ai/image-o1.md)
269+
* [Luma AI](api-references/image-models/Luma-AI/README.md)
270+
* [Luma Uni-1](api-references/image-models/Luma-AI/uni-1.md)
269271
* [OpenAI](api-references/image-models/OpenAI/README.md)
270272
* [DALL·E 2](api-references/image-models/OpenAI/dall-e-2.md)
271273
* [DALL·E 3](api-references/image-models/OpenAI/dall-e-3.md)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Luma AI
2+
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
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+
"luma/uni-1"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"minLength": 1,
32+
"maxLength": 6000,
33+
"description": "Text description of the image to generate."
34+
},
35+
"type": {
36+
"type": "string",
37+
"enum": [
38+
"image",
39+
"image_edit"
40+
],
41+
"default": "image",
42+
"description": "Generation kind: \"image\" (text-to-image / reference) or \"image_edit\"."
43+
},
44+
"aspect_ratio": {
45+
"type": "string",
46+
"enum": [
47+
"3:1",
48+
"2:1",
49+
"16:9",
50+
"3:2",
51+
"1:1",
52+
"2:3",
53+
"9:16",
54+
"1:2",
55+
"1:3"
56+
],
57+
"description": "Output aspect ratio. Omit to let the model choose automatically."
58+
},
59+
"style": {
60+
"type": "string",
61+
"enum": [
62+
"auto",
63+
"manga"
64+
],
65+
"default": "auto",
66+
"description": "Rendering style. Defaults to \"auto\"."
67+
},
68+
"output_format": {
69+
"type": "string",
70+
"enum": [
71+
"png",
72+
"jpeg"
73+
],
74+
"description": "Output image format (png or jpeg)."
75+
},
76+
"web_search": {
77+
"type": "boolean",
78+
"default": false,
79+
"description": "Ground the generation with web search."
80+
},
81+
"image_url": {
82+
"type": "string",
83+
"format": "uri",
84+
"description": "A reference image URL for image generation, or source image URL for image editing."
85+
},
86+
"image_urls": {
87+
"type": "array",
88+
"items": {
89+
"type": "string",
90+
"format": "uri"
91+
},
92+
"maxItems": 9,
93+
"description": "Up to 9 reference image URLs (or uploaded files)."
94+
}
95+
},
96+
"required": [
97+
"model",
98+
"prompt"
99+
],
100+
"title": "luma/uni-1"
101+
}
102+
}
103+
}
104+
},
105+
"responses": {
106+
"200": {
107+
"content": {
108+
"application/json": {
109+
"schema": {
110+
"type": "object",
111+
"properties": {
112+
"data": {
113+
"type": "array",
114+
"nullable": true,
115+
"items": {
116+
"type": "object",
117+
"properties": {
118+
"url": {
119+
"type": "string",
120+
"nullable": true,
121+
"description": "The URL where the file can be downloaded from.",
122+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
123+
},
124+
"b64_json": {
125+
"type": "string",
126+
"nullable": true,
127+
"description": "The base64-encoded JSON of the generated image.",
128+
"example": null
129+
}
130+
}
131+
},
132+
"description": "The list of generated images."
133+
},
134+
"meta": {
135+
"type": "object",
136+
"nullable": true,
137+
"properties": {
138+
"usage": {
139+
"type": "object",
140+
"nullable": true,
141+
"properties": {
142+
"credits_used": {
143+
"type": "number",
144+
"description": "The number of tokens consumed during generation.",
145+
"example": 120000
146+
},
147+
"usd_spent": {
148+
"type": "number",
149+
"description": "The total amount of money spent by the user in USD.",
150+
"example": 0.06
151+
}
152+
},
153+
"required": [
154+
"credits_used",
155+
"usd_spent"
156+
]
157+
}
158+
},
159+
"description": "Additional details about the generation."
160+
}
161+
}
162+
}
163+
}
164+
},
165+
"description": "Successful response."
166+
}
167+
},
168+
"x-hideTryItPanel": true,
169+
"x-codeSamples": [
170+
{
171+
"lang": "cURL",
172+
"source": "curl --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 '{\"model\": \"luma/uni-1\", \"prompt\": \"Describe what you want the model to generate.\", \"image_url\": \"https://example.com/input.jpg\"}'"
173+
},
174+
{
175+
"lang": "JavaScript",
176+
"source": "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\": \"luma/uni-1\",\n \"prompt\": \"Describe what you want the model to generate.\",\n \"image_url\": \"https://example.com/input.jpg\"\n}),\n});\n\nconsole.log(await response.json());"
177+
},
178+
{
179+
"lang": "Python",
180+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n \"Content-Type\": \"application/json\",\n },\n json={'model': 'luma/uni-1', 'prompt': 'Describe what you want the model to generate.', 'image_url': 'https://example.com/input.jpg'},\n)\n\nprint(response.json())"
181+
}
182+
]
183+
}
184+
}
185+
},
186+
"components": {
187+
"securitySchemes": {
188+
"access-token": {
189+
"scheme": "bearer",
190+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
191+
"type": "http",
192+
"description": "Bearer key"
193+
}
194+
}
195+
}
196+
}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Luma Uni-1
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `luma/uni-1`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/luma/uni-1" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
Luma Uni-1 generates and edits images from text prompts with support for up to 9 reference images, styles, and web-search grounding.
20+
21+
{% hint style="success" %}
22+
[Create AI/ML API Key](https://aimlapi.com/app/keys)
23+
{% endhint %}
24+
25+
<details>
26+
27+
<summary>How to make the first API call</summary>
28+
29+
**1️⃣ Required setup (don’t skip this)**\
30+
**Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\
31+
**Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI.
32+
33+
**2️ Copy the code example**\
34+
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
35+
36+
**3️ Update the snippet for your use case**\
37+
**Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\
38+
**Select a model:** set the `model` field to the model you want to call.\
39+
**Provide input:** fill in the request input field(s) shown in the example.
40+
41+
**4️ (Optional) Tune the request**\
42+
See the API schema below for optional generation settings.
43+
44+
**5️ Run your code**\
45+
Run the updated code in your development environment.
46+
47+
{% hint style="success" %}
48+
For a detailed walkthrough, use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
49+
{% endhint %}
50+
51+
</details>
52+
53+
## API Schema
54+
55+
{% openapi-operation spec="uni-1" path="/v1/images/generations" method="post" %}
56+
[OpenAPI uni-1](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Luma-AI/uni-1.json)
57+
{% endopenapi-operation %}
58+
59+
## Code Example
60+
61+
{% tabs %}
62+
{% tab title="Python" %}
63+
{% code overflow="wrap" %}
64+
```python
65+
import requests
66+
67+
response = requests.post(
68+
"https://api.aimlapi.com/v1/images/generations",
69+
headers={
70+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
71+
"Content-Type": "application/json",
72+
},
73+
json={'model': 'luma/uni-1', 'prompt': 'Describe what you want the model to generate.', 'image_url': 'https://example.com/input.jpg'},
74+
)
75+
76+
print(response.json())
77+
```
78+
{% endcode %}
79+
{% endtab %}
80+
81+
{% tab title="JavaScript" %}
82+
{% code overflow="wrap" %}
83+
```javascript
84+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
85+
method: 'POST',
86+
headers: {
87+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
88+
'Content-Type': 'application/json',
89+
},
90+
body: JSON.stringify({
91+
"model": "luma/uni-1",
92+
"prompt": "Describe what you want the model to generate.",
93+
"image_url": "https://example.com/input.jpg"
94+
}),
95+
});
96+
97+
console.log(await response.json());
98+
```
99+
{% endcode %}
100+
{% endtab %}
101+
{% endtabs %}
102+
103+
<details>
104+
105+
<summary>Response</summary>
106+
107+
{% code overflow="wrap" %}
108+
```json
109+
{
110+
"data": [
111+
{
112+
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
113+
"b64_json": null
114+
}
115+
],
116+
"meta": {
117+
"usage": {
118+
"credits_used": 120000,
119+
"usd_spent": 0.06
120+
}
121+
},
122+
"model": "luma/uni-1"
123+
}
124+
```
125+
{% endcode %}
126+
127+
</details>

0 commit comments

Comments
 (0)