curl --request POST \
--url https://app.moonlakeai.com/api/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"prompt": "<string>",
"references": [
{
"source": "url",
"url": "<string>"
}
]
},
"config": {
"effort": "high",
"model_version": "standard"
},
"project_id": "<string>",
"mode": "quote"
}
'import requests
url = "https://app.moonlakeai.com/api/v1/assets"
payload = {
"input": {
"prompt": "<string>",
"references": [
{
"source": "url",
"url": "<string>"
}
]
},
"config": {
"effort": "high",
"model_version": "standard"
},
"project_id": "<string>",
"mode": "quote"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {prompt: '<string>', references: [{source: 'url', url: '<string>'}]},
config: {effort: 'high', model_version: 'standard'},
project_id: '<string>',
mode: 'quote'
})
};
fetch('https://app.moonlakeai.com/api/v1/assets', 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.moonlakeai.com/api/v1/assets",
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([
'input' => [
'prompt' => '<string>',
'references' => [
[
'source' => 'url',
'url' => '<string>'
]
]
],
'config' => [
'effort' => 'high',
'model_version' => 'standard'
],
'project_id' => '<string>',
'mode' => 'quote'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.moonlakeai.com/api/v1/assets"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.moonlakeai.com/api/v1/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.moonlakeai.com/api/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"model_version": "standard",
"complexity": "simple",
"effort": "low",
"credits": 123
}{
"id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"config": {
"effort": "high",
"model_version": "standard"
},
"name": "<string>",
"project_id": "<string>",
"status_reason": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"result": {
"artifacts": [
{
"format": "usdz",
"download_url": "<string>"
}
]
},
"credits_charged": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create an asset generation
Submits an asset generation from a text description and one or more references of the asset.
Quotes by default: in the default mode: quote this returns 200 with the
generation’s credit price, and nothing is generated or charged. Resend the
identical request with mode: generate to run it, which returns 201
immediately in pending status; poll GET /assets/{asset_id} for progress
and results.
A reference can be a hosted url (source: url), inlined base64
(source: base64), or raw bytes attached to this request
(source: attached, which requires sending multipart/form-data with
the JSON body in an input form field). Prefer attached over base64
for large references: base64 inflates the body by ~33% against the same
request-size budget.
Pass an Idempotency-Key header to safely retry a request that may not
have reached the server — retrying with the same key and body returns
the original generation instead of creating a duplicate.
curl --request POST \
--url https://app.moonlakeai.com/api/v1/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"prompt": "<string>",
"references": [
{
"source": "url",
"url": "<string>"
}
]
},
"config": {
"effort": "high",
"model_version": "standard"
},
"project_id": "<string>",
"mode": "quote"
}
'import requests
url = "https://app.moonlakeai.com/api/v1/assets"
payload = {
"input": {
"prompt": "<string>",
"references": [
{
"source": "url",
"url": "<string>"
}
]
},
"config": {
"effort": "high",
"model_version": "standard"
},
"project_id": "<string>",
"mode": "quote"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: {prompt: '<string>', references: [{source: 'url', url: '<string>'}]},
config: {effort: 'high', model_version: 'standard'},
project_id: '<string>',
mode: 'quote'
})
};
fetch('https://app.moonlakeai.com/api/v1/assets', 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.moonlakeai.com/api/v1/assets",
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([
'input' => [
'prompt' => '<string>',
'references' => [
[
'source' => 'url',
'url' => '<string>'
]
]
],
'config' => [
'effort' => 'high',
'model_version' => 'standard'
],
'project_id' => '<string>',
'mode' => 'quote'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.moonlakeai.com/api/v1/assets"
payload := strings.NewReader("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.moonlakeai.com/api/v1/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.moonlakeai.com/api/v1/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"prompt\": \"<string>\",\n \"references\": [\n {\n \"source\": \"url\",\n \"url\": \"<string>\"\n }\n ]\n },\n \"config\": {\n \"effort\": \"high\",\n \"model_version\": \"standard\"\n },\n \"project_id\": \"<string>\",\n \"mode\": \"quote\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"model_version": "standard",
"complexity": "simple",
"effort": "low",
"credits": 123
}{
"id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"config": {
"effort": "high",
"model_version": "standard"
},
"name": "<string>",
"project_id": "<string>",
"status_reason": "<string>",
"completed_at": "2023-11-07T05:31:56Z",
"result": {
"artifacts": [
{
"format": "usdz",
"download_url": "<string>"
}
]
},
"credits_charged": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Your API key, as a Bearer token: Authorization: Bearer <key>.
Headers
A client-generated key that dedupes retries of this exact request.
Body
Request body for POST /assets.
The generation input describing the 3D model to build.
Show child attributes
Show child attributes
Generation settings. Omit to accept the defaults.
Show child attributes
Show child attributes
Attach this generation to an existing project you own (from a previous generation's project_id) so related assets live together. Omit to create a fresh project for the generation.
generate runs the generation and spends credits. The default quote only prices the request: nothing is generated and no credits are charged.
quote, generate Response
mode was quote (the default): a price quote, with nothing generated and no credits charged.
A price quote for a would-be generation: the request's assessed complexity, the effort applied, and the credit price for that pair. Nothing is generated or charged.
Human-readable confirmation that nothing was generated, and how to submit the generation for real.
The model_version this quote priced (echoed from the request config).
standard, lite Inferred complexity: simple, moderate, or complex. null for model_version: lite, which isn't scored.
simple, moderate, complex The effort this quote priced (echoed from the request config).
low, high, max Credits this generation would cost: effort × complexity for standard, a flat rate for lite.