# callyourai > Real-time talking avatars for LiveKit voice agents. You upload one photo; the avatar joins your LiveKit > room as its own participant and speaks with your agent's voice, lips in sync. Prepaid credits in US > dollars, billed per second while the avatar's video is live. API base: https://api.callyour.ai Machine-readable API: https://api.callyour.ai/openapi.json Auth: `Authorization: Bearer ` on everything except sign-up. Errors: JSON `{"error": {"code", "message", "next"}}`. `next` names the call that fixes the problem; follow it. ## From nothing to an avatar: three calls 1. Sign up. No browser, no email click. The key is shown once; store it as `CALLYOURAI_API_KEY`. curl -X POST https://api.callyour.ai/v1/signup -H 'content-type: application/json' \ -d '{"email":"you@example.com"}' # -> {"api_key": "...", "account_id": "..."} 2. Buy credits. The answer has a hosted payment `checkout_url`. Pay it yourself if you have a payment tool, otherwise give the link to your human. Poll `GET /v1/balance` until the money is there. curl -X POST https://api.callyour.ai/v1/credits/checkout -H "authorization: Bearer $CALLYOURAI_API_KEY" \ -H 'content-type: application/json' -d '{"amount_usd":10}' 3. Create an avatar from a photo: one face, frontal, head and shoulders. Give `image_url` or `image_base64`. The answer is `processing`; poll `GET /v1/avatars/{id}` until `status` is `ready` (about 20 seconds) or `failed` (then `error` says what is wrong with the photo). curl -X POST https://api.callyour.ai/v1/avatars -H "authorization: Bearer $CALLYOURAI_API_KEY" \ -H 'content-type: application/json' \ -d '{"name":"Me","tier":"premium","image_url":"https://example.com/me.jpg"}' ## Use the avatar in a LiveKit agent (Python) pip install livekit-plugins-callyourai ```python from livekit.agents import AgentSession, room_io from livekit.plugins import callyourai async def entrypoint(ctx): await ctx.connect() session = AgentSession(stt=..., llm=..., tts=...) avatar = callyourai.AvatarSession(avatar_id="YOUR_AVATAR_ID") # reads CALLYOURAI_API_KEY await avatar.start(session, room=ctx.room) # before session.start await session.start(agent=MyAgent(), room=ctx.room, room_options=room_io.RoomOptions(audio_output=False)) ``` Rules that matter: - Call `avatar.start` before `session.start`, and pass `audio_output=False`: the avatar publishes the voice, the agent must not publish its own. - The avatar is a second participant with identity `callyourai-avatar`. Frontends should show its video track and play its audio track. - `avatar.start` raises `callyourai.CallyouraiError`; `.code` is `insufficient_credits` (buy credits), `no_capacity` (retry after the `Retry-After` seconds), `conflict` (avatar not ready yet) or `not_found`. - `await avatar.set_mood("happy")` changes the expression at the next sentence (premium tier). - The session ends and billing stops when the room closes or you call `await avatar.aclose()`. - The agent needs `LIVEKIT_URL`, `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET` as usual. ## Without the plugin `POST /v1/sessions` with `{"avatar_id", "livekit_url", "livekit_token"}`. The token is for the avatar participant: room join, publish allowed, kind `agent`, attribute `lk.publish_on_behalf` = your agent's identity. Send the agent's audio to that identity with LiveKit's `DataStreamAudioOutput`. `DELETE /v1/sessions/{id}` ends it. ## Prices - premium: $0.1 per minute, billed per second - standard: $0.05 per minute, billed per second Credits (the more you pay at once, the more you get): - pay $10, get $10 - pay $50, get $55 - pay $200, get $230 - pay $1000, get $1200 ## Other calls - `GET /v1/balance`: balance, prices and packs. - `GET /v1/usage`: sessions with billed seconds, and purchases. - `GET /v1/avatars`, `DELETE /v1/avatars/{id}`. - `GET /v1/keys`, `POST /v1/keys`, `DELETE /v1/keys/{id}`. ## Contact Questions, problems, higher volumes: [support@callyour.ai](mailto:support@callyour.ai)