curl --request POST \
--url https://app.moonlakeai.com/api/v1/assets/quote \
--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/quote"
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/quote', 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/quote",
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/quote"
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/quote")
.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/quote")
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
}Quote an asset generation's credit cost
Prices a generation without submitting it, so the caller sees the cost before
committing. Takes the same body as POST /assets and returns the same quote that
route gives in its default quote mode; mode: generate is rejected here.
curl --request POST \
--url https://app.moonlakeai.com/api/v1/assets/quote \
--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/quote"
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/quote', 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/quote",
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/quote"
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/quote")
.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/quote")
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
}Authorizations
Your API key, as a Bearer token: Authorization: Bearer <key>.
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
Successful Response
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.