Skip to main content
GET
/
api
/
assets
List user assets
curl --request GET \
  --url https://cloud.comfy.org/api/assets \
  --header 'X-API-Key: <api-key>'
import requests

url = "https://cloud.comfy.org/api/assets"

headers = {"X-API-Key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};

fetch('https://cloud.comfy.org/api/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://cloud.comfy.org/api/assets",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "X-API-Key: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://cloud.comfy.org/api/assets"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-Key", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://cloud.comfy.org/api/assets")
  .header("X-API-Key", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://cloud.comfy.org/api/assets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "assets": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "size": 123,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "asset_hash": "<string>",
      "mime_type": "<string>",
      "tags": [
        "<string>"
      ],
      "user_metadata": {},
      "preview_url": "<string>",
      "preview_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "last_access_time": "2023-11-07T05:31:56Z",
      "is_immutable": true
    }
  ],
  "total": 123,
  "has_more": true
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "code": "<string>",
  "message": "<string>"
}
{
  "code": "<string>",
  "message": "<string>"
}

Authorizations

X-API-Key
string
header
required

API key authentication. Generate an API key from your account settings at https://platform.comfy.org/profile/api-keys. Pass the key in the X-API-Key header.

Query Parameters

include_tags
string[]

Filter assets that have ALL of these tags

exclude_tags
string[]

Exclude assets that have ANY of these tags

name_contains
string

Filter assets where name contains this substring (case-insensitive)

metadata_filter
string

JSON object for filtering by metadata fields

limit
integer
default:20

Maximum number of assets to return (1-500)

Required range: 1 <= x <= 500
offset
integer
default:0

Number of assets to skip for pagination

Required range: x >= 0
sort
enum<string>
default:created_at

Field to sort by

Available options:
name,
created_at,
updated_at,
size,
last_access_time
order
enum<string>
default:desc

Sort order

Available options:
asc,
desc
include_public
boolean
default:true

Whether to include public/shared assets in results

Response

Success - Assets returned

assets
object[]
required

List of assets matching the query

total
integer
required

Total number of assets matching the filters

has_more
boolean
required

Whether more assets are available beyond this page