curl --request POST \
--url https://api.recoupable.com/api/content/image \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"template": "<string>",
"prompt": "<string>",
"reference_image_url": "<string>",
"images": [
"<string>"
],
"num_images": 1,
"aspect_ratio": "auto",
"resolution": "1K",
"model": "<string>"
}
'import requests
url = "https://api.recoupable.com/api/content/image"
payload = {
"template": "<string>",
"prompt": "<string>",
"reference_image_url": "<string>",
"images": ["<string>"],
"num_images": 1,
"aspect_ratio": "auto",
"resolution": "1K",
"model": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: '<string>',
prompt: '<string>',
reference_image_url: '<string>',
images: ['<string>'],
num_images: 1,
aspect_ratio: 'auto',
resolution: '1K',
model: '<string>'
})
};
fetch('https://api.recoupable.com/api/content/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://api.recoupable.com/api/content/image",
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([
'template' => '<string>',
'prompt' => '<string>',
'reference_image_url' => '<string>',
'images' => [
'<string>'
],
'num_images' => 1,
'aspect_ratio' => 'auto',
'resolution' => '1K',
'model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.com/api/content/image"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.recoupable.com/api/content/image")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.com/api/content/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"imageUrl": "<string>",
"images": [
"<string>"
]
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Generate Image
Generate an image from a text prompt. Pass a reference_image_url to guide the output toward a specific look or subject. Returns the image URL.
curl --request POST \
--url https://api.recoupable.com/api/content/image \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"template": "<string>",
"prompt": "<string>",
"reference_image_url": "<string>",
"images": [
"<string>"
],
"num_images": 1,
"aspect_ratio": "auto",
"resolution": "1K",
"model": "<string>"
}
'import requests
url = "https://api.recoupable.com/api/content/image"
payload = {
"template": "<string>",
"prompt": "<string>",
"reference_image_url": "<string>",
"images": ["<string>"],
"num_images": 1,
"aspect_ratio": "auto",
"resolution": "1K",
"model": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template: '<string>',
prompt: '<string>',
reference_image_url: '<string>',
images: ['<string>'],
num_images: 1,
aspect_ratio: 'auto',
resolution: '1K',
model: '<string>'
})
};
fetch('https://api.recoupable.com/api/content/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://api.recoupable.com/api/content/image",
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([
'template' => '<string>',
'prompt' => '<string>',
'reference_image_url' => '<string>',
'images' => [
'<string>'
],
'num_images' => 1,
'aspect_ratio' => 'auto',
'resolution' => '1K',
'model' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.com/api/content/image"
payload := strings.NewReader("{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://api.recoupable.com/api/content/image")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.com/api/content/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template\": \"<string>\",\n \"prompt\": \"<string>\",\n \"reference_image_url\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"num_images\": 1,\n \"aspect_ratio\": \"auto\",\n \"resolution\": \"1K\",\n \"model\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"imageUrl": "<string>",
"images": [
"<string>"
]
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}Authorizations
Your Recoup API key. Learn more.
Body
Image generation parameters
Optional template ID. When provided, uses the template's image prompt, reference images, and style rules. Caller params override template defaults. Artist context overrides template style when available. See GET /api/content/templates for available options.
Optional prompt to guide image generation
URL of a reference image for conditioning the generation
Optional reference image URLs to guide generation
Number of images to generate (1-4)
1 <= x <= 4Aspect ratio of the generated image
auto, 21:9, 16:9, 3:2, 4:3, 5:4, 1:1, 4:5, 3:4, 2:3, 9:16, 4:1, 1:4, 8:1, 1:8 Output resolution
0.5K, 1K, 2K, 4K fal.ai model ID. Defaults to fal-ai/nano-banana-2
Was this page helpful?
