> ## 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 run



## OpenAPI

````yaml https://raw.githubusercontent.com/PaloAltoNetworks/openapi/refs/heads/main/openapi.yaml post /threads/{thread_id}/runs
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:
  /threads/{thread_id}/runs:
    post:
      tags:
        - Assistants
      operationId: createRun
      parameters:
        - in: path
          name: thread_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRunRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunObject'
components:
  schemas:
    CreateRunRequest:
      type: object
      additionalProperties: false
      properties:
        assistant_id:
          type: string
        model:
          anyOf:
            - type: string
            - type: string
              enum:
                - gpt-4o
                - gpt-4o-2024-05-13
                - gpt-4-turbo
                - gpt-4-turbo-2024-04-09
                - gpt-4-0125-preview
                - gpt-4-turbo-preview
                - gpt-4-1106-preview
                - gpt-4-vision-preview
                - gpt-4
                - gpt-4-0314
                - gpt-4-0613
                - gpt-4-32k
                - gpt-4-32k-0314
                - gpt-4-32k-0613
                - gpt-3.5-turbo
                - gpt-3.5-turbo-16k
                - gpt-3.5-turbo-0613
                - gpt-3.5-turbo-1106
                - gpt-3.5-turbo-0125
                - gpt-3.5-turbo-16k-0613
          x-oaiTypeLabel: string
          nullable: true
        instructions:
          type: string
          nullable: true
        additional_instructions:
          type: string
          nullable: true
        additional_messages:
          type: array
          items:
            $ref: '#/components/schemas/CreateMessageRequest'
          nullable: true
        tools:
          nullable: true
          type: array
          maxItems: 20
          items:
            oneOf:
              - $ref: '#/components/schemas/AssistantToolsCode'
              - $ref: '#/components/schemas/AssistantToolsFileSearch'
              - $ref: '#/components/schemas/AssistantToolsFunction'
            x-oaiExpandable: true
        metadata:
          type: object
          x-oaiTypeLabel: map
          nullable: true
        temperature:
          type: number
          minimum: 0
          maximum: 2
          default: 1
          nullable: true
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          nullable: true
        stream:
          type: boolean
          nullable: true
        max_prompt_tokens:
          type: integer
          nullable: true
          minimum: 256
        max_completion_tokens:
          type: integer
          nullable: true
          minimum: 256
        truncation_strategy:
          $ref: '#/components/schemas/TruncationObject'
          nullable: true
        tool_choice:
          $ref: '#/components/schemas/AssistantsApiToolChoiceOption'
          nullable: true
        parallel_tool_calls:
          $ref: '#/components/schemas/ParallelToolCalls'
        response_format:
          $ref: '#/components/schemas/AssistantsApiResponseFormatOption'
          nullable: true
      required:
        - thread_id
        - assistant_id
    RunObject:
      type: object
      title: A run on a thread
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - thread.run
        created_at:
          type: integer
        thread_id:
          type: string
        assistant_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - in_progress
            - requires_action
            - cancelling
            - cancelled
            - failed
            - completed
            - incomplete
            - expired
        required_action:
          type: object
          nullable: true
          properties:
            type:
              type: string
              enum:
                - submit_tool_outputs
            submit_tool_outputs:
              type: object
              properties:
                tool_calls:
                  type: array
                  items:
                    $ref: '#/components/schemas/RunToolCallObject'
              required:
                - tool_calls
          required:
            - type
            - submit_tool_outputs
        last_error:
          type: object
          nullable: true
          properties:
            code:
              type: string
              enum:
                - server_error
                - rate_limit_exceeded
                - invalid_prompt
            message:
              type: string
          required:
            - code
            - message
        expires_at:
          type: integer
          nullable: true
        started_at:
          type: integer
          nullable: true
        cancelled_at:
          type: integer
          nullable: true
        failed_at:
          type: integer
          nullable: true
        completed_at:
          type: integer
          nullable: true
        incomplete_details:
          type: object
          nullable: true
          properties:
            reason:
              type: string
              enum:
                - max_completion_tokens
                - max_prompt_tokens
        model:
          type: string
        instructions:
          type: string
        tools:
          default: []
          type: array
          maxItems: 20
          items:
            oneOf:
              - $ref: '#/components/schemas/AssistantToolsCode'
              - $ref: '#/components/schemas/AssistantToolsFileSearch'
              - $ref: '#/components/schemas/AssistantToolsFunction'
            x-oaiExpandable: true
        metadata:
          type: object
          x-oaiTypeLabel: map
          nullable: true
        usage:
          $ref: '#/components/schemas/RunCompletionUsage'
        temperature:
          type: number
          nullable: true
        top_p:
          type: number
          nullable: true
        max_prompt_tokens:
          type: integer
          nullable: true
          minimum: 256
        max_completion_tokens:
          type: integer
          nullable: true
          minimum: 256
        truncation_strategy:
          $ref: '#/components/schemas/TruncationObject'
          nullable: true
        tool_choice:
          $ref: '#/components/schemas/AssistantsApiToolChoiceOption'
          nullable: true
        parallel_tool_calls:
          $ref: '#/components/schemas/ParallelToolCalls'
        response_format:
          $ref: '#/components/schemas/AssistantsApiResponseFormatOption'
          nullable: true
      required:
        - id
        - object
        - created_at
        - thread_id
        - assistant_id
        - status
        - required_action
        - last_error
        - expires_at
        - started_at
        - cancelled_at
        - failed_at
        - completed_at
        - model
        - instructions
        - tools
        - metadata
        - usage
        - incomplete_details
        - max_prompt_tokens
        - max_completion_tokens
        - truncation_strategy
        - tool_choice
        - parallel_tool_calls
        - response_format
    CreateMessageRequest:
      type: object
      additionalProperties: false
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
        content:
          oneOf:
            - type: string
              title: Text content
            - type: array
              title: Array of content parts
              items:
                oneOf:
                  - $ref: '#/components/schemas/MessageContentImageFileObject'
                  - $ref: '#/components/schemas/MessageContentImageUrlObject'
                  - $ref: '#/components/schemas/MessageRequestContentTextObject'
                x-oaiExpandable: true
              minItems: 1
          x-oaiExpandable: true
        attachments:
          type: array
          items:
            type: object
            properties:
              file_id:
                type: string
              tools:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/AssistantToolsCode'
                    - $ref: '#/components/schemas/AssistantToolsFileSearchTypeOnly'
                  x-oaiExpandable: true
          required:
            - file_id
            - tools
          nullable: true
        metadata:
          type: object
          x-oaiTypeLabel: map
          nullable: true
    AssistantToolsCode:
      type: object
      title: Code interpreter tool
      properties:
        type:
          type: string
          enum:
            - code_interpreter
      required:
        - type
    AssistantToolsFileSearch:
      type: object
      title: FileSearch tool
      properties:
        type:
          type: string
          enum:
            - file_search
        file_search:
          type: object
          properties:
            max_num_results:
              type: integer
              minimum: 1
              maximum: 50
      required:
        - type
    AssistantToolsFunction:
      type: object
      title: Function tool
      properties:
        type:
          type: string
          enum:
            - function
        function:
          $ref: '#/components/schemas/FunctionObject'
      required:
        - type
        - function
    TruncationObject:
      type: object
      title: Thread Truncation Controls
      properties:
        type:
          type: string
          enum:
            - auto
            - last_messages
        last_messages:
          type: integer
          minimum: 1
          nullable: true
      required:
        - type
    AssistantsApiToolChoiceOption:
      oneOf:
        - type: string
          enum:
            - none
            - auto
            - required
        - $ref: '#/components/schemas/AssistantsNamedToolChoice'
      x-oaiExpandable: true
    ParallelToolCalls:
      type: boolean
      default: true
    AssistantsApiResponseFormatOption:
      oneOf:
        - type: string
          enum:
            - none
            - auto
        - $ref: '#/components/schemas/AssistantsApiResponseFormat'
      x-oaiExpandable: true
    RunToolCallObject:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - function
        function:
          type: object
          properties:
            name:
              type: string
            arguments:
              type: string
          required:
            - name
            - arguments
      required:
        - id
        - type
        - function
    RunCompletionUsage:
      type: object
      properties:
        completion_tokens:
          type: integer
        prompt_tokens:
          type: integer
        total_tokens:
          type: integer
      required:
        - prompt_tokens
        - completion_tokens
        - total_tokens
      nullable: true
    MessageContentImageFileObject:
      title: Image file
      type: object
      properties:
        type:
          type: string
          enum:
            - image_file
        image_file:
          type: object
          properties:
            file_id:
              type: string
            detail:
              type: string
              enum:
                - auto
                - low
                - high
              default: auto
          required:
            - file_id
      required:
        - type
        - image_file
    MessageContentImageUrlObject:
      title: Image URL
      type: object
      properties:
        type:
          type: string
          enum:
            - image_url
        image_url:
          type: object
          properties:
            url:
              type: string
              format: uri
            detail:
              type: string
              enum:
                - auto
                - low
                - high
              default: auto
          required:
            - url
      required:
        - type
        - image_url
    MessageRequestContentTextObject:
      title: Text
      type: object
      properties:
        type:
          type: string
          enum:
            - text
        text:
          type: string
      required:
        - type
        - text
    AssistantToolsFileSearchTypeOnly:
      type: object
      title: FileSearch tool
      properties:
        type:
          type: string
          enum:
            - file_search
      required:
        - type
    FunctionObject:
      type: object
      properties:
        description:
          type: string
        name:
          type: string
        parameters:
          $ref: '#/components/schemas/FunctionParameters'
        strict:
          type: boolean
          default: false
          nullable: true
      required:
        - name
    AssistantsNamedToolChoice:
      type: object
      properties:
        type:
          type: string
          enum:
            - function
            - code_interpreter
            - file_search
        function:
          type: object
          properties:
            name:
              type: string
          required:
            - name
      required:
        - type
    AssistantsApiResponseFormat:
      type: object
      properties:
        type:
          type: string
          enum:
            - text
            - json_object
          default: text
    FunctionParameters:
      type: object
      additionalProperties: true
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````