curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"raw_prompt": "oak table photo"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt"
payload = { "raw_prompt": "oak table photo" }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({raw_prompt: 'oak table photo'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt', 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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt",
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([
'raw_prompt' => 'oak table photo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt"
payload := strings.NewReader("{\n \"raw_prompt\": \"oak table photo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_prompt\": \"oak table photo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_prompt\": \"oak table photo\"\n}"
response = http.request(request)
puts response.read_body{
"enhanced_prompt": "A warm, sunlit photograph of a handmade oak dining table in a bright modern kitchen, shallow depth of field, lifestyle advertising photography",
"original_prompt": "oak table photo"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Enhance a Google Ads image prompt
Rewrites a short image prompt into a fuller one that produces better Performance Max creative.
Send the text someone typed as raw_prompt. Nothing is saved.
An empty or whitespace-only raw_prompt returns an empty enhanced_prompt immediately, without running a model and without spending quota. If the model fails, you get your original prompt back as enhanced_prompt, so compare it against original_prompt when you need to know whether the rewrite actually happened.
Accept-Language header. Omit the header and you get English — the app’s own language is not consulted — so send it explicitly for a non-English app.curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"raw_prompt": "oak table photo"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt"
payload = { "raw_prompt": "oak table photo" }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({raw_prompt: 'oak table photo'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt', 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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt",
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([
'raw_prompt' => 'oak table photo'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt"
payload := strings.NewReader("{\n \"raw_prompt\": \"oak table photo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("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://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"raw_prompt\": \"oak table photo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/suggestions/enhance-prompt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"raw_prompt\": \"oak table photo\"\n}"
response = http.request(request)
puts response.read_body{
"enhanced_prompt": "A warm, sunlit photograph of a handmade oak dining table in a bright modern kitchen, shallow depth of field, lifestyle advertising photography",
"original_prompt": "oak table photo"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal API key.
Headers
Language to return generated text in, as a standard Accept-Language value. An unsupported language falls back to English.
Path Parameters
ID of the app you are planning a Google Ads campaign for.
Body
The image prompt to rewrite, in the caller's own words. Empty or whitespace-only returns an empty result without running a model.
"oak table photo"
Response
The rewritten prompt.
A rewritten image-generation prompt.
The rewritten prompt. Empty when you sent an empty or whitespace-only raw_prompt, in which case no model runs and no quota is spent.
"A warm, sunlit photograph of a handmade oak dining table in a bright modern kitchen, shallow depth of field, lifestyle advertising photography"
The raw_prompt you sent, echoed back unchanged.
"oak table photo"
Was this page helpful?