End an avatar session
Ends an API session now and stops billing. It settles completed with
endReason: ended_by_api. For a conversation, this is the same as POST /v1/sessions/{id}/end with an API key.
- Idempotent: a session that already ended answers
200withalreadyEnded: true, so it is safe to call from every teardown path. - Renders usually end on their own when your agent leaves, the room closes or you remove the avatar participant. Call this to stop paying while your room stays open; it does not remove the avatar from your room, so remove the participant yourself.
- Conversations: the room is closed.
- Only sessions started through the API can be ended here (website
sessions are
404), and an avatar-scoped key ends only its avatar's.
X-Api-Key<token>Your secret API key (sk_atmee_...; older keys start sk_live_),
sent as X-Api-Key. Keep it on your server and never send it to a
browser.
id*stringThe avatar session id (sessionId from the create response).
uuidThe session is ended (or already was).
application/json- response
sessionId*stringuuidstatus*string"completed""failed"endedAt?stringdate-timealreadyEnded*booleanTrue when the session was already terminal before this call.
endReason?stringWhy the session ended: ended_by_api for this call, or the
earlier reason when it had already ended (see
AvatarSessionStatusResponse.endReason).
curl -X POST 'https://api.atmanity.us/v1/avatar_sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08/end'{ "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459", "status": "completed", "endedAt": "2019-08-24T14:15:22Z", "alreadyEnded": true, "endReason": "string"}Get an avatar session GET
Reads an API session's state, end reason and cost: a conversation (POST /v1/sessions, kind: conversation) or a render (POST /v1/avatar_sessions, kind: render).
Start a speech session POST
Starts a realtime speech-to-speech conversation with an avatar over a WebSocket, without video.

