Atmee.aiDocs

How the API works

Put a live video agent in your own product. Your server holds the key, Atmee runs the avatar, LiveKit carries the video.

New to Atmee? What is Atmee explains what it does, and Models compares Atmee V2 and Atmee V1.

The Atmee API does two things:

  • Live conversations. Real-time spoken conversations with your users, in one of three modes (below).
  • Video generation. An image and a prompt in, a short video clip out, with no avatar or conversation behind it. See Video generation.

The same credits pay for both.

Three modes

The mode is the endpoint you call.

  • Behavior-driven Full-stack (POST /v1/sessions). Atmee runs the whole conversation: behavior (powered by Causeur, our behavior model), the language model, speech recognition, the voice and the face. You run your page and one server endpoint. The rest of this page describes this mode.
  • Avatar-only (the LiveKit Agents plugin, or POST /v1/avatar_sessions). You bring your own voice agent with its own speech recognition, language model and voice; Atmee renders only the face, in sync with your agent's audio.
  • Behavior-driven Voice-only (POST /v1/speech_sessions). Atmee runs the conversation with Causeur and the avatar's voice, with no video. Your client streams audio over a WebSocket. See the API reference.

Behavior-driven Full-stack and Avatar-only run on the avatar's model, Atmee V2 or Atmee V1; Models compares the two. To pick a mode, see Choose your integration.

API version and model

Every endpoint starts with /v1. That is the version of the API itself, and it has nothing to do with the avatar's model:

  • /v1 in a path is the API version. All endpoints share it, and they work the same for every avatar.
  • Atmee V1 and Atmee V2 are the two models an avatar can run on. The model is set once, with engine ("v1" or "v2") when you create the avatar, and every session with that avatar uses it.

So POST /v1/sessions starts a conversation with an Atmee V2 avatar just as it does with an Atmee V1 one. To find an avatar's model, read engine on GET /v1/avatars/{avatarId}.

What each option costs

OptionModelStart withCreditsPlans
Behavior-driven Full-stackAtmee V2 HDPOST /v1/sessions3 credits per minuteEvery plan; building it: Growth and up
Behavior-driven Full-stackAtmee V2POST /v1/sessions2 credits per minuteEvery plan; building it: Pro and up
Behavior-driven Full-stackAtmee V1POST /v1/sessions1 credit per minuteEvery plan, Free included
Avatar-onlyAtmee V2 HDLiveKit Agents plugin2 credits per minuteEvery plan; building it: Growth and up
Avatar-onlyAtmee V2LiveKit Agents plugin1.5 credits per minuteEvery plan; building it: Pro and up
Avatar-onlyAtmee V1LiveKit Agents plugin0.5 credits per minuteEvery plan, Free included
Behavior-driven Voice-onlyAnyPOST /v1/speech_sessions1 credit per minuteEvery plan, Free included
Video generationAnyPOST /v1/generation/clipsFrom 0.1 credit per clip, by size and length (up to 2 at 720p)Every plan, Free included

Every account has API access, whatever its plan. See Costs and Plans.

Four pieces

A conversation on your own page involves four pieces. You build the server endpoint; Atmee provides the rest.

PieceWho runs itWhat it does
Your pageYouShows the avatar's video and streams the user's microphone. Never sees your API key.
Your serverYouHolds the API key. Exposes the endpoint your page calls to start and end a session.
Atmee APIAtmeeChecks the key, reserves credits, creates the room and puts the avatar in it.
LiveKitAtmeeReal-time video and audio. Your page connects with a short-lived token.

How a session runs

  1. The user clicks to start, and your page calls your server.
  2. Your server calls POST /v1/sessions with the X-Api-Key header and the avatarId. Call it from your server only: a key in page JavaScript can be read by every visitor.
  3. The API answers once the avatar is in the room, usually in 15 to 20 seconds, with sessionId, serverUrl and userToken. Your server keeps sessionId and passes serverUrl and userToken to the page.
  4. The page joins the room with livekit-client. The user must join within 60 seconds, or the session ends as no_user_joined and nothing is charged.
  5. When the conversation is over, or the page closes, your server calls POST /v1/sessions/{id}/end. It's safe to call twice. Billing stops when either side leaves.

One conversation per avatar. A second start on a busy avatar answers 409 avatar_busy; see Troubleshooting. The whole flow, with code, is in the Quickstart.

What your app can do in the room

A Behavior-driven Full-stack session is more than a video call: your app and the avatar work together while it runs.

  • Tell it what's true now. Send state (the cart, a quiz score, the slide on screen) and the avatar answers from it. Send an event and it remarks on it in its own words.
  • Let it act on your app. Declare up to 30 app tools when you start the session, in OpenAI's function format. The avatar calls them on your page and can wait for the result before it replies.
  • Show it files. The user drops an image or a document into the call (a CV, a photo, a screenshot) and the avatar talks about it.
  • Talk or type. The user can speak, type, or both. Captions for both sides arrive in the room.
  • Follow an agenda. For an interview, a lesson or an onboarding, give an Atmee V2 avatar a conductor graph and it moves through the steps on its own. See Set the conductor.
  • Remember returning users. With a key that has cross-visit memory turned on, pass a visitorId your server derives, and the avatar picks up where it left off.

Video generation

Not every video needs a live conversation. POST /v1/generation/clips turns an image and a prompt, with optional audio, into a downloadable mp4 of 1 to 15 seconds, with no avatar or session behind it. It costs from 0.1 up to 2 credits per clip, by length and size, charged only when the clip comes back, on every plan, Free included. Fields, timing, sizes and errors are in Video generation.

Beyond sessions

The same API manages everything around the conversation:

  • Avatars. Create one from a portrait, a voice sample, a persona and knowledge files. Update its persona, replace its portrait, voice or knowledge, or delete it. An Atmee V2 avatar can be captured as several takes, and you keep the one you like best. See Create an avatar.
  • Generation. Generate a portrait from a description, enhance a photo, or design a voice from a description. Paid plans include a free generation quota every billing cycle (3 on Starter, up to 50 on Scale); after that, generation is paid in credits. See Generation for prices. Uploading your own photo and voice is always free.
  • Keys and billing. Create, rotate and revoke keys, and read your balance and plan limits.

What a key may do is set by its scopes when you create it; most apps need only sessions. See API keys.

Who pays

Sessions started with your key are billed to your account's credits. Your users need no Atmee account and are never charged. You set your own price for your product and keep what your users pay you.

Each key can carry its own limits so a busy page cannot run up an unlimited bill: a spend cap (total, monthly or daily), a max session length and a max concurrent sessions limit.

Sessions through your key never earn creator earnings: those are paid only for conversations with Signature avatars on atmee.ai.

Costs

Everything is paid in credits, and 1 credit is 1 minute of Atmee V1 in Behavior-driven Full-stack. Sessions are billed by the second at a per-minute rate, only while both the user and the avatar are in the room; the rate for each option is in the table above. One credit balance covers every model and mode.

A credit costs about 12 to 15 US cents, depending on your plan.

Nothing is charged for a session nobody joined, a start refused for capacity (503 no_capacity), or an avatar that isn't ready yet.

Plans

Every account has API access, whatever its plan, Free included. Every credit pays for every model, each at its own rate, and anyone can talk to any avatar (Atmee V1, Atmee V2 or Atmee V2 HD). Video clips are on every plan too. Creating an Atmee V2 avatar (a new avatar, or a copy onto Atmee V2) needs Pro and up; GET /v1/account's v2Access says whether the account has it. Without it, the create answers 403 v2_access_required. Creating an Atmee V2 HD avatar needs Growth and up (limits.v2Pro), and without it the create answers 403 v2hd_access_required. Atmee V2 and Atmee V2 HD avatars the account already owns keep chatting, sharing and embedding on every plan. Editing them (new takes, versions, portrait, voice and size) needs Pro and up for Atmee V2 and Growth and up for Atmee V2 HD, or an active unlock (limits.v2Unlock); otherwise an edit answers 403 v2_view_only or 403 v2hd_view_only. Prices, credits and limits for each plan are on the pricing page.

Running low

  • No overage charges. You pay your plan and only the add-on credit packs you choose.
  • At zero, sessions end and new ones can't start. Buy an add-on credit pack under Billing in Studio.
  • Plan credits reset each month. Add-on credit pack credits stay valid for 12 months from purchase.

A per-key spend cap stops a key before it drains your balance. See API keys.

What you need

  • An Atmee account. To create Atmee V2 avatars, Pro and up (Atmee V2 HD: Growth and up).
  • An avatar your account owns that has finished building. Any visibility works, and you can create one through the API.
  • A server that can keep a secret. A serverless function is fine.

Questions? Email support@atmee.ai or ask on our Discord server.

Next steps