Media and embeddings
curl --request POST \
--url https://api.compose.market/v1/images/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"input": {},
"file": "<string>",
"image": "<string>",
"image_url": "<string>"
}
'import requests
url = "https://api.compose.market/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"input": {},
"file": "<string>",
"image": "<string>",
"image_url": "<string>"
}
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({
model: '<string>',
prompt: '<string>',
input: {},
file: '<string>',
image: '<string>',
image_url: '<string>'
})
};
fetch('https://api.compose.market/v1/images/generations', 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.compose.market/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'input' => [
],
'file' => '<string>',
'image' => '<string>',
'image_url' => '<string>'
]),
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.compose.market/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\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.compose.market/v1/images/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyInference
Media and embeddings
Generate or transform image, audio, video, and embedding outputs through native paid inference.
POST
/
v1
/
images
/
generations
Media and embeddings
curl --request POST \
--url https://api.compose.market/v1/images/generations \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"prompt": "<string>",
"input": {},
"file": "<string>",
"image": "<string>",
"image_url": "<string>"
}
'import requests
url = "https://api.compose.market/v1/images/generations"
payload = {
"model": "<string>",
"prompt": "<string>",
"input": {},
"file": "<string>",
"image": "<string>",
"image_url": "<string>"
}
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({
model: '<string>',
prompt: '<string>',
input: {},
file: '<string>',
image: '<string>',
image_url: '<string>'
})
};
fetch('https://api.compose.market/v1/images/generations', 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.compose.market/v1/images/generations",
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([
'model' => '<string>',
'prompt' => '<string>',
'input' => [
],
'file' => '<string>',
'image' => '<string>',
'image_url' => '<string>'
]),
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.compose.market/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\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.compose.market/v1/images/generations")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/v1/images/generations")
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 \"model\": \"<string>\",\n \"prompt\": \"<string>\",\n \"input\": {},\n \"file\": \"<string>\",\n \"image\": \"<string>\",\n \"image_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMedia routes use the same native payment behavior as text inference. Status polling routes are not billable; the charge happens on generation submission.
The stream emits
Routes
| Method | Path | Description |
|---|---|---|
POST | /v1/images/generations | Generate images from a prompt. |
POST | /v1/images/edits | Edit an image with a prompt. |
POST | /v1/audio/speech | Generate speech audio bytes. |
POST | /v1/audio/transcriptions | Transcribe base64 audio. |
POST | /v1/embeddings | Generate embeddings. |
POST | /v1/videos/generations | Submit video generation. |
GET | /v1/videos/{id} | Poll video generation status. |
GET | /v1/videos/{id}/stream | Stream video status until terminal state. |
Common headers
string
Bearer compose-... for Compose Key billing.string
Raw x402 payment signature for x402-aware clients.
Common fields
string
required
Public catalog model ID.
string
Required for image and video generation.
string | array
Required for speech and embeddings.
string
Required for audio transcription. The route expects base64 content.
string
Required for image edits; also accepted as an initial image for some video models.
string
URL form of an input image.
Video status stream
number
Poll interval for
/v1/videos/{id}/stream. Default 2000, minimum 500, maximum 30000.number
Stream timeout. Default
600000, minimum 5000, maximum 3600000.video.status, compose.error, and data: [DONE].