---
title: "End realtime emotion session"
method: POST
path: "/v2/realtime/session/{session_id}/end"
tags: ["Realtime Emotion API"]
---

# End realtime emotion session

`POST /v2/realtime/session/{session_id}/end`

## Request

- Base URL: `https://api.imentiv.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.imentiv.ai/v2/realtime/session/{session_id}/end`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://api.imentiv.ai/oauth/authorize`
    - Token URL: `https://api.imentiv.ai/oauth/token` scopes: `realtime.write`

End an active realtime emotion session and get session summary.

## Path parameters

- `session_id` string, required: The session ID to end

## Response `200`

Successful Response

- EndSessionResponse: Response model for ending a session.
  - `session_id` string, required: Session identifier that was ended
  - `status` string, required: Final session status
  - `message` string, required: Status message
  - `summary` object, nullable: Session summary with stats (frames processed, emotions detected, etc.)
  - `credits` SessionCredits: What this realtime session cost, and what is left. Covers every part of the session that is charged for, and matches the amount your balance was reduced by.
    - `total_credits` number, required: Total credits charged for this session across all streams. Refunds are not deducted from this figure.
    - `by_type` SessionCreditsByType, required: Per-stream split of a session's credit spend.
      - `session` number: Credits for the live video/audio stream, metered per second
      - `chat` number: Credits for questions asked during the session. 0 if you asked none.
      - `summarization` number: Credits for preparing supporting material supplied with the session. 0 if none was supplied.
    - `balance_remaining` number, required: Caller's credit balance after this session. Reflects the balance the session was metered against: the workspace pool for enterprise workspaces, otherwise the user's own balance.
    - `by_source` SessionCreditsBySource, required: Which credits paid for the session. Always sums to `total_credits`.
      - `plan` number: Credits drawn from your plan's included allowance.
      - `metered` number: Credits drawn from your metered balance: purchased, earned and free credits.
      - `workspace` number: Credits drawn from your workspace's shared credit pool.
      - `unknown` number: Credits whose source was not recorded. Present only for charges made before the source was recorded.
    - `balances` SessionBalances, required: The balance the session was charged against, and whose it is.
      - `owner` 'user' | 'workspace', required: `workspace` when the session was charged to a shared workspace pool, otherwise `user`.
      - `total` number, required: The whole balance. Equals `balance_remaining`. Can be negative.
      - `plan` number, nullable: The part of `total` that is plan allowance. Null for a workspace pool, which has no plan allowance.
      - `metered` number, nullable: The part of `total` that is metered credit. Can be negative. Null for a workspace pool.
    - `settled` boolean: True once the session has ended and every charge for it is included. While false the figures may still rise; fetch `GET /v2/realtime/session/{session_id}/credits` again for the final ones.
    - `pending` string[]: What may still add charges: `live_analysis`, `chat`, `summarization`, or `unknown` for work that could not be identified. Empty does not by itself mean final: check `settled`, which is also false until the session ends.

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-01** `72330e2229c7`: 7 info
  - the endpoint scheme security `ApiKeyAuth` was added to the API
  - the endpoint scheme security `BearerAuth` was added to the API
  - the endpoint scheme security `OAuth2Delegated` was added to the API
  - added the optional property `credits/anyOf[subschema #1: SessionCredits]/pending` to the response with the `200` status
  - …3 more
- **2026-08-28** `3c1aeed97c95`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/changes/v2/realtime/session/:session_id/end/post.md)

---

[API](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai.md) - [All operations](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/revisions/bc15cec7e794?raw)
