Upload or import a reusable reference image
Upload or import a reusable reference image.
curl --request POST \
--url https://api.mint.gg/v1/reference-images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceUrl": "<string>",
"base64Data": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.mint.gg/v1/reference-images"
payload = {
"sourceUrl": "<string>",
"base64Data": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"name": "<string>"
}
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({
sourceUrl: '<string>',
base64Data: '<string>',
fileName: '<string>',
contentType: '<string>',
name: '<string>'
})
};
fetch('https://api.mint.gg/v1/reference-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.mint.gg/v1/reference-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([
'sourceUrl' => '<string>',
'base64Data' => '<string>',
'fileName' => '<string>',
'contentType' => '<string>',
'name' => '<string>'
]),
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://api.mint.gg/v1/reference-images"
payload := strings.NewReader("{\n \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\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://api.mint.gg/v1/reference-images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mint.gg/v1/reference-images")
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 \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "asset",
"type": "world",
"id": "<string>",
"name": "<string>",
"status": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"items": [
{
"id": "<string>",
"index": 123,
"displayName": "<string>",
"itemPrompt": "<string>",
"status": "<string>",
"previewImageUrl": "<string>",
"modelId": "<string>",
"materialId": "<string>",
"errorMessage": "<string>"
}
]
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}Authorizations
Mint API key sent as a Bearer token.
Headers
Optional stable key for safely retrying an uncertain mutating request. Mint creates an internal key when this header is omitted. Reusing a supplied key with different parameters returns 409.
1 - 255Body
Import one reusable reference image from a public URL or base64 data.
Public HTTPS URL to the image; do not combine with base64Data.
Base64-encoded image bytes; requires fileName and contentType.
Original file name for a base64 upload.
1 - 160Image MIME type for a base64 upload.
1 - 100Optional reference image title shown in Mint.
1 - 120Response
Reference image created.
One account-owned asset from the Mint library.
Stable object discriminator.
Mint asset type.
world, model, asset_pack, material, material_pack, image, audio, video, reference_image Mint asset ID.
Asset title shown in Mint.
Current asset status, when available.
Asset thumbnail URL, when available.
When the asset was created.
When the asset last changed.
Asset Pack or Material Pack items, when applicable.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.mint.gg/v1/reference-images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sourceUrl": "<string>",
"base64Data": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"name": "<string>"
}
'import requests
url = "https://api.mint.gg/v1/reference-images"
payload = {
"sourceUrl": "<string>",
"base64Data": "<string>",
"fileName": "<string>",
"contentType": "<string>",
"name": "<string>"
}
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({
sourceUrl: '<string>',
base64Data: '<string>',
fileName: '<string>',
contentType: '<string>',
name: '<string>'
})
};
fetch('https://api.mint.gg/v1/reference-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.mint.gg/v1/reference-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([
'sourceUrl' => '<string>',
'base64Data' => '<string>',
'fileName' => '<string>',
'contentType' => '<string>',
'name' => '<string>'
]),
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://api.mint.gg/v1/reference-images"
payload := strings.NewReader("{\n \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\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://api.mint.gg/v1/reference-images")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mint.gg/v1/reference-images")
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 \"sourceUrl\": \"<string>\",\n \"base64Data\": \"<string>\",\n \"fileName\": \"<string>\",\n \"contentType\": \"<string>\",\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "asset",
"type": "world",
"id": "<string>",
"name": "<string>",
"status": "<string>",
"thumbnailUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"items": [
{
"id": "<string>",
"index": 123,
"displayName": "<string>",
"itemPrompt": "<string>",
"status": "<string>",
"previewImageUrl": "<string>",
"modelId": "<string>",
"materialId": "<string>",
"errorMessage": "<string>"
}
]
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}{
"type": "https://api.mint.gg/problems/animation-actions-not-in-set",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": [
{
"path": "<string>",
"code": "custom",
"message": "<string>"
}
],
"operationId": "<string>",
"billing": {
"reason": "subscription_required",
"resource": "preview",
"stage": "preview",
"requiredCredits": 1,
"actionUrl": "<string>",
"availableCredits": 1,
"committedCredits": 1,
"stageCredits": 1,
"completionCredits": 1,
"ctaKind": "view_plans"
}
}