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

# Create Training Job

> Create a new training job.

Requirements:
- Dataset must belong to tenant
- Annotation set must be published
- All audio files must have embeddings computed
- At least 5 minutes of total audio



## OpenAPI

````yaml post /api/v1/training-jobs
openapi: 3.1.0
info:
  title: Relay API
  description: Voice AI Artifact Detection Platform
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/training-jobs:
    post:
      tags:
        - training
      summary: Create Training Job
      description: |-
        Create a new training job.

        Requirements:
        - Dataset must belong to tenant
        - Annotation set must be published
        - All audio files must have embeddings computed
        - At least 5 minutes of total audio
      operationId: create_training_job_api_v1_training_jobs_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingJobCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrainingJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    TrainingJobCreate:
      properties:
        dataset_id:
          type: string
          format: uuid
          title: Dataset Id
        annotation_set_id:
          type: string
          format: uuid
          title: Annotation Set Id
        config:
          $ref: '#/components/schemas/TrainingConfig'
      type: object
      required:
        - dataset_id
        - annotation_set_id
        - config
      title: TrainingJobCreate
      description: Request to create a training job.
    TrainingJobResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        tenant_id:
          type: string
          format: uuid
          title: Tenant Id
        dataset_id:
          type: string
          format: uuid
          title: Dataset Id
        annotation_set_id:
          type: string
          format: uuid
          title: Annotation Set Id
        config:
          additionalProperties: true
          type: object
          title: Config
        status:
          type: string
          title: Status
        status_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Message
        progress_percent:
          type: integer
          title: Progress Percent
        metrics:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metrics
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        sagemaker_job_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Sagemaker Job Name
        created_at:
          type: string
          format: date-time
          title: Created At
        queued_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Queued At
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
      type: object
      required:
        - id
        - tenant_id
        - dataset_id
        - annotation_set_id
        - config
        - status
        - status_message
        - progress_percent
        - metrics
        - error_message
        - sagemaker_job_name
        - created_at
        - queued_at
        - started_at
        - completed_at
      title: TrainingJobResponse
      description: Training job response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TrainingConfig:
      properties:
        artifact_types:
          items:
            type: string
          type: array
          minItems: 1
          title: Artifact Types
        epochs:
          type: integer
          maximum: 100
          minimum: 1
          title: Epochs
          default: 20
        validation_split:
          type: number
          maximum: 0.5
          minimum: 0.1
          title: Validation Split
          default: 0.2
        learning_rate:
          type: number
          maximum: 0.1
          minimum: 0.0001
          title: Learning Rate
          default: 0.001
        batch_size:
          type: integer
          maximum: 256
          minimum: 8
          title: Batch Size
          default: 32
        chunk_size_ms:
          type: integer
          title: Chunk Size Ms
          default: 500
        stride_ms:
          type: integer
          title: Stride Ms
          default: 250
      type: object
      required:
        - artifact_types
      title: TrainingConfig
      description: Configuration for a training job.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````