Get Image
curl --request GET \
--url https://easy-peasy.ai/api/get-image \
--header 'x-api-key: <api-key>'import requests
url = "https://easy-peasy.ai/api/get-image"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://easy-peasy.ai/api/get-image', 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://easy-peasy.ai/api/get-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/get-image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://easy-peasy.ai/api/get-image")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/get-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"image_url": "https://yourcdn.com/generated-image.png",
"model": "Midjourney V7",
"prompt": "A cat in a garden",
"used_credits": 2
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}Image Generation
Get Image
Retrieve an existing image by id using the same account’s API key. Useful for legacy image integrations that return a pending record. The query parameter is imageId (camelCase). The response is a single object; read image_url at the top level.
GET
/
api
/
get-image
Get Image
curl --request GET \
--url https://easy-peasy.ai/api/get-image \
--header 'x-api-key: <api-key>'import requests
url = "https://easy-peasy.ai/api/get-image"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://easy-peasy.ai/api/get-image', 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://easy-peasy.ai/api/get-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://easy-peasy.ai/api/get-image"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://easy-peasy.ai/api/get-image")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://easy-peasy.ai/api/get-image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 12345,
"image_url": "https://yourcdn.com/generated-image.png",
"model": "Midjourney V7",
"prompt": "A cat in a garden",
"used_credits": 2
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}{
"error": "Invalid API key"
}Use this endpoint when Generate Image returns an image record whose
The response is a single object. Read
image_url is empty, or to retrieve an existing image. Pass its id as the camelCase query parameter imageId.
curl --fail-with-body 'https://easy-peasy.ai/api/get-image?imageId=12345' \
-H 'x-api-key: YOUR_API_KEY'
image_url at the top level. Use the same account’s API key that created the image.
For pending images, poll every 15–30 seconds with a bounded timeout. Stop on HTTP errors and retain the ID on timeout. This endpoint has no normalized job status field, so an empty URL alone cannot distinguish processing from a failed generation. Do not automatically submit another paid generation when polling stops.Authorizations
API key for authentication. Get yours at https://easy-peasy.ai/settings/api
Query Parameters
The id from a Generate Image response.
Was this page helpful?
