Make, find or version many elements
Up to 100 elements of one project in ONE transaction. Voices are made first, then places, props and styles, then characters, so a character may speak with a voice of the same call (voice_of). An element the project already has — the same kind and name, its case and spaces aside — is reused (on_existing: reuse, the default: nothing written, its handle answered), made its next version, made again under a free handle (rename), or asked about. Every handle is the server's: the one asked or suggested, else the project's first free one, with who holds the one it meant. All or nothing: one entry refused or asked about and nothing is written — the answer says each entry's outcome, written: false — and dry_run: true writes nothing at all. The answer names each entry's outcome, your elements figure (quota) and every element written or reused. Takes a key holding studio:write — Account offers it unticked — or the desktop's own session key. Spends nothing.
curl -X POST https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}'const res = await fetch("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": True
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert", 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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert");
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([
"entries" => [
[
"name" => "Narrator",
"category" => "voice",
"voice" => [
"model" => "auray-serverless-minimax-speech-2-8",
"preset" => "English_expressive_narrator",
],
],
],
"dry_run" => true,
], 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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"entries" => [
{
"name" => "Narrator",
"category" => "voice",
"voice" => {
"model" => "auray-serverless-minimax-speech-2-8",
"preset" => "English_expressive_narrator"
}
}
],
"dry_run" => true
}.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 = """
{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert"))
.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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert");
var body = """
{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}
""";
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>",
"dry_run": true,
"written": true,
"entries": [
{
"at": 123,
"ref": "<string>",
"name": "<string>",
"category": "<string>",
"outcome": "<string>",
"handle": "<string>",
"element_id": "<string>",
"asked": "<string>",
"taken_by": {},
"existing": {},
"lineages": 123,
"problem": {}
}
],
"quota": {
"max": 123,
"used": 123,
"adds": 123,
"left": 123
},
"elements": [
{
"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>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}Authorizations
Bearer auray_sk_… — studio:write — Account offers it unticked; the desktop's session key holds it.
Path Parameters
Show child attributes
voice_of names this voice by."character", "location", "prop", "voice", "style"."draft", "ready", "archived".ref or its name. May be null."reuse", "version", "rename", "ask"."person", "director"."reuse", "version", "rename", "ask"."person", "director".OK.
"element_upsert".Show child attributes
"made", "versioned", "reused", "renamed", "asks", "refused", "copy_failed".Show child attributes
Show child attributes
"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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert \
-H "Authorization: Bearer $AURAY_API_KEY" \
-H "content-type: application/json" \
-d '{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}'const res = await fetch("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AURAY_API_KEY}`,
"content-type": "application/json",
},
body: JSON.stringify({
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}),
});
console.log(await res.json());import os, requests
r = requests.post(
"https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert",
headers={"Authorization": f"Bearer {os.environ['AURAY_API_KEY']}"},
json={
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": True
},
)
r.raise_for_status()
print(r.json())package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := []byte(`{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}`)
req, err := http.NewRequest("POST", "https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert", 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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert");
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([
"entries" => [
[
"name" => "Narrator",
"category" => "voice",
"voice" => [
"model" => "auray-serverless-minimax-speech-2-8",
"preset" => "English_expressive_narrator",
],
],
],
"dry_run" => true,
], 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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer #{ENV.fetch("AURAY_API_KEY")}"
req["Content-Type"] = "application/json"
req.body = {
"entries" => [
{
"name" => "Narrator",
"category" => "voice",
"voice" => {
"model" => "auray-serverless-minimax-speech-2-8",
"preset" => "English_expressive_narrator"
}
}
],
"dry_run" => true
}.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 = """
{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.auray.ai/v1/studio/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert"))
.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/projects/3f0c8a52-6a1d-4e8b-9c2d-7e5f4a3b2c1d/elements/upsert");
var body = """
{
"entries": [
{
"name": "Narrator",
"category": "voice",
"voice": {
"model": "auray-serverless-minimax-speech-2-8",
"preset": "English_expressive_narrator"
}
}
],
"dry_run": true
}
""";
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>",
"dry_run": true,
"written": true,
"entries": [
{
"at": 123,
"ref": "<string>",
"name": "<string>",
"category": "<string>",
"outcome": "<string>",
"handle": "<string>",
"element_id": "<string>",
"asked": "<string>",
"taken_by": {},
"existing": {},
"lineages": 123,
"problem": {}
}
],
"quota": {
"max": 123,
"used": 123,
"adds": 123,
"left": 123
},
"elements": [
{
"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>"
}{
"error": "<string>",
"message": "<string>",
"docs": "<string>",
"request_id": "<string>"
}