Safe public examples for integrating with the Rerato API.
Rerato turns documents, URLs, transcripts, or topics into voiced AI-hosted experiences: quizzes, lessons, training modules, presentations, podcasts, onboarding flows, and branded activations.
This repo is intentionally not production Rerato code. It contains integration patterns only: API request shape, idempotency, webhook verification, and a minimal Node example.
- Create source, host, experience, session, and webhook resources
- Use
Authorization: Bearer $RERATO_API_KEY - Send
Idempotency-Keyheaders for retry-safe writes - Verify HMAC-SHA256 webhook signatures
- Keep API keys on the server, never in browser code
- Node.js 20+
- A Rerato API key from the Rerato console
- A backend environment where secrets are safe
export RERATO_API_KEY="rto_test_..."
export RERATO_API_BASE_URL="https://api.rerato.ai/v1"git clone https://github.com/anmoldhingra1/rerato-api-examples.git
cd rerato-api-examples
npm install
npm run create-experienceRERATO_API_BASE_URL="${RERATO_API_BASE_URL:-https://api.rerato.ai/v1}"
curl -s -X POST "$RERATO_API_BASE_URL/sources" \
-H "Authorization: Bearer $RERATO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: source-demo-$(date +%s)" \
-d '{
"type": "topic",
"title": "Apollo 11",
"content": "Create a short, accurate quiz about Apollo 11 for a general audience."
}'See examples/node-create-experience.mjs.
The example uses a small helper:
async function rerato(path, options = {}) {
const baseUrl = process.env.RERATO_API_BASE_URL || "https://api.rerato.ai/v1";
const apiKey = process.env.RERATO_API_KEY;
if (!apiKey) {
throw new Error("Missing RERATO_API_KEY");
}
const response = await fetch(`${baseUrl}${path}`, {
...options,
headers: {
Authorization: `Bearer ${apiKey}`,
"Content-Type": "application/json",
...options.headers,
},
});
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`);
}
return response.json();
}Rerato webhooks are signed with HMAC-SHA256. Verify the raw request body before parsing JSON.
See examples/verify-webhook.mjs.
- Never expose
RERATO_API_KEYin browser JavaScript. - Store webhook signing secrets in your server environment or secret manager.
- Use idempotency keys for retries after network failures.
- Log API key prefixes, not full keys.
- Treat generated experience content as user-visible output and review before publishing in high-stakes workflows.
Rerato is the voice-AI orchestration layer behind Trivana.ai, a public alpha for AI-hosted gameshows and voiced interactive experiences.
Voice is not the moat. Orchestration is.