Code examples
Offline generation is upload → poll → download. The runnable snippets below use the public API. For a complete realtime voice application, use demo-atlas. There is no separate offline example app.
Next.js, LiveKit, voice and captions. Installation and configuration.
Offline generation
Python: install requests. JavaScript: use Node.js 22 or later. Set ATLAS_API_KEY on the server and supply speech.mp3 plus face.jpg. These examples upload actual files, check HTTP errors, preserve the job ID, stop polling after twelve minutes, and download the signed output URL without exposing your key to storage.
The timeout stops this client’s polling; it does not cancel the server job. Resume the same job ID. If submission itself times out, reuse the saved Idempotency-Key for the same logical request; do not generate another key and silently create duplicate work.
Realtime voice and captions
Follow the current demo-atlas guide and repository lockfile. The app uses a private server-side Atlas key and an OpenAI Realtime voice connection. Its /api/session routes are application proxies, not additional endpoints on api.atlasv1.com.
Upload a face file. Do not submit face_url: production rejects caller-provided portrait URLs. Map session_id → sessionId and livekit_url → livekitUrl for the React hook. Preserve one audio track for RTP speech and explicitly end the exact server session on stop.
Bring your own speech
Generate supported WAV/MP3/Ogg/WebM bytes with your speech provider, then pass the audio file to the offline snippet above. For live conversation, use your STT/LLM/TTS pipeline and feed its output into Atlas. Voice-provider fees are separate. Atlas does not generate conversation or captions by itself.
Callbacks
Add X-Callback-URL to the submission headers after support configures webhook signing. Verify the raw request body using the documented HMAC signature, reject stale timestamps, and handle duplicate job events. Keep polling as a fallback; a callback URL alone does not ensure webhook delivery.
History and multiple jobs
GET /v1/jobs lists only the authenticated key’s offline jobs. Request limit=20 and increase offset by the page size until count is smaller than limit. count is page length, not total history. Store each accepted job ID and poll with bounded concurrency and backoff; one polling loop per job can exhaust the same rate budget used for submissions.
Before integrating
- Keep the API key server-side; authenticate your own callers and enforce session ownership.
- Bound uploads, requests, polling deadlines and retries. Validate supported file contents and handle 402, 413, 415 and 429.
- Persist job/session IDs before waiting. Never blindly repeat a billable POST after an ambiguous network response.
- Use expires_in for signed URL validity. It is not a statement of storage retention.
- For realtime, confirm DELETE cleanup. Closing a browser player is not confirmed server teardown.
- The snippets were exercised with deterministic HTTP fixtures. That verifies request and response handling, not GPU output quality or production capacity.