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

# Submit Job

> Submit a new batch job (inline or Drive-based).

- **inline**: provide `inline.messages` with the chat messages
- **drive file**: provide `drive.file_id` — one job is created for that file
- **drive folder**: provide `drive.folder_id` — one job per pending file in folder
- **job_type=auto**: file extension and MIME type determine chat vs. ocr (Drive only)



## OpenAPI

````yaml /api/lapathoniia-openapi.json post /batch/jobs
openapi: 3.1.0
info:
  title: Lapathoniia API
  version: 1.0.0
  description: |-
    Lapathoniia Chat, Batch and User API.

    Base URL: `https://app.lapathoniia.top`

    All endpoints require a Bearer API key except `/health`.
servers:
  - url: https://app.lapathoniia.top
    description: Production
security:
  - bearerAuth: []
paths:
  /batch/jobs:
    post:
      tags:
        - batch
      summary: Submit Job
      description: >-
        Submit a new batch job (inline or Drive-based).


        - **inline**: provide `inline.messages` with the chat messages

        - **drive file**: provide `drive.file_id` — one job is created for that
        file

        - **drive folder**: provide `drive.folder_id` — one job per pending file
        in folder

        - **job_type=auto**: file extension and MIME type determine chat vs. ocr
        (Drive only)
      operationId: submit_job_batch_jobs_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitJobRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SubmitJobRequest:
      properties:
        job_type:
          type: string
          pattern: ^(chat|ocr|auto)$
          title: Job Type
          description: '''chat'', ''ocr'', or ''auto'' (detect from file)'
        model:
          anyOf:
            - type: string
            - type: 'null'
          title: Model
          description: LiteLLM model name; defaults to model for job_type
        inline:
          anyOf:
            - $ref: '#/components/schemas/InlineInput'
            - type: 'null'
          description: Inline chat messages
        drive:
          anyOf:
            - $ref: '#/components/schemas/DriveInput'
            - type: 'null'
          description: Google Drive input
        priority:
          type: integer
          maximum: 100
          minimum: 1
          title: Priority
          description: Lower = processed sooner
          default: 10
        max_retries:
          type: integer
          maximum: 10
          minimum: 0
          title: Max Retries
          default: 3
        pipeline:
          anyOf:
            - type: string
              pattern: ^ocr_then_chat$
            - type: 'null'
          title: Pipeline
          description: '''ocr_then_chat'' — run OCR then pass result to LLM'
        pipeline_instruction:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Pipeline Instruction
          description: Task for the LLM step in the pipeline
      type: object
      required:
        - job_type
      title: SubmitJobRequest
      description: Request body for POST /batch/jobs.
    JobStatusResponse:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
        job_type:
          type: string
          title: Job Type
        model:
          type: string
          title: Model
        input_type:
          type: string
          title: Input Type
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        priority:
          type: integer
          title: Priority
        retry_count:
          type: integer
          title: Retry Count
        max_retries:
          type: integer
          title: Max Retries
        result:
          anyOf:
            - type: object
            - type: 'null'
          title: Result
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        drive_folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Drive Folder Id
        drive_result_file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Drive Result File Id
        pipeline:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipeline
        pipeline_instruction:
          anyOf:
            - type: string
            - type: 'null'
          title: Pipeline Instruction
        parent_job_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Job Id
        created_at:
          type: string
          title: Created At
        started_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Completed At
      type: object
      required:
        - id
        - status
        - job_type
        - model
        - input_type
        - filename
        - priority
        - retry_count
        - max_retries
        - result
        - error
        - drive_folder_id
        - drive_result_file_id
        - pipeline
        - pipeline_instruction
        - parent_job_id
        - created_at
        - started_at
        - completed_at
      title: JobStatusResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InlineInput:
      properties:
        messages:
          items:
            type: object
          type: array
          minItems: 1
          title: Messages
      type: object
      required:
        - messages
      title: InlineInput
      description: Direct message list for chat jobs.
    DriveInput:
      properties:
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
          description: Single Drive file ID
        folder_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Folder Id
          description: Drive folder ID — enqueues all pending files
      type: object
      title: DriveInput
      description: Google Drive file or folder for batch processing.
    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:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sk-...

````