AI transcription
#Step 1: Get models & parameters
/v1/ai/toolsCall this endpoint to discover every action, its available models, and the JSON schema each model accepts for params. Use the schema from the response to build your params object in step 2.
curl "https://api.rendley.com/v1/ai/tools" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.rendley.com/v1/ai/tools", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const { data } = await res.json();import requests
res = requests.get(
"https://api.rendley.com/v1/ai/tools",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()["data"]$ch = curl_init("https://api.rendley.com/v1/ai/tools");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY"]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.rendley.com/v1/ai/tools", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}require "net/http"
require "json"
uri = URI("https://api.rendley.com/v1/ai/tools")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]Response
{
"data": [
{
"action": "generate_video",
"models": [
{
"id": "kling-v2.6",
"name": "Kling v2.6",
"schema": {
"properties": {
"prompt": { "type": "string" },
"aspect_ratio": { "type": "string" }
},
"required": ["prompt"]
}
}
]
}
]
}Step 2 is the specific generation endpoint below. Pick the one you need, pass project_id, optionally model_id, and the params from the schema above.
#Transcribe audio or video
/v1/ai/transcribeEnqueue a job to transcribe spoken words in an audio or video clip to text with word-level timestamps.
Request body
clip_idstringOptionalfile_urlstringOptionalmodel_idstringOptionalWhich model to use. Call GET /ai/tools to see available models. Each action has a default.
paramsjsonRequiredModel-specific parameters. Call GET /ai/tools to get the schema for each model.
project_idstringRequiredResponse codes
200OK
400Bad Request
401Unauthorized
402Payment Required
curl -X POST "https://api.rendley.com/v1/ai/transcribe" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"prompt": "..."
},
"project_id": "<project_id>"
}'const res = await fetch("https://api.rendley.com/v1/ai/transcribe", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"params": {
"prompt": "..."
},
"project_id": "<project_id>"
}),
});
const { data } = await res.json();import requests
res = requests.post(
"https://api.rendley.com/v1/ai/transcribe",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"params": {
"prompt": "..."
},
"project_id": "<project_id>"
},
)
data = res.json()["data"]$ch = curl_init("https://api.rendley.com/v1/ai/transcribe");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["params" => ["prompt" => "..."], "project_id" => "<project_id>"]));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];package main
import (
"fmt"
"io"
"net/http"
"bytes"
)
func main() {
body := bytes.NewBufferString(`{
"params": {
"prompt": "..."
},
"project_id": "<project_id>"
}`)
req, _ := http.NewRequest("POST", "https://api.rendley.com/v1/ai/transcribe", body)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}require "net/http"
require "json"
uri = URI("https://api.rendley.com/v1/ai/transcribe")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = { params: { prompt: "..." }, project_id: "<project_id>" }.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]Which model to use. Call GET /ai/tools to see available models. Each action has a default.
Model-specific parameters. Call GET /ai/tools to get the schema for each model.
#Calculate transcription cost
/v1/ai/transcribe/costCalculate the credit cost of transcribing an audio or video clip.
Request body
clip_idstringOptionalfile_urlstringOptionalmodel_idstringOptionalparamsobjectOptionalproject_idstringRequiredResponse codes
200OK
400Bad Request
401Unauthorized
curl -X POST "https://api.rendley.com/v1/ai/transcribe/cost" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "<project_id>"
}'const res = await fetch("https://api.rendley.com/v1/ai/transcribe/cost", {
method: "POST",
headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"project_id": "<project_id>"
}),
});
const { data } = await res.json();import requests
res = requests.post(
"https://api.rendley.com/v1/ai/transcribe/cost",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"project_id": "<project_id>"
},
)
data = res.json()["data"]$ch = curl_init("https://api.rendley.com/v1/ai/transcribe/cost");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["project_id" => "<project_id>"]));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];package main
import (
"fmt"
"io"
"net/http"
"bytes"
)
func main() {
body := bytes.NewBufferString(`{
"project_id": "<project_id>"
}`)
req, _ := http.NewRequest("POST", "https://api.rendley.com/v1/ai/transcribe/cost", body)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}require "net/http"
require "json"
uri = URI("https://api.rendley.com/v1/ai/transcribe/cost")
req = Net::HTTP::Post.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
req["Content-Type"] = "application/json"
req.body = { project_id: "<project_id>" }.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]#Step 3: Poll the job
/v1/jobs/{job_id}Poll this endpoint every few seconds until status is completed or failed. See Jobs and polling for the full loop.
The result contains a media_id and file_hash. Use the next step to get a download URL.
curl "https://api.rendley.com/v1/jobs/{job_id}" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.rendley.com/v1/jobs/{job_id}", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const { data } = await res.json();import requests
res = requests.get(
"https://api.rendley.com/v1/jobs/{job_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()["data"]$ch = curl_init("https://api.rendley.com/v1/jobs/{job_id}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY"]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.rendley.com/v1/jobs/{job_id}", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}require "net/http"
require "json"
uri = URI("https://api.rendley.com/v1/jobs/{job_id}")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]Response
{
"data": {
"status": "completed",
"result_data": "{\"media_id\":\"med_abc...\",\"file_hash\":\"sha256_def...\"}"
}
}#Step 4: Get the download URL
/v1/uploadsPass the file_hash from the completed job to get a presigned download URL. The storage_url is time-limited, so download the file promptly.
curl "https://api.rendley.com/v1/uploads" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://api.rendley.com/v1/uploads", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const { data } = await res.json();import requests
res = requests.get(
"https://api.rendley.com/v1/uploads",
headers={"Authorization": "Bearer YOUR_API_KEY"},
)
data = res.json()["data"]$ch = curl_init("https://api.rendley.com/v1/uploads");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer YOUR_API_KEY"]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true)["data"];package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.rendley.com/v1/uploads", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
b, _ := io.ReadAll(res.Body)
fmt.Println(string(b))
}require "net/http"
require "json"
uri = URI("https://api.rendley.com/v1/uploads")
req = Net::HTTP::Get.new(uri)
req["Authorization"] = "Bearer YOUR_API_KEY"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)["data"]Response
{
"data": {
"storage_url": "https://storage.rendley.com/uploads/...png",
"media_id": "med_abc..."
}
}