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

# Train Site Models

> Train the models for one or more sites, specified by their site_id



## OpenAPI

````yaml post /platform/v2/sites/models/train
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /platform/v2/sites/models/train:
    post:
      tags:
        - Site
      summary: Train Site Models
      description: Train the models for one or more sites, specified by their site_id
      operationId: train_site_models_platform_v2_sites_models_train_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteTrainBulkBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Train Site Models Platform V2 Sites Models Train Post
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationResponse'
      security:
        - APIKeyHeader: []
components:
  schemas:
    SiteTrainBulkBody:
      properties:
        site_ids:
          items:
            type: string
          type: array
          title: Site Ids
          example:
            - 48302759-0371-4d54-9ba1-506708b576fe
            - f02918ab-736b-409f-8f86-cbbeec1d6700
        output_backtest_data:
          type: boolean
          title: Output Backtest Data
          description: >-
            If true, backtest forecasts will be generated for the period of the
            training data
          default: false
          example: false
        splits:
          items:
            $ref: '#/components/schemas/TrainRange'
          type: array
          title: Splits
          example:
            - end_date: 2023-08-01T00:00Z
              start_date: 2023-01-01T00:00Z
            - end_date: 2024-01-01T00:00Z
              start_date: 2023-10-01T00:00Z
        wait:
          type: boolean
          title: Wait
          description: >-
            If true, the request will wait until the training is completed
            before returning
          default: false
      type: object
      required:
        - site_ids
      title: SiteTrainBulkBody
    ValidationResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorItem'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ValidationResponse
    TrainRange:
      properties:
        start_date:
          type: string
          format: date-time
          title: Start Date
        end_date:
          type: string
          format: date-time
          title: End Date
      type: object
      required:
        - start_date
        - end_date
      title: TrainRange
    ErrorItem:
      properties:
        field:
          type: string
          title: Field
        message:
          type: string
          title: Message
      type: object
      required:
        - field
        - message
      title: ErrorItem
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: >-
        Your API key. This is required to access our API programatically. You
        can view your API key in the Rebase dashboard.
      in: header
      name: Authorization

````