# Read a speech session's state, end reason and cost

URL: https://www.atmee.ai/docs/v2/api/reference/speech-sessions/getSpeechSession

`GET /v1/speech_sessions/{session_id}`

`status` is `active` while the session is reserved or connected,
then `completed` or `failed`. `connectedAt` is when billing started
(the speech server's first usage report), `endsAt` when the session's
time runs out, `endRequestedAt` when you ended it while a connection
was open (until its next usage report settles it). Once it ended,
`endReason` says why and `billedSeconds` / `chargedMicrocredits` what
it cost (100 microcredits = 1 credit).

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `session_id` | path | yes | The speech session's id, as `POST /v1/speech_sessions` returned it. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | The session's durable state. | `SpeechSessionStatusResponse` |
| `400` | Both `X-Api-Key` and `Authorization` sent where the deployment accepts user tokens; send one. | none |
| `401` | Missing or invalid API key -- or a user token that is invalid, anonymous, or of a user who may act for no account (invalid_login) | none |
| `403` | `forbidden` — the session belongs to another account \| `avatar_not_allowed` — the session is not on this key's avatar \| `insufficient_scope` — the API key lacks the `sessions` scope \| account_not_allowed | `ApiErrorResponse` |
| `404` | `not_found` — no such speech session | `ApiErrorResponse` |
| `409` | account_ambiguous -- a user token of a user who may act for several accounts, without an `X-Account-Id` header naming one. | `ApiErrorResponse` |
| `503` | `speech_unavailable` — speech sessions are not configured on this deployment | `ApiErrorResponse` |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sessionId` | string | yes |  |
| `status` | string (`pending`, `active`, `completed`, `failed`) | yes |  |
| `avatarId` | string | no |  |
| `language` | string | no |  |
| `actualDurationSeconds` | integer | yes | The length granted. |
| `createdAt` | string | no |  |
| `connectedAt` | string | no | When billing started (the speech server's first usage report); null until then. |
| `endsAt` | string | yes | When the session's time runs out (the reservation plus `actualDurationSeconds`). |
| `endRequestedAt` | string | no | When you ended the session while a connection was open; it settles at the connection's next usage report (within 30 s). |
| `endedAt` | string | no |  |
| `endReason` | string | no | Why it ended (`user_left`, `max_duration`, `balance_exhausted`, `ended_by_api`, `error`, ...; see AvatarSessionStatusResponse.endReason); null while it is live. |
| `failureCode` | string | no |  |
| `billingMode` | string (`reserve`, `metered`) | yes |  |
| `billedSeconds` | integer | no |  |
| `chargedMicrocredits` | integer | no |  |
