Media Generation
Generate Images
Generate images from text prompts using the Theo Create engine.
POST
/
api
/
v1
/
images
Generate Images
curl --request POST \
--url https://api.example.com/api/v1/images \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"style": "<string>",
"aspect_ratio": "<string>",
"count": 123
}
'import requests
url = "https://api.example.com/api/v1/images"
payload = {
"prompt": "<string>",
"style": "<string>",
"aspect_ratio": "<string>",
"count": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', style: '<string>', aspect_ratio: '<string>', count: 123})
};
fetch('https://api.example.com/api/v1/images', 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.example.com/api/v1/images",
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' => '<string>',
'style' => '<string>',
'aspect_ratio' => '<string>',
'count' => 123
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/images"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/images")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": "<string>",
"images": [
{
"url": {},
"engine": "<string>",
"model": "<string>",
"prompt": "<string>"
}
],
"usage": {
"cost_cents": 123
}
}Generate one or more images from a text prompt. This is a synchronous endpoint — images are returned directly in the response.
Authentication
Requires a Bearer token. See Authentication.Request Body
Text description of the image(s) to generate.
Visual style hint (e.g.,
"photorealistic", "illustration", "watercolor", "3d-render"). Appended to the prompt for the image engine.Aspect ratio (e.g.,
"1:1", "16:9", "9:16", "4:3"). Defaults to the engine’s native ratio.Number of images to generate (1–4).
Request Examples
curl -X POST https://www.hitheo.ai/api/v1/images \
-H "Authorization: Bearer $THEO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A minimalist tech logo, blue and white",
"style": "photorealistic",
"aspect_ratio": "1:1",
"count": 2
}'
const res = await theo.images({
prompt: "A minimalist tech logo, blue and white",
style: "photorealistic",
aspect_ratio: "1:1",
count: 2,
});
for (const img of res.images) {
console.log(img.url, img.engine);
}
Response
Unique image generation ID (prefixed
img_).ISO 8601 timestamp.
Example Response
{
"id": "img_abc123",
"created": "2026-04-10T12:00:00Z",
"images": [
{
"url": "https://artifacts.hitheo.ai/img/abc123-1.png",
"engine": "theo-vision",
"model": "theo-1-create",
"prompt": "A minimalist tech logo, blue and white Style: photorealistic. Aspect ratio: 1:1."
},
{
"url": "https://artifacts.hitheo.ai/img/abc123-2.png",
"engine": "theo-vision",
"model": "theo-1-create",
"prompt": "A minimalist tech logo, blue and white Style: photorealistic. Aspect ratio: 1:1."
}
],
"usage": { "cost_cents": 0.08 }
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_prompt | prompt is required |
| 401 | invalid_api_key | Missing or invalid API key |
| 429 | rate_limit_exceeded | Too many requests |
Was this page helpful?
⌘I
Generate Images
curl --request POST \
--url https://api.example.com/api/v1/images \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "<string>",
"style": "<string>",
"aspect_ratio": "<string>",
"count": 123
}
'import requests
url = "https://api.example.com/api/v1/images"
payload = {
"prompt": "<string>",
"style": "<string>",
"aspect_ratio": "<string>",
"count": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({prompt: '<string>', style: '<string>', aspect_ratio: '<string>', count: 123})
};
fetch('https://api.example.com/api/v1/images', 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.example.com/api/v1/images",
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' => '<string>',
'style' => '<string>',
'aspect_ratio' => '<string>',
'count' => 123
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/images"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/api/v1/images")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"<string>\",\n \"style\": \"<string>\",\n \"aspect_ratio\": \"<string>\",\n \"count\": 123\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": "<string>",
"images": [
{
"url": {},
"engine": "<string>",
"model": "<string>",
"prompt": "<string>"
}
],
"usage": {
"cost_cents": 123
}
}