> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-docs-prisma-airs-updates.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create fine tuning job



## OpenAPI

````yaml https://raw.githubusercontent.com/PaloAltoNetworks/openapi/refs/heads/main/openapi.yaml post /fine_tuning/jobs
openapi: 3.0.0
info:
  title: Prisma AIRS AI Gateway API
  version: 3.0.0
  description: ''
servers:
  - url: https://aigw.portkey.ai/v1
    description: Managed
  - url: https://self-hosted-gateway-url.example.com/v1
    description: Self-hosted -- replace with your own gateway host
security:
  - Authorization: []
tags:
  - name: Assistants
    description: ''
  - name: Audio
    description: ''
  - name: Batch
    description: ''
  - name: Chat
    description: ''
  - name: Completions
    description: ''
  - name: Embeddings
    description: ''
  - name: Files
    description: ''
  - name: Fine-Tuning
    description: ''
  - name: Images
    description: ''
  - name: Model Pricing
    description: ''
  - name: Models
    description: ''
  - name: Moderations
    description: ''
  - name: OCR
    description: ''
  - name: Realtime
    description: ''
  - name: Rerank
    description: ''
  - name: Responses
    description: ''
  - name: Vector Stores
    description: ''
  - name: Configs
    description: ''
  - name: Guardrails
    description: ''
  - name: Integrations
    description: ''
  - name: Integrations > Models
    description: ''
  - name: Integrations > Workspaces
    description: ''
  - name: Providers
    description: ''
  - name: Secret References
    description: ''
  - name: MCP Integrations
    description: ''
  - name: MCP Integrations > Capabilities
    description: ''
  - name: MCP Integrations > Metadata
    description: ''
  - name: MCP Integrations > Workspaces
    description: ''
  - name: MCP Servers
    description: ''
  - name: MCP Servers > Capabilities
    description: ''
  - name: MCP Servers > Connections
    description: ''
  - name: MCP Servers > User Access
    description: ''
  - name: API Keys
    description: ''
  - name: Deployments
    description: ''
  - name: Org Guardrails
    description: ''
  - name: Rate Limit Policies
    description: ''
  - name: Usage Limit Policies
    description: ''
  - name: Analytics > Graphs
    description: ''
  - name: Analytics > Groups
    description: ''
  - name: Analytics > Summary
    description: ''
  - name: Feedback
    description: ''
  - name: Logs
    description: ''
paths:
  /fine_tuning/jobs:
    post:
      tags:
        - Fine-Tuning
      operationId: createFineTuningJob
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/OpenAIFinetuneJob'
                - $ref: '#/components/schemas/BedrockFinetuneJob'
                - $ref: '#/components/schemas/PortkeyFinetuneJob'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FineTuningJob'
components:
  schemas:
    OpenAIFinetuneJob:
      type: object
      title: OpenAI Params
      required:
        - model
        - training_file
        - suffix
        - method
      properties:
        model:
          type: string
        training_file:
          type: string
        validation_file:
          type: string
        suffix:
          type: string
        method:
          type: object
          properties:
            type:
              type: string
              enum:
                - supervised
                - dpo
            supervised:
              type: object
              properties:
                hyperparameters:
                  type: object
                  properties:
                    n_epochs:
                      type: integer
                      format: int32
                    learning_rate_multiplier:
                      type: number
                      format: float
                    batch_size:
                      type: integer
                      format: int32
                  required:
                    - n_epochs
                    - learning_rate_multiplier
                    - batch_size
              required:
                - hyperparameters
            dpo:
              type: object
              properties:
                hyperparameters:
                  type: object
                  properties:
                    n_epochs:
                      type: integer
                      format: int32
                    learning_rate_multiplier:
                      type: number
                      format: float
                    batch_size:
                      type: integer
                      format: int32
                  required:
                    - n_epochs
                    - learning_rate_multiplier
                    - batch_size
              required:
                - hyperparameters
          required:
            - type
    BedrockFinetuneJob:
      type: object
      title: Bedrock Params
      properties:
        job_name:
          type: string
        role_arn:
          type: string
        output_file:
          type: string
      allOf:
        - $ref: '#/components/schemas/OpenAIFinetuneJob'
    PortkeyFinetuneJob:
      type: object
      properties:
        job_name:
          type: string
        role_arn:
          type: string
        output_file:
          type: string
        portkey_options:
          allOf:
            - $ref: '#/components/schemas/PortkeyOptions'
        provider_options:
          allOf:
            - $ref: '#/components/schemas/BedrockParams'
      allOf:
        - $ref: '#/components/schemas/OpenAIFinetuneJob'
      title: Portkey Params
    FineTuningJob:
      type: object
      title: FineTuningJob
      properties:
        id:
          type: string
        created_at:
          type: integer
        error:
          type: object
          nullable: true
          properties:
            code:
              type: string
            message:
              type: string
            param:
              type: string
              nullable: true
          required:
            - code
            - message
            - param
        fine_tuned_model:
          type: string
          nullable: true
        finished_at:
          type: integer
          nullable: true
        hyperparameters:
          type: object
          properties:
            n_epochs:
              oneOf:
                - type: string
                  enum:
                    - auto
                - type: integer
                  minimum: 1
                  maximum: 50
              default: auto
          required:
            - n_epochs
        model:
          type: string
        object:
          type: string
          enum:
            - fine_tuning.job
        organization_id:
          type: string
        result_files:
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - validating_files
            - queued
            - running
            - succeeded
            - failed
            - cancelled
        trained_tokens:
          type: integer
          nullable: true
        training_file:
          type: string
        validation_file:
          type: string
          nullable: true
        integrations:
          type: array
          nullable: true
          maxItems: 5
          items:
            oneOf:
              - $ref: '#/components/schemas/FineTuningIntegration'
            x-oaiExpandable: true
        seed:
          type: integer
        estimated_finish:
          type: integer
          nullable: true
      required:
        - created_at
        - error
        - finished_at
        - fine_tuned_model
        - hyperparameters
        - id
        - model
        - object
        - organization_id
        - result_files
        - status
        - trained_tokens
        - training_file
        - validation_file
        - seed
    PortkeyOptions:
      type: object
      required:
        - x-portkey-virtual-key
      properties:
        x-portkey-virtual-key:
          type: string
        x-portkey-aws-s3-bucket:
          type: string
        x-portkey-vertex-storage-bucket-name:
          type: string
    BedrockParams:
      type: object
      properties:
        job_name:
          type: string
        role_arn:
          type: string
        output_file:
          type: string
    FineTuningIntegration:
      type: object
      title: Fine-Tuning Job Integration
      required:
        - type
        - wandb
      properties:
        type:
          type: string
          enum:
            - wandb
        wandb:
          type: object
          required:
            - project
          properties:
            project:
              type: string
            name:
              type: string
              nullable: true
            entity:
              type: string
              nullable: true
            tags:
              type: array
              items:
                type: string
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````