> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Stream

> Close and finalize a stream

<Info>
  **Product**: Video Datalake
  **Host**: `https://api.memories.ai/datalake/v1`
  **Auth**: `Authorization: sk-mai-...`
</Info>

Close a live session and finalize its video. The video transitions to `ready` (duration fixed to indexed content) and behaves exactly like an uploaded video thereafter.

<Note>
  **Custom method `:close`** — this is an action on the resource, not standard CRUD. Call it exactly as `POST /datalake/v1/streams/{session_id}:close`.
</Note>

<Note>
  **Pricing:** \$0.04 / minute streamed · See [Pricing](/datalake/pricing) for the full model.
</Note>

## Response Fields

<ResponseField name="status" type="string">`ready` after finalize.</ResponseField>
<ResponseField name="operation" type="string">Finalize Operation handle.</ResponseField>


## OpenAPI

````yaml POST /datalake/v1/streams/{session_id}:close
openapi: 3.1.0
info:
  title: Memories.ai DataLake API 2.0
  version: 2026-08
  description: OpenAPI mapping used by Mintlify Try it for the DataLake API 2.0 docs.
servers:
  - url: https://api.memories.ai
security:
  - ApiKeyAuth: []
paths:
  /datalake/v1/streams/{session_id}:close:
    post:
      tags:
        - Live Stream
      summary: Close and finalize a stream
      description: >-
        Close a live session and finalize its video. The video transitions to
        `ready` (duration fixed to indexed content) and behaves exactly like an
        uploaded video thereafter.
      operationId: close_stream
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
          description: Session ID from Open Stream.
      responses:
        '200':
          description: Success
          content:
            application/json:
              example:
                session_id: 3f2a...
                video_id: vid_live1
                status: ready
                operation: op_yyy
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Send `Authorization: sk-mai-...`'

````