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

# Submit an async finetune job

> Queues a finetune job and returns immediately with its `job_id`. The job runs in a sandbox; poll `GET /v2/finetune/jobs/{job_id}` for its state and result. Accepts the same body as the synchronous endpoint plus an optional `job_options`.



## OpenAPI

````yaml /openapi.json post /v2/finetune/async
openapi: 3.1.0
info:
  title: Nixtla Forecast API
  description: >-
    API for TimeGPT forecast. Just send your data as json and get results. We do
    the heavy lifting.
  version: 0.4.2
servers:
  - url: https://api.nixtla.io
security: []
paths:
  /v2/finetune/async:
    post:
      tags:
        - async jobs
      summary: Submit an async finetune job
      description: >-
        Queues a finetune job and returns immediately with its `job_id`. The job
        runs in a sandbox; poll `GET /v2/finetune/jobs/{job_id}` for its state
        and result. Accepts the same body as the synchronous endpoint plus an
        optional `job_options`.
      operationId: submit_async_finetune_v2_finetune_async_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FinetuneAsyncRequest'
              examples:
                - finetune_steps: 10
                  freq: MS
                  model: timegpt-1
                  series:
                    sizes:
                      - 36
                    'y':
                      - 0
                      - 1
                      - 2
                      - 3
                      - 4
                      - 5
                      - 6
                      - 7
                      - 8
                      - 9
                      - 10
                      - 11
                      - 12
                      - 13
                      - 14
                      - 15
                      - 16
                      - 17
                      - 18
                      - 19
                      - 20
                      - 21
                      - 22
                      - 23
                      - 24
                      - 25
                      - 26
                      - 27
                      - 28
                      - 29
                      - 30
                      - 31
                      - 32
                      - 33
                      - 34
                      - 35
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncJobSubmitResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    FinetuneAsyncRequest:
      properties:
        series:
          $ref: '#/components/schemas/SeriesWithFutureExogenous'
        freq:
          type: string
          title: Freq
          description: >-
            The frequency of the data represented as a string. 'D' for daily,
            'M' for monthly, 'H' for hourly, and 'W' for weekly frequencies are
            available.
        model:
          type: string
          title: Model
          description: >-
            Model to use as a string. Common options are (but not restricted to)
            `timegpt-1` and `timegpt-1-long-horizon`. Full options vary by
            different users. Contact support@nixtla.io for more information. We
            recommend using `timegpt-1-long-horizon` for forecasting if you want
            to predict more than one seasonal period given the frequency of your
            data.
          default: timegpt-1
        finetune_steps:
          type: integer
          minimum: 0
          title: Finetune Steps
          description: >-
            The number of tuning steps used to train the large time model on the
            data. Set this value to 0 for zero-shot inference, i.e., to make
            predictions without any further model tuning.
          default: 10
        finetune_loss:
          type: string
          enum:
            - default
            - mae
            - mse
            - rmse
            - mape
            - smape
            - poisson
          title: Finetune Loss
          description: >-
            The loss used to train the large time model on the data. Select from
            ['default', 'mae', 'mse', 'rmse', 'mape', 'smape', 'poisson']. It
            will only be used if finetune_steps is larger than 0. Default is a
            robust loss function that is less sensitive to outliers.
          default: default
        finetune_depth:
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
          title: Finetune Depth
          description: >-
            The depth of the finetuning. Uses a scale from 1 to 5, where 1 means
            little finetuning, and 5 means that the entire model is finetuned.
            Note that this parameter is only effective for timegpt-1 and
            timegpt-1-long-horizon models; it has no effect on the other models.
            By default, the value is set to 1.
          default: 1
        output_model_id:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z0-9\-_]{1,36}$
            - type: 'null'
          title: Output Model Id
          description: ID to assign to the finetuned model
        finetuned_model_id:
          anyOf:
            - type: string
              pattern: ^[a-zA-Z0-9\-_]{1,36}$
            - type: 'null'
          title: Finetuned Model Id
          description: ID of previously finetuned model
        hist_exog:
          anyOf:
            - items:
                type: integer
                minimum: 0
              type: array
            - type: 'null'
          title: Hist Exog
          description: Zero-based indices of the exogenous features to treat as historical.
        multivariate:
          type: boolean
          title: Multivariate
          description: >-
            Compute multivariate predictions across a batch of multiple time
            series. Requires all time series with overlapping dates. Note that
            this is only effective for timegpt-2.1 model and it has no effect on
            the other models. By default, the value is set to False.
          default: false
        model_parameters:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Model Parameters
          description: >-
            Optional dictionary of parameters to customize the behavior of the
            large time model. 
        job_options:
          anyOf:
            - $ref: '#/components/schemas/AsyncJobOptions'
            - type: 'null'
      type: object
      required:
        - series
        - freq
      title: FinetuneAsyncRequest
    AsyncJobSubmitResponse:
      properties:
        job_id:
          type: string
          title: Job Id
          description: >-
            Identifier for the accepted job. Prefixed per task (e.g. `fc-` for
            forecast).
          examples:
            - fc-4f2a1c9e8b7d4a6f9c3e1b5d7a9f2c4e
      type: object
      required:
        - job_id
      title: AsyncJobSubmitResponse
      description: >-
        The 202 every async submit returns. Shared by all tasks — they differ in
        request, not reply.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SeriesWithFutureExogenous:
      properties:
        X_future:
          anyOf:
            - items:
                items:
                  anyOf:
                    - type: number
                    - type: string
                type: array
              type: array
            - type: 'null'
          title: X Future
          description: >-
            Future values of the exogenous features. Each feature must be a list
            of size number of series times the forecast horizon (h).
        X:
          anyOf:
            - items:
                items:
                  anyOf:
                    - type: number
                    - type: string
                type: array
              type: array
            - type: 'null'
          title: X
          description: >-
            Historic values of the exogenous features. Each feature must be a
            list of the same size as the target (y).
        categorical_exog:
          anyOf:
            - items:
                type: integer
                minimum: 0
              type: array
            - type: 'null'
          title: Categorical Exog
          description: >-
            Zero-based indices of the columns in X that are categorical
            features.
        'y':
          items:
            type: number
          type: array
          title: 'Y'
          description: Historic values of the target.
        sizes:
          items:
            type: integer
          type: array
          title: Sizes
          description: Sizes of the individual series.
        start_datetime:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Start Datetime
          description: >-
            Starting timestamp of each individual series, as ISO 8601 strings
            (for example '2021-01-01' or '2021-01-01T09:30:00'). One entry per
            series, so it must have the same length as `sizes`. Together with
            `sizes` and `freq` this recovers the timestamps of every series.
      type: object
      required:
        - 'y'
        - sizes
      title: SeriesWithFutureExogenous
    AsyncJobOptions:
      properties:
        timeout_seconds:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Timeout Seconds
      additionalProperties: false
      type: object
      title: AsyncJobOptions
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      description: HTTPBearer
      scheme: bearer

````