Make an element
Make an element: a character, a location or a prop from one to 6 pictures or clips; a voice from one of a speech model's own voices or one described in words, with at most one sound of it as its sa…
curl -X POST https://api.auray.ai/v1/studio/elements \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}'const res = await fetch("https://api.auray.ai/v1/studio/elements", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/elements",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/elements", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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/studio/elements");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Aliya",
"category" => "character",
"description" => "A courier in a yellow raincoat.",
"files" => [
[
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
],
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/studio/elements")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"name" => "Aliya",
"category" => "character",
"description" => "A courier in a yellow raincoat.",
"files" => [
{
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}.to_json
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 {
String body = """
{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/elements"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/studio/elements");
var body = """
{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"handle": "<string>",
"name": "<string>",
"category": "<string>",
"version": 123,
"lineage_id": "<string>",
"description": "<string>",
"files": [
{
"role": "<string>",
"url": "<string>",
"expires_at": "<string>",
"content_type": "<string>",
"bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123,
"from_upload": true,
"uploaded": true
}
],
"properties": [
{
"key": "<string>",
"value": "<string>"
}
],
"status": "<string>",
"project_id": "<string>",
"voice": {},
"voice_handle": "<string>",
"pinned": true,
"sample_consent": {},
"sample_acceptance": {},
"created_at": "<string>",
"updated_at": "<string>",
"voice_chosen_by": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}Make an element: a character, a location or a prop from one to 6 pictures or clips; a voice from one of a speech model's own voices or one described in words, with at most one sound of it as its sample; or a style from words and up to 6 pictures. Its files are uploads made for an element, or a project's items, which are copied. As many elements as your plan's studio.max_elements (on GET /v1/plans), every version counted. A handle is its project's — one element's there, whoever made it — or, in no project, your library's: the same handle may name an element in each of two projects. Takes a key holding studio:write — Account offers it unticked — or the desktop's own session key. Spends nothing.
Authorizations
Bearer auray_sk_… — studio:write — Account offers it unticked; the desktop's session key holds it.
"character", "location", "prop", "voice", "style".@<category>_<name>_v<version>, made unique among yours.Show child attributes
"draft", "ready", "archived"."person", "director".refuse (the default) answers handle_taken; suffix takes the scope's first free one, @char_mara_2_v1 for @char_mara_v1. One of "refuse", "suffix".Created.
"element".@char_aliya_v1. Every version has its own."character", "location", "prop", "voice", "style".Show child attributes
original as made or uploaded; thumbnail a smaller picture for a card; poster a frame of a clip or a view of a mesh; captions a film's subtitles, the WebVTT a captioned export files beside it. One of "original", "thumbnail", "poster", "captions".source.from_upload. May be null.Show child attributes
"draft", "ready", "archived"."person", "director", null. May be null.Headers:
| Header | Description |
|---|---|
RateLimit-Limit | Burst capacity. |
RateLimit-Remaining | |
RateLimit-Reset | Seconds until refill. |
X-RateLimit-Limit | |
X-RateLimit-Remaining | |
X-RateLimit-Reset | Unix seconds. The X- spelling is what client libraries read. |
X-Request-Id |
Was this page helpful?
curl -X POST https://api.auray.ai/v1/studio/elements \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}'const res = await fetch("https://api.auray.ai/v1/studio/elements", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/elements",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/elements", bytes.NewReader(body))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("AURAY_API_KEY"))
req.Header.Set("Content-Type", "application/json")
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/studio/elements");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("AURAY_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"name" => "Aliya",
"category" => "character",
"description" => "A courier in a yellow raincoat.",
"files" => [
[
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
],
],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE),
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;require "net/http"
require "json"
uri = URI("https://api.auray.ai/v1/studio/elements")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"name" => "Aliya",
"category" => "character",
"description" => "A courier in a yellow raincoat.",
"files" => [
{
"item_id" => "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}.to_json
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 {
String body = """
{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/elements"))
.header("Authorization", "Bearer " + System.getenv("AURAY_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AURAY_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.auray.ai/v1/studio/elements");
var body = """
{
"name": "Aliya",
"category": "character",
"description": "A courier in a yellow raincoat.",
"files": [
{
"item_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"
}
]
}
""";
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");{
"object": "<string>",
"id": "<string>",
"handle": "<string>",
"name": "<string>",
"category": "<string>",
"version": 123,
"lineage_id": "<string>",
"description": "<string>",
"files": [
{
"role": "<string>",
"url": "<string>",
"expires_at": "<string>",
"content_type": "<string>",
"bytes": 123,
"width": 123,
"height": 123,
"duration_ms": 123,
"from_upload": true,
"uploaded": true
}
],
"properties": [
{
"key": "<string>",
"value": "<string>"
}
],
"status": "<string>",
"project_id": "<string>",
"voice": {},
"voice_handle": "<string>",
"pinned": true,
"sample_consent": {},
"sample_acceptance": {},
"created_at": "<string>",
"updated_at": "<string>",
"voice_chosen_by": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}