> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://platform.bctrl.ai/llms.txt.
> For full documentation content, see https://platform.bctrl.ai/llms-full.txt.

# Create Invocation

POST https://api.bctrl.ai/v1/spaces/{id}/runtimes/{runtimeId}/invocations
Content-Type: application/json

Submit durable AI work to a live runtime. Use invocations for agent execution such as Stagehand or browser-use work that needs lifecycle tracking.

Reference: https://platform.bctrl.ai/api/api-reference/invocations/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: bctrl API
  version: 1.0.0
paths:
  /v1/spaces/{id}/runtimes/{runtimeId}/invocations:
    post:
      operationId: runtimes-invocations-create
      summary: Create a durable invocation for a live runtime
      description: >-
        Submit durable AI work to a live runtime. Use invocations for agent
        execution such as Stagehand or browser-use work that needs lifecycle
        tracking.
      tags:
        - subpackage_spaces
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: runtimeId
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Use Bearer <api-key>.
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/spaces_runtimesInvocationsCreate_Response_202
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/spaces_runtimesInvocationsCreate_Request'
servers:
  - url: https://api.bctrl.ai
  - url: http://localhost:8787
components:
  schemas:
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel0:
      type: object
      properties:
        connection:
          type: string
        model:
          type: string
      required:
        - connection
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModelOneOf1Provider:
      type: string
      enum:
        - openai
        - anthropic
        - google
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModelOneOf1Provider
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel1:
      type: object
      properties:
        apiKey:
          type: string
        model:
          type: string
        provider:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModelOneOf1Provider
      required:
        - apiKey
        - model
        - provider
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel0:
      type: object
      properties:
        connection:
          type: string
        model:
          type: string
      required:
        - connection
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModelOneOf1Provider:
      type: string
      enum:
        - openai
        - anthropic
        - google
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModelOneOf1Provider
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel1:
      type: object
      properties:
        apiKey:
          type: string
        model:
          type: string
        provider:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModelOneOf1Provider
      required:
        - apiKey
        - model
        - provider
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Config:
      type: object
      properties:
        executionModel:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigExecutionModel
        model:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0ConfigModel
        systemPrompt:
          type: string
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Config
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems0:
      type: object
      properties:
        name:
          type: string
        storagePath:
          type: string
      required:
        - storagePath
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems1:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
        name:
          type: string
      required:
        - fileId
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Input:
      type: object
      properties:
        instruction:
          type: string
      required:
        - instruction
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Input
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables0:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariablesOneOf1Value:
      oneOf:
        - type: string
        - type: number
          format: double
        - type: boolean
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariablesOneOf1Value
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables1:
      type: object
      properties:
        description:
          type: string
        value:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariablesOneOf1Value
      required:
        - value
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Options:
      type: object
      properties:
        highlightCursor:
          type: boolean
        maxSteps:
          type: integer
        timeout:
          type: number
          format: double
        variables:
          type: object
          additionalProperties:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0OptionsVariables
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Options
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Target:
      type: object
      properties:
        page:
          type: string
          enum:
            - active
        type:
          type: string
          enum:
            - browser_page
      required:
        - page
        - type
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Target
    SpacesRuntimesInvocationsCreateRequest0:
      type: object
      properties:
        config:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Config
        files:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0FilesItems
        idempotencyKey:
          type: string
        input:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Input
        metadata:
          type: object
          additionalProperties:
            description: Any type
        operation:
          type: string
          enum:
            - agent.execute
        options:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Options
        provider:
          type: string
          enum:
            - stagehand
        target:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf0Target
        toolsetId:
          type: string
          format: uuid
      required:
        - input
        - operation
        - provider
      title: SpacesRuntimesInvocationsCreateRequest0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm0:
      type: object
      properties:
        connection:
          type: string
        model:
          type: string
      required:
        - connection
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlmOneOf1Provider:
      type: string
      enum:
        - openai
        - anthropic
        - google
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlmOneOf1Provider
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm1:
      type: object
      properties:
        apiKey:
          type: string
        model:
          type: string
        provider:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlmOneOf1Provider
      required:
        - apiKey
        - model
        - provider
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigGenerateGif:
      oneOf:
        - type: boolean
        - type: string
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigGenerateGif
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm0:
      type: object
      properties:
        connection:
          type: string
        model:
          type: string
      required:
        - connection
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlmOneOf1Provider:
      type: string
      enum:
        - openai
        - anthropic
        - google
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlmOneOf1Provider
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm1:
      type: object
      properties:
        apiKey:
          type: string
        model:
          type: string
        provider:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlmOneOf1Provider
      required:
        - apiKey
        - model
        - provider
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm0:
      type: object
      properties:
        connection:
          type: string
        model:
          type: string
      required:
        - connection
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlmOneOf1Provider:
      type: string
      enum:
        - openai
        - anthropic
        - google
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlmOneOf1Provider
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm1:
      type: object
      properties:
        apiKey:
          type: string
        model:
          type: string
        provider:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlmOneOf1Provider
      required:
        - apiKey
        - model
        - provider
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigSensitiveData:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            type: string
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigSensitiveData
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigUseVision:
      oneOf:
        - type: boolean
        - type: string
          enum:
            - auto
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigUseVision
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigVisionDetailLevel:
      type: string
      enum:
        - low
        - high
        - auto
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigVisionDetailLevel
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Config:
      type: object
      properties:
        calculateCost:
          type: boolean
        directlyOpenUrl:
          type: boolean
        displayFilesInDoneText:
          type: boolean
        enablePlanning:
          type: boolean
        extendSystemMessage:
          type: string
        fallbackLlm:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigFallbackLlm
        finalResponseAfterFailure:
          type: boolean
        flashMode:
          type: boolean
        generateGif:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigGenerateGif
        groundTruth:
          type: string
        includeAttributes:
          type: array
          items:
            type: string
        includeRecentEvents:
          type: boolean
        includeToolCallExamples:
          type: boolean
        initialActions:
          type: array
          items:
            description: Any type
        llm:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigLlm
        llmScreenshotSize:
          type: array
          items:
            description: Any type
        llmTimeout:
          type: number
          format: double
        loopDetectionEnabled:
          type: boolean
        loopDetectionWindow:
          type: integer
        maxActionsPerStep:
          type: integer
        maxClickableElementsLength:
          type: integer
        maxFailures:
          type: integer
        maxHistoryItems:
          type:
            - integer
            - 'null'
        maxSteps:
          type: integer
        messageCompaction:
          type: boolean
        overrideSystemMessage:
          type: string
        pageExtractionLlm:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigPageExtractionLlm
        planningExplorationLimit:
          type: integer
        planningReplanOnStall:
          type: integer
        pricingUrl:
          type: string
        saveConversationPath:
          type: string
        saveConversationPathEncoding:
          type: string
        sensitiveData:
          type: object
          additionalProperties:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigSensitiveData
        source:
          type: string
        stepTimeout:
          type: number
          format: double
        useJudge:
          type: boolean
        useThinking:
          type: boolean
        useVision:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigUseVision
        visionDetailLevel:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1ConfigVisionDetailLevel
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Config
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems0:
      type: object
      properties:
        name:
          type: string
        storagePath:
          type: string
      required:
        - storagePath
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems1:
      type: object
      properties:
        fileId:
          type: string
          format: uuid
        name:
          type: string
      required:
        - fileId
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Input:
      type: object
      properties:
        instruction:
          type: string
      required:
        - instruction
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Input
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Options:
      type: object
      properties:
        maxSteps:
          type: integer
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Options
    V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Target:
      type: object
      properties:
        page:
          type: string
          enum:
            - active
        type:
          type: string
          enum:
            - browser_page
      required:
        - page
        - type
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Target
    SpacesRuntimesInvocationsCreateRequest1:
      type: object
      properties:
        config:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Config
        files:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1FilesItems
        idempotencyKey:
          type: string
        input:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Input
        metadata:
          type: object
          additionalProperties:
            description: Any type
        operation:
          type: string
          enum:
            - agent.execute
        options:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Options
        provider:
          type: string
          enum:
            - browserUse
        target:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostRequestBodyContentApplicationJsonSchemaOneOf1Target
        toolsetId:
          type: string
          format: uuid
      required:
        - input
        - operation
        - provider
      title: SpacesRuntimesInvocationsCreateRequest1
    spaces_runtimesInvocationsCreate_Request:
      oneOf:
        - $ref: '#/components/schemas/SpacesRuntimesInvocationsCreateRequest0'
        - $ref: '#/components/schemas/SpacesRuntimesInvocationsCreateRequest1'
      title: spaces_runtimesInvocationsCreate_Request
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: string
        details:
          type: object
          additionalProperties:
            description: Any type
        message:
          type: string
      required:
        - message
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaError
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaExecutionMode:
      type: string
      enum:
        - inline
        - durable
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaExecutionMode
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaProgress:
      type: object
      properties:
        currentCall:
          type: string
        lastEventType:
          type: string
        message:
          type: string
        step:
          type: integer
        totalSteps:
          type: integer
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaProgress
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItemsOptions:
      type: object
      properties:
        dryRun:
          type: boolean
        timeoutMs:
          type: integer
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItemsOptions
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItems:
      type: object
      properties:
        args:
          type: array
          items:
            description: Any type
        bind:
          type: string
        call:
          type: string
        options:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItemsOptions
        ref:
          type: string
      required:
        - call
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItems
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequest:
      type: object
      properties:
        idempotencyKey:
          type: string
        mode:
          type: string
          enum:
            - fail-fast
        runtimeId:
          type: string
          format: uuid
        steps:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequestStepsItems
      required:
        - runtimeId
        - steps
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequest
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0BindingType:
      type: string
      enum:
        - page
        - context
        - handle
        - subscription
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0BindingType
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Binding:
      type: object
      properties:
        alias:
          type: string
        id:
          type: string
        type:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0BindingType
      required:
        - alias
        - id
        - type
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Binding
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Resolved:
      type: object
      properties:
        call:
          type: string
        contextId:
          type:
            - string
            - 'null'
        handleId:
          type:
            - string
            - 'null'
        method:
          type: string
        pageId:
          type:
            - string
            - 'null'
        ref:
          type:
            - string
            - 'null'
        runtimeId:
          type: string
        target:
          type: string
      required:
        - call
        - contextId
        - handleId
        - method
        - pageId
        - ref
        - runtimeId
        - target
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Resolved
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems0:
      type: object
      properties:
        binding:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Binding
        call:
          type: string
        index:
          type: integer
        ok:
          type: boolean
          enum:
            - true
        resolved:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf0Resolved
        result:
          description: Any type
      required:
        - call
        - index
        - ok
        - resolved
        - result
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems0
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorCode:
      type: string
      enum:
        - UNKNOWN_CALL
        - UNKNOWN_REF
        - INVALID_ARGS
        - CAPABILITY_NOT_AVAILABLE
        - TIMEOUT
        - RUNTIME_NOT_FOUND
        - DRIVER_NOT_CONNECTED
        - SUBSCRIPTION_CURSOR_CONFLICT
        - SUBSCRIPTION_GONE
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorCode
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticCategory:
      type: string
      enum:
        - arg-shape
        - semantic
        - runtime
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticCategory
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticFixesItems:
      type: object
      properties:
        command:
          type: string
        example:
          type: string
        title:
          type: string
      required:
        - title
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticFixesItems
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnostic:
      type: object
      properties:
        call:
          type: string
        category:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticCategory
        closest:
          type: array
          items:
            type: string
        code:
          type: string
        docsUrl:
          type: string
          format: uri
        driver:
          type: string
        expected:
          type: string
        fixes:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnosticFixesItems
        id:
          type: string
        received:
          type: string
      required:
        - id
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnostic
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1Error:
      type: object
      properties:
        code:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorCode
        diagnostic:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1ErrorDiagnostic
        hint:
          type: string
        message:
          type: string
      required:
        - code
        - message
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1Error
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems1:
      type: object
      properties:
        call:
          type: string
        error:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItemsOneOf1Error
        index:
          type: integer
        ok:
          type: boolean
          enum:
            - false
      required:
        - call
        - error
        - index
        - ok
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems1
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems:
      oneOf:
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems0
        - $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems1
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResult:
      type: object
      properties:
        mode:
          type: string
          enum:
            - fail-fast
        ok:
          type: boolean
        runtimeId:
          type: string
          format: uuid
        steps:
          type: array
          items:
            $ref: >-
              #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResultStepsItems
      required:
        - mode
        - ok
        - runtimeId
        - steps
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResult
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRuntimeKind:
      type: string
      enum:
        - browser
        - desktop
        - spreadsheet
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRuntimeKind
    V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaStatus:
      type: string
      enum:
        - queued
        - dispatching
        - running
        - cancelling
        - succeeded
        - failed
        - cancelled
        - timed_out
      title: >-
        V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaStatus
    spaces_runtimesInvocationsCreate_Response_202:
      type: object
      properties:
        artifactCount:
          type: integer
        cancelRequestedAt:
          type:
            - string
            - 'null'
        connector:
          type:
            - string
            - 'null'
        correlationId:
          type:
            - string
            - 'null'
        createdAt:
          type: string
        durationMs:
          type:
            - integer
            - 'null'
        entryCall:
          type: string
        error:
          oneOf:
            - $ref: >-
                #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaError
            - type: 'null'
        executionMode:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaExecutionMode
        finishedAt:
          type:
            - string
            - 'null'
        id:
          type: string
          format: uuid
        lastHeartbeatAt:
          type:
            - string
            - 'null'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        progress:
          oneOf:
            - $ref: >-
                #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaProgress
            - type: 'null'
        request:
          oneOf:
            - $ref: >-
                #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRequest
            - type: 'null'
        result:
          oneOf:
            - $ref: >-
                #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaResult
            - type: 'null'
        runId:
          type: string
          format: uuid
        runtimeId:
          type: string
          format: uuid
        runtimeKind:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaRuntimeKind
        sequenceNo:
          type: integer
        spaceId:
          type: string
          format: uuid
        startedAt:
          type:
            - string
            - 'null'
        status:
          $ref: >-
            #/components/schemas/V1SpacesIdRuntimesRuntimeIdInvocationsPostResponsesContentApplicationJsonSchemaStatus
        stepCount:
          type: integer
      required:
        - artifactCount
        - createdAt
        - entryCall
        - executionMode
        - id
        - runId
        - runtimeId
        - runtimeKind
        - sequenceNo
        - spaceId
        - status
        - stepCount
      title: spaces_runtimesInvocationsCreate_Response_202
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use Bearer <api-key>.

```

## SDK Code Examples

```python
import requests

url = "https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations"

payload = {
    "input": { "instruction": "string" },
    "operation": "string",
    "provider": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"input":{"instruction":"string"},"operation":"string","provider":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations"

	payload := strings.NewReader("{\n  \"input\": {\n    \"instruction\": \"string\"\n  },\n  \"operation\": \"string\",\n  \"provider\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"input\": {\n    \"instruction\": \"string\"\n  },\n  \"operation\": \"string\",\n  \"provider\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"input\": {\n    \"instruction\": \"string\"\n  },\n  \"operation\": \"string\",\n  \"provider\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations', [
  'body' => '{
  "input": {
    "instruction": "string"
  },
  "operation": "string",
  "provider": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"input\": {\n    \"instruction\": \"string\"\n  },\n  \"operation\": \"string\",\n  \"provider\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "input": ["instruction": "string"],
  "operation": "string",
  "provider": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bctrl.ai/v1/spaces/id/runtimes/runtimeId/invocations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```