Start here
Read a work
/v1/community/publications/{id}on https://api.auray.ai/v1One work as its page draws it: its files, its model and licence text, its words, its prompt and settings only while its author shows them, the work it was made from, and its author.
One work as its page draws it: its files, its model and licence text, its words, its prompt and settings only while its author shows them, the work it was made from, and its author. A work is shown once published, whether or not our team approved it for the feeds; one that is hidden, withdrawn or removed answers 404 — except to its author, who reads where it stands in mine. 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 |
#Example request
curl https://api.auray.ai/v1/community/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1dimport { createClient } from "@auray/client";
const auray = createClient(); // this route needs no key
const answer = await auray.platform.community.publications.get("3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d");
console.dir(answer, { depth: null });from auray_client import Client
auray = Client() # this route needs no key
answer = auray.platform.community.publications.get("3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d")
print(answer)const res = await fetch("https://api.auray.ai/v1/community/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d", {
method: "GET",
});
console.log(await res.json());import requests
r = requests.get(
"https://api.auray.ai/v1/community/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d",
)
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/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d", 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/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d");
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/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d")
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/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d"))
.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/publications/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d");
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 "publication". |
id | string | yes | — | The work's public id. |
kind | string | yes | — | One of "image", "video", "audio", "model3d", "project". |
title | string | yes | — | May be null. |
model | object | yes | — | |
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. |
model.id | string | yes | — | The same model's id, as GET /v1/models lists it: the catalogue slug, such as krea2. May be null. |
model.label | string | yes | — | The model's name, as a person reads it. May be null. |
attribution | string | yes | — | The licence text the model's output travels with. Show it wherever the work is shown. May be null. |
ai_generated | boolean | yes | — | Every work here is a generation's result. Label it so wherever it is shown. One of true. |
media | object[] | yes | — | |
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". |
media[].position | integer | yes | — | |
media[].url | string | yes | — | Where to load it. Kept until its author unpublishes the work. A URL. |
media[].content_type | string | yes | — | |
media[].width | integer | yes | — | May be null. |
media[].height | integer | yes | — | May be null. |
media[].duration_ms | integer | yes | — | May be null. |
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. |
author | object or null | yes | — | |
counts | object | yes | — | |
counts.likes | integer | yes | — | |
counts.views | integer | yes | — | Counted once a day per visitor. |
counts.comments | integer | yes | — | |
counts.remixes | integer | yes | — | |
made_at | string | yes | — | When the result was made. May be null. |
published_at | string | yes | — | May be null. |
featured | boolean | yes | — | Featured by our team. |
pinned | boolean | yes | — | Pinned by our team to the top of the public feeds. |
original | boolean | yes | — | An Original: made by our own team. |
remixed | boolean | yes | — | Made from another work. |
liked | boolean | yes | — | The reader's own like; null when no key that holds community:write was sent. May be null. |
url | string | yes | — | The work's page. A URL. |
description | string | yes | — | May be null. |
show_prompt | boolean | yes | — | |
prompt | string | yes | — | Only while its author shows it. A hidden prompt is not stored anywhere. May be null. |
params | object | yes | — | The settings it was made with, only while shown — never a file that was uploaded to make it. May be null. |
remix_kind | string | yes | — | One of "recreate", "animate", "upscale", "edit", null. May be null. |
remix_of | object | yes | — | The work it was made from, while that is shown. May be null. |
remix_of.id | string | no | — | |
remix_of.kind | string | no | — | One of "image", "video", "audio", "model3d", "project". |
remix_of.title | string | no | — | May be null. |
remix_of.author | object or null | no | — | |
remix_of.url | string | no | — | A URL. |
mine | object | no | — | Where an author's own work stands and why. Only ever answered to its author. |
mine.state | string | yes | — | published is shown on the profile and at its link; hidden while a severe report is reviewed; withdrawn unpublished while a report held it; removed taken down by our team; staging while its files are copied. One of "staging", "published", "hidden", "withdrawn", "removed". |
mine.state_reason | string | yes | — | Why our team hid or removed it. May be null. |
mine.approval | string | yes | — | Whether it is in the public feeds and search. Approval gates the feeds only — never the profile or the link. One of "pending", "approved", "rejected". |
mine.approval_reason | string | yes | — | Why our team declined it for the feeds. May be null. |
mine.discoverable | boolean | yes | — | The author lets it into the public feeds once approved. |
mine.profile_pinned | boolean | yes | — | |
mine.held | boolean | yes | — | An open report holds it: it is kept until the report is decided. |
mine.licence_version | string | no | — | The Terms version whose display and remix licences were granted. |
mine.created_at | string | yes | — | |
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 |
#404 Not Found
#429 Too Many Requests
#503 Service Unavailable
#Status codes
| Status | Meaning |
|---|---|
200 | OK. |
404 | Not Found |
429 | Too Many Requests |
503 | Service Unavailable |
Every refusal names its code, and every code is explained at Errors.