API Documentation

Complete guide to integrate with OH Digital Twin APIs

Character Management

Media APIs

Interactive Cam Avatars

API Overview

RESTful API for AI character creation and media generation. All requests require authentication.

Base URL

https://api.oh.xyz

Authentication

API Key (Required)

Include your API key in the X-API-Key header for all requests.

X-API-Key: your_api_key_here

API keys are issued to approved partners only. Contact support for access.

HTTP Status Codes

Standard Responses

200Success
201Resource created successfully
202Async job accepted and queued
400Bad request (invalid input or moderation failure)
401Unauthorized (invalid credentials)
404Resource not found
500Internal server error

Error Format

All errors return JSON with an error message:

{
  "error": "Error description"
}
Common Errors
400Moderation failure or invalid input
404Resource not found (invalid ID)
500Processing failed (check job status)

Best Practices

Guidelines

Room Management

Reuse rooms for conversations. Don't create new rooms per message—this maintains context.

Presigned URLs

URLs expire quickly. Download generated content immediately and store in your infrastructure.

Error Handling

Always check status codes. Implement retry logic for transient errors (5xx).

Async Operations

1. Submit Request

POST to /api/v1/images. Store the job_id and presigned_url.

2. Poll Status

GET /api/v1/jobs/{job_id}/status every 2-5s until status is completed or failed.

3. Download Result

Fetch from presigned URL when completed. Set max polling time (5min) to avoid infinite loops.

Content Moderation

Prompts are automatically screened. Policy violations return 400 with moderation error.

Media APIs

Interactive Cam Avatars

Real-time avatar conversations powered by Trulience. Your REST endpoint receives webhook events (LOGIN, CHAT, LOGOUT) and returns responses that the avatar speaks aloud. Supports proactive messaging and session management.

Webhook Events

Your REST endpoint receives these events during user interactions:

LOGIN

User joins conversation - store sessionId for subsequent requests

CHAT

User sends message - expects avatar response within reply field

LOGOUT

User disconnects - clean up session resources

Webhook Handlers

Proactive Messaging

Security

Webhook requests include:

  • •Authorization Header: Bearer your-api-key-here
  • •Content-Type: application/json
  • •HTTPS Required: All communication must use secure HTTPS connections

Response Time

CHAT events require fast responses to maintain natural conversation flow. Recommended: <2 seconds