> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Start recording

> Start recording a stream. 

  


Stream will be recorded and automatically saved in our video hosting as a separate video VOD:
- ID of the stream from which the recording was organized is added to "stream_id" field. You can find the video by that value later.
- Title of the video is based on pattern "Stream Record: {`stream_title`}, {`recording_end_time_utc`}".
- Recording start time is stored in "recording_started_at" field.
- You can record the original stream or the transcoded one. Only the transcoded version will contain overlays. Set the appropriate recording method when creating the stream or before calling this recording method. Details in the "record_type" parameter of the stream.
- If you have access to the premium feature of saving the original stream (so not just transcoded renditions), then the link to the original file will be in the "origin_url" field. The original file is stored for up to 7 days and is then deleted automatically. By default, custom retention for original recorded files is not available. For enterprise customers, this retention policy can be adjusted individually upon request. Look at the description of the field how to use it. 

Stream must be live for the recording to start, please check fields "live" and/or "backup_live". After the recording starts, field "recording" will switch to "true", and the recording duration in seconds will appear in the "recording_duration" field. 

Please, keep in mind that recording doesn't start instantly, it takes ±3-7 seconds to initialize the process after executing this method.

  


Stream recording stops when:

- Explicit execution of the method /`stop_recording`. In this case, the file will be completely saved and closed. When you execute the stream recording method again, the recording will be made to a new video file.
- When sending the stream stops on the client side, or stops accidentally. In this case, recording process is waiting for 10 seconds to resume recording:

 - If the stream resumes within that period, recording will continue to the same file.
- After that period, the file will be completely saved and closed.
- If the stream suddenly resumes after this period, the recording will go to a new file, because old file is closed already.
Please, also note that if you have long broadcasts, the recording will be cut into 4-hour videos. This value is fixed, but can be changed upon request to the Support Team.



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml put /streaming/streams/{stream_id}/start_recording
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Streaming API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-14T07:00:22.640261+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
    x-displayName: AI
  - name: Broadcasts
    x-displayName: Broadcasts
  - name: Directories
    x-displayName: Directories
  - name: Overlays
    x-displayName: Overlays
  - name: Players
    x-displayName: Players
  - name: Playlists
    x-displayName: Playlists
  - name: QualitySets
    x-displayName: QualitySets
  - name: Restreams
    x-displayName: Restreams
  - name: Streaming Statistics
    x-displayName: Statistics
  - name: Streams
    x-displayName: Streams
  - name: Subtitles
    x-displayName: Subtitles
  - name: Videos
    x-displayName: Videos
paths:
  /streaming/streams/{stream_id}/start_recording:
    put:
      tags:
        - Streams
      summary: Start recording
      description: >-
        Start recording a stream. 

          


        Stream will be recorded and automatically saved in our video hosting as
        a separate video VOD:

        - ID of the stream from which the recording was organized is added to
        "stream_id" field. You can find the video by that value later.

        - Title of the video is based on pattern "Stream Record:
        {`stream_title`}, {`recording_end_time_utc`}".

        - Recording start time is stored in "recording_started_at" field.

        - You can record the original stream or the transcoded one. Only the
        transcoded version will contain overlays. Set the appropriate recording
        method when creating the stream or before calling this recording method.
        Details in the "record_type" parameter of the stream.

        - If you have access to the premium feature of saving the original
        stream (so not just transcoded renditions), then the link to the
        original file will be in the "origin_url" field. The original file is
        stored for up to 7 days and is then deleted automatically. By default,
        custom retention for original recorded files is not available. For
        enterprise customers, this retention policy can be adjusted individually
        upon request. Look at the description of the field how to use it. 


        Stream must be live for the recording to start, please check fields
        "live" and/or "backup_live". After the recording starts, field
        "recording" will switch to "true", and the recording duration in seconds
        will appear in the "recording_duration" field. 


        Please, keep in mind that recording doesn't start instantly, it takes
        ±3-7 seconds to initialize the process after executing this method.

          


        Stream recording stops when:


        - Explicit execution of the method /`stop_recording`. In this case, the
        file will be completely saved and closed. When you execute the stream
        recording method again, the recording will be made to a new video file.

        - When sending the stream stops on the client side, or stops
        accidentally. In this case, recording process is waiting for 10 seconds
        to resume recording:

         - If the stream resumes within that period, recording will continue to the same file.
        - After that period, the file will be completely saved and closed.

        - If the stream suddenly resumes after this period, the recording will
        go to a new file, because old file is closed already.

        Please, also note that if you have long broadcasts, the recording will
        be cut into 4-hour videos. This value is fixed, but can be changed upon
        request to the Support Team.
      operationId: put_streams_id_start_recording
      parameters:
        - name: stream_id
          in: path
          description: ID of a stream to record
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: >-
            Recording task was set successfully, but there are some actions you
            need to pay attention
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    description: Stream data
                    properties:
                      stream:
                        $ref: '#/components/schemas/startRecordingStream'
                  warnings:
                    type: array
                    description: List of warnings received on starting recording process
                    items:
                      type: object
                      oneOf:
                        - $ref: >-
                            #/components/schemas/clientStorageAlmostExceededWarning
                  errors:
                    type: array
                    description: >-
                      List of errors received on attempt to start recording
                      process
                    items:
                      type: object
        '204':
          description: Recording task was set successfully, no extra actions needed
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/notfound'
        '422':
          description: |-
            Possible error messages:   
             **{ "errors": { "name": [ "Error text: No space for recording the stream." ] } }**   
             *Name* is a required parameter, so it must be specified
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            response = client.streaming.streams.start_recording(
                0,
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Streaming.Streams.StartRecording(context.TODO(), 0)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
components:
  schemas:
    startRecordingStream:
      type: object
      properties:
        id:
          type: integer
          description: Stream ID
          example: 123
        client:
          type: object
          properties:
            id:
              type: integer
              description: Client ID
              example: 777
            storage_usage_mb:
              type: number
              description: Current storage usage for client by megabytes
              example: 2048
            storage_limit_mb:
              type: integer
              description: Current storage limit for client by megabytes
              example: 10240
    clientStorageAlmostExceededWarning:
      type: object
      properties:
        key:
          type: string
          description: current warning key
          enum:
            - client_storage_almost_exceeded
          example: client_storage_almost_exceeded
        source_object:
          type: object
          description: Warning source object
          properties:
            id:
              type: integer
              description: Client ID
              example: 918
            type:
              type: string
              description: Object type (class)
              enum:
                - client
              example: client
        meta:
          type: object
          description: storage usage state for client
          properties:
            storage_usage_mb:
              type: number
              description: Current storage usage for client by megabytes
              example: 1200
            storage_limit_mb:
              type: integer
              description: Current storage limit for client by megabytes
              example: 2048
    notfound:
      allOf:
        - $ref: '#/components/schemas/badrequest'
        - example:
            status: 404
            error: >-
              Not Found. Entity you are looking for was not found, please check
              the initial parameters
    badrequest:
      type: object
      properties:
        status:
          type: integer
          description: Error number
        error:
          type: string
          description: Error message
      example:
        status: 400
        error: >-
          Bad Request response status code indicates that the server cannot or
          will not process the request due to something that is perceived to be
          a client error (for example, malformed request syntax, invalid request
          message framing, or deceptive request routing).
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````