Atmee.aiDocs
APIAPI referenceSpeech sessions

Get a speech session

GET
/v1/speech_sessions/{session_id}

Reads a speech session's state and, once it ended, why and what it cost.

  • status is active while the session is reserved or connected, then completed or failed.
  • connectedAt is when billing started, endsAt when the session's time runs out, and endRequestedAt when you ended it with a connection open.
  • Once it ended, endReason says why, and billedSeconds and chargedMicrocredits what it cost (100 microcredits = 1 credit).

Authorization

headerX-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.

Path Parameters

session_id*string

The speech session's id, as POST /v1/speech_sessions returned it.

Formatuuid

Response Body

The session's durable state.

application/json
  1. response
sessionId*string
Formatuuid
status*string
Value in"pending""active""completed""failed"
avatarId?string
Formatuuid
language?string
actualDurationSeconds*integer

The length granted.

createdAt?string
Formatdate-time
connectedAt?string

When billing started (the speech server's first usage report); null until then.

Formatdate-time
endsAt*string

When the session's time runs out (the reservation plus actualDurationSeconds).

Formatdate-time
endRequestedAt?string

When you ended the session while a connection was open; it settles at the connection's next usage report (within 30 s).

Formatdate-time
endedAt?string
Formatdate-time
endReason?string

Why it ended (user_left, max_duration, balance_exhausted, ended_by_api, error, ...; see AvatarSessionStatusResponse.endReason); null while it is live.

failureCode?string
billingMode?stringDeprecated

Deprecated; always metered for a billed session (see EmbedSessionStartResponse.billingMode).

Value in"reserve""metered"
billedSeconds?integer
chargedMicrocredits?integer
Example Request
curl -X GET 'https://api.atmanity.us/v1/speech_sessions/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{  "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",  "status": "pending",  "avatarId": "ac572b6e-802b-4b9e-a602-0786d4441e67",  "language": "string",  "actualDurationSeconds": 0,  "createdAt": "2019-08-24T14:15:22Z",  "connectedAt": "2019-08-24T14:15:22Z",  "endsAt": "2019-08-24T14:15:22Z",  "endRequestedAt": "2019-08-24T14:15:22Z",  "endedAt": "2019-08-24T14:15:22Z",  "endReason": "string",  "failureCode": "string",  "billingMode": "reserve",  "billedSeconds": 0,  "chargedMicrocredits": 0}