Start here
Read a collection
/v1/community/collections/{id}on https://api.auray.ai/v1A page of one collection's works still shown, newest saved first.
A page of one collection's works still shown, newest saved first. A public collection of a listed profile reads with no key; its owner reads it either way. Takes no key. A key that holds community:write reads as its account — its likes and follows filled in — and any other key reads what a stranger reads; either way a request with a key is answered for itself alone and kept in no shared cache. An answer without a key is the same for every reader, its request_id included — which names the request that filled the edge's copy — and carries no RateLimit-* headers, since they would describe that request's sender. Cached at the edge for thirty seconds with two minutes of stale service.
#Authentication
No key needed. A key that holds community:write is read as its account — its likes and follows filled in — and is answered private, no-store. Paced per address, and cached at the edge for thirty seconds.
#Request
#Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes |
#Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
cursor | string | no | The next_cursor the previous page answered, unchanged, with the same filters. None for the first page. 0 to 200 characters. |
limit | integer | no | How many on a page. 1 to 60. |
#Example request
curl https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8eimport { createClient } from "@auray/client";
const auray = createClient(); // this route needs no key
const answer = await auray.platform.community.collections.get("5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e");
console.dir(answer, { depth: null });from auray_client import Client
auray = Client() # this route needs no key
answer = auray.platform.community.collections.get("5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e")
print(answer)const res = await fetch("https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e", {
method: "GET",
});
console.log(await res.json());import requests
r = requests.get(
"https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
)
r.raise_for_status()
print(r.json())package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e", nil)
if err != nil {
panic(err)
}
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.Status, string(out))
}<?php
$ch = curl_init("https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
uri = URI("https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e")
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
puts res.code, res.bodyimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e"))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Get, "https://api.auray.ai/v1/community/collections/5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");#Responses
#200 OK
OK.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
object | string | yes | — | One of "collection". |
id | string | yes | — | |
title | string | yes | — | |
description | string | yes | — | May be null. |
public | boolean | yes | — | Shown on its owner's profile. |
items | integer | yes | — | Works in it, shown or not. |
updated_at | string | yes | — | |
mine | boolean | yes | — | |
cover | object[] | yes | — | The newest shown work's files. |
cover[].role | string | yes | — | primary is the work as it was made; the rest are what the feeds draw: an image's thumbnail, a video's or a model's poster and thumbnail, a song's waveform (JSON: {version, peaks}). One of "primary", "poster", "preview", "thumbnail", "waveform". |
cover[].position | integer | yes | — | |
cover[].url | string | yes | — | Where to load it. Kept until its author unpublishes the work. A URL. |
cover[].content_type | string | yes | — | |
cover[].width | integer | yes | — | May be null. |
cover[].height | integer | yes | — | May be null. |
cover[].duration_ms | integer | yes | — | May be null. |
cover[].supplied | boolean | yes | — | True for a poster, or its thumbnail, that the work's author supplied rather than one our services made: it is not what the model made, and the work's ai_generated does not describe it. |
owner | object or null | no | — | |
url | string | no | — | Its page, under its owner's profile. A URL. May be null. |
data | object[] | no | — | |
data[].id | string | yes | — | The work's public id. |
data[].kind | string | yes | — | One of "image", "video", "audio", "model3d", "project". |
data[].title | string | yes | — | May be null. |
data[].model | object | yes | — | |
data[].model.address | string | yes | — | The model address it was made with, as GET /v1/models lists it: the path a job is submitted to, such as auray-ai/krea-2-turbo/text-to-image. May be null. |
data[].model.id | string | yes | — | The same model's id, as GET /v1/models lists it: the catalogue slug, such as krea2. May be null. |
data[].model.label | string | yes | — | The model's name, as a person reads it. May be null. |
data[].attribution | string | yes | — | The licence text the model's output travels with. Show it wherever the work is shown. May be null. |
data[].ai_generated | boolean | yes | — | Every work here is a generation's result. Label it so wherever it is shown. One of true. |
data[].media | object[] | yes | — | |
data[].media[].role | string | yes | — | primary is the work as it was made; the rest are what the feeds draw: an image's thumbnail, a video's or a model's poster and thumbnail, a song's waveform (JSON: {version, peaks}). One of "primary", "poster", "preview", "thumbnail", "waveform". |
data[].media[].position | integer | yes | — | |
data[].media[].url | string | yes | — | Where to load it. Kept until its author unpublishes the work. A URL. |
data[].media[].content_type | string | yes | — | |
data[].media[].width | integer | yes | — | May be null. |
data[].media[].height | integer | yes | — | May be null. |
data[].media[].duration_ms | integer | yes | — | May be null. |
data[].media[].supplied | boolean | yes | — | True for a poster, or its thumbnail, that the work's author supplied rather than one our services made: it is not what the model made, and the work's ai_generated does not describe it. |
data[].author | object or null | yes | — | |
data[].counts | object | yes | — | |
data[].counts.likes | integer | yes | — | |
data[].counts.views | integer | yes | — | Counted once a day per visitor. |
data[].counts.comments | integer | yes | — | |
data[].counts.remixes | integer | yes | — | |
data[].made_at | string | yes | — | When the result was made. May be null. |
data[].published_at | string | yes | — | May be null. |
data[].featured | boolean | yes | — | Featured by our team. |
data[].pinned | boolean | yes | — | Pinned by our team to the top of the public feeds. |
data[].original | boolean | yes | — | An Original: made by our own team. |
data[].remixed | boolean | yes | — | Made from another work. |
data[].liked | boolean | yes | — | The reader's own like; null when no key that holds community:write was sent. May be null. |
data[].url | string | yes | — | The work's page. A URL. |
data[].project | object | no | — | Only on a project's card: its address, category, how many assets it shows, and the three largest bands of its Stack. |
data[].project.slug | string | yes | — | |
data[].project.category | string | yes | — | One of "film", "short", "series", "trailer", "commercial", "music_video", "animation", "documentary", "fashion", "game", "worldbuilding", "experimental", "other". |
data[].project.items | integer | yes | — | 0 to …. |
data[].project.stack | object[] | yes | — | |
data[].project.stack[].model | object | yes | — | |
data[].project.stack[].tenths | integer | yes | — | Its share in tenths of a percent; the bands of one Stack add up to exactly 1000. 0 to 1000. |
data[].project.stack[].percent | number | yes | — | tenths / 10, for display only. |
data[].project.stack[].count | integer | yes | — | 0 to …. |
data[].project.stack[].color | string | yes | — | |
data[].project.stack[].other | boolean | yes | — | The band that gathers every model past the top ones. |
next_cursor | string | no | — | May be null. |
request_id | string | no | — | Mirrored in the X-Request-Id header. On an answer without a key it names the request that filled the edge's copy, so readers served from that copy are handed the same one. |
Headers:
| Header | Description |
|---|---|
Cache-Control | public, s-maxage=30, stale-while-revalidate=120 with no key; private, no-store with one. |
Vary | Authorization. |
RateLimit-Limit | Burst capacity, per key, on an answer to a key. An answer without one is cached at the edge and carries none of the RateLimit-* headers; a refusal without one, which is never cached, carries its address's. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-Request-Id |
#400 Bad Request
#404 Not Found
#429 Too Many Requests
#503 Service Unavailable
#Status codes
| Status | Meaning |
|---|---|
200 | OK. |
400 | Bad Request |
404 | Not Found |
429 | Too Many Requests |
503 | Service Unavailable |
Every refusal names its code, and every code is explained at Errors.