Edit
curl --request POST \
--url https://api.ephone.ai/midjourney/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/boat.png",
"prompt": "make the boat bright red"
}
'import requests
url = "https://api.ephone.ai/midjourney/edit"
payload = {
"image": "https://example.com/boat.png",
"prompt": "make the boat bright red"
}
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({image: 'https://example.com/boat.png', prompt: 'make the boat bright red'})
};
fetch('https://api.ephone.ai/midjourney/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephone.ai/midjourney/edit"
payload := strings.NewReader("{\n \"image\": \"https://example.com/boat.png\",\n \"prompt\": \"make the boat bright red\"\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))
}{
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"action": "edit",
"status": "submitted",
"created_at": 1792000000
}{
"error": {
"code": "invalid_request",
"message": "index must be between 1 and 4"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient balance"
}
}{
"error": {
"code": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}Midjourney
Edit
Upload an image and describe the change in words; supports V8.2 (default) and V8.1.
POST
/
midjourney
/
edit
Edit
curl --request POST \
--url https://api.ephone.ai/midjourney/edit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"image": "https://example.com/boat.png",
"prompt": "make the boat bright red"
}
'import requests
url = "https://api.ephone.ai/midjourney/edit"
payload = {
"image": "https://example.com/boat.png",
"prompt": "make the boat bright red"
}
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({image: 'https://example.com/boat.png', prompt: 'make the boat bright red'})
};
fetch('https://api.ephone.ai/midjourney/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ephone.ai/midjourney/edit"
payload := strings.NewReader("{\n \"image\": \"https://example.com/boat.png\",\n \"prompt\": \"make the boat bright red\"\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))
}{
"task_id": "mj-6f1c2b0e9a7d4e2fb1c3d5e7f9a1b2c3",
"action": "edit",
"status": "submitted",
"created_at": 1792000000
}{
"error": {
"code": "invalid_request",
"message": "index must be between 1 and 4"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "insufficient_quota",
"message": "Insufficient balance"
}
}{
"error": {
"code": "queue_full",
"message": "Queue is full, please try again later"
}
}{
"error": {
"code": "upstream_error",
"message": "The service is temporarily unavailable, please retry"
}
}You can also submit through the unified task endpoint
POST /v1/task/submit with model set to midjourney-edit and the parameters inside input. Both behave and bill the same.notify_hook when submitting. When the task succeeds, actions in the result lists what you can do next through Image Actions.Authorizations
Send your API key in the Authorization: Bearer YOUR_API_KEY header.
Body
application/json
Image: The image to edit. An image URL (publicly reachable) or a base64 data URI, up to 20 MB each.
Prompt: The edit instruction, e.g. "make the boat red".
Maximum string length:
6000Speed: relax is cheapest but queues longer; turbo is fastest at 2x price. You can also write --relax / --fast / --turbo in the prompt; this field wins. Defaults to fast.
Available options:
relax, fast, turbo Notify hook: when the task ends, the same content as the fetch result is POSTed to this URL (a public http / https URL). Omit it to poll instead.
Was this page helpful?