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

# Generate Forecast

> Invokes the endpoint to generate a forecast based on the trained model specified by its ID.



## OpenAPI

````yaml openapi-forecaster POST /forecaster/{id}/forecast
openapi: 3.0.1
info:
  title: Omnifuel Forecasting
  description: The forecasting API
  version: 1.0.0
servers:
  - url: https://api.omnifuel.ai/v1
security:
  - api_key: []
    bearerAuth: []
paths:
  /forecaster/{id}/forecast:
    post:
      summary: Generate forecast
      description: >-
        Invokes the endpoint to generate a forecast based on the trained model
        specified by its ID.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the trained model to be used for forecasting.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                steps:
                  type: number
                  description: Number of forecast steps to predict.
                dataset:
                  type: string
                  description: >-
                    Location of the dataset to be used for generating the
                    forecast.
                dataset_format:
                  type: string
                  enum:
                    - csv
                    - parquet
                  default: csv
                  description: Format of the dataset.
              required:
                - steps
                - dataset
      responses:
        '200':
          description: Forecast generated successfully
          content:
            application/json:
              schema:
                type: string
                description: The forecast data in JSON format.
              example: '[{"step":1,"value":123.45},{"step":2,"value":130.67}]'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: Model with ID abc1234-5678-9101-1121-314151617181 not found.
        '500':
          description: Error generating forecast
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: boolean
                example:
                  message: Error invoking forecast endpoint
                  error: true
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````