DallE3ImageGeneration
curl --request POST \
--url https://openapi.monica.im/v1/image/gen/dalle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"size": "1024x1024",
"style": "vivid"
}
'import requests
url = "https://openapi.monica.im/v1/image/gen/dalle"
payload = {
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"size": "1024x1024",
"style": "vivid"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A cute baby sea otter',
model: 'dall-e-3',
n: 1,
quality: 'standard',
size: '1024x1024',
style: 'vivid'
})
};
fetch('https://openapi.monica.im/v1/image/gen/dalle', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.monica.im/v1/image/gen/dalle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A cute baby sea otter',
'model' => 'dall-e-3',
'n' => 1,
'quality' => 'standard',
'size' => '1024x1024',
'style' => 'vivid'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.monica.im/v1/image/gen/dalle"
payload := strings.NewReader("{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.monica.im/v1/image/gen/dalle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.monica.im/v1/image/gen/dalle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"url": "<string>"
}
]
}Image generation
DALL·E models
POST
/
v1
/
image
/
gen
/
dalle
DallE3ImageGeneration
curl --request POST \
--url https://openapi.monica.im/v1/image/gen/dalle \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"size": "1024x1024",
"style": "vivid"
}
'import requests
url = "https://openapi.monica.im/v1/image/gen/dalle"
payload = {
"prompt": "A cute baby sea otter",
"model": "dall-e-3",
"n": 1,
"quality": "standard",
"size": "1024x1024",
"style": "vivid"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'A cute baby sea otter',
model: 'dall-e-3',
n: 1,
quality: 'standard',
size: '1024x1024',
style: 'vivid'
})
};
fetch('https://openapi.monica.im/v1/image/gen/dalle', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openapi.monica.im/v1/image/gen/dalle",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A cute baby sea otter',
'model' => 'dall-e-3',
'n' => 1,
'quality' => 'standard',
'size' => '1024x1024',
'style' => 'vivid'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://openapi.monica.im/v1/image/gen/dalle"
payload := strings.NewReader("{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://openapi.monica.im/v1/image/gen/dalle")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://openapi.monica.im/v1/image/gen/dalle")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"A cute baby sea otter\",\n \"model\": \"dall-e-3\",\n \"n\": 1,\n \"quality\": \"standard\",\n \"size\": \"1024x1024\",\n \"style\": \"vivid\"\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"url": "<string>"
}
]
}Follow the quickstart guide to get your own API Key.
- Produces highly detailed and photorealistic images
- Excellent at capturing complex scenes and concepts
- Superior understanding of spatial relationships and composition
- DALL·E 3
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
A text description of the desired image. The maximum length is 4000 characters.
Required string length:
1 - 4000Example:
"A cute baby sea otter"
Available options:
dall-e-3 Example:
"dall-e-3"
The number of images to generate. Only n=1 is supported for dall-e-3.
Available options:
1 Example:
1
The quality of the generated images.
Available options:
standard, hd Example:
"standard"
The size of the generated images.
Available options:
1024x1024, 1024x1792, 1792x1024 Example:
"1024x1024"
The style of the generated images.
Available options:
vivid, natural Example:
"vivid"
Response
200 - application/json
Success
An array of generated image URLs.
Show child attributes
Show child attributes