openapi: 3.1.0
info:
  title: Tasks
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /tasks:
    post:
      tags:
        - Tasks
      summary: Run Task
      description: >-
        Create and dispatch a new agent task. Returns the task ID and device
        stream details.
      operationId: run_task_tasks_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreatedResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '402':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Payment Required
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '412':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Precondition Failed
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.tasks.run({
              deviceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              task: 'x',
            });

            console.log(response.id);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.run(
                device_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                task="x",
            )
            print(response.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.Run(context.TODO(), mobileruncloud.TaskRunParams{\n\t\tDeviceID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tTask:     \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks run \
              --api-key 'My API Key' \
              --device-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --task x
    get:
      tags:
        - Tasks
      summary: List Tasks
      description: List tasks with optional filtering, sorting, and pagination.
      operationId: list_tasks_tasks_get
      parameters:
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TaskStatus'
              - type: 'null'
            title: Status
        - name: query
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 128
              - type: 'null'
            description: Search in task description.
            title: Query
          description: Search in task description.
        - name: orderBy
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - id
                  - createdAt
                  - finishedAt
                  - status
                type: string
              - type: 'null'
            default: createdAt
            title: Orderby
        - name: orderByDirection
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            default: desc
            title: Orderbydirection
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: pageSize
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Pagesize
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResult_TaskListItem_'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const tasks = await client.tasks.list();

            console.log(tasks.items);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            tasks = client.tasks.list()
            print(tasks.items)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttasks, err := client.Tasks.List(context.TODO(), mobileruncloud.TaskListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", tasks.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks list \
              --api-key 'My API Key'
  /tasks/stream:
    post:
      tags:
        - Tasks
      summary: Run Streamed Task
      description: >-
        Create and dispatch a new agent task, returning an SSE stream of task
        events. Cancels the task if the client disconnects.
      operationId: run_streamed_task_tasks_stream_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
            text/event-stream: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '412':
          description: Precondition Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable Content
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.tasks.runStreamed({
              deviceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              task: 'x',
            });

            console.log(response);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.run_streamed(
                device_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                task="x",
            )
            print(response)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.RunStreamed(context.TODO(), mobileruncloud.TaskRunStreamedParams{\n\t\tDeviceID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tTask:     \"x\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks run-streamed \
              --api-key 'My API Key' \
              --device-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --task x
  /tasks/{task_id}/cancel:
    post:
      tags:
        - Tasks
      summary: Stop Task
      description: >-
        Cancel a running task. Returns an error if the task is already in a
        terminal state.
      operationId: stop_task_tasks__task_id__cancel_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCancelResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.tasks.stop('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.cancelled);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.stop(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.cancelled)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.Stop(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Cancelled)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks stop \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/message:
    post:
      tags:
        - Tasks
      summary: Send Message
      description: >-
        Send a message to a running agent task. The message ID is delivered via
        SSE (UserMessageEvent with action=queued).
      operationId: send_message_tasks__task_id__message_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskMessageCreate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskMessageResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.tasks.sendMessage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              message: 'x',
            });


            console.log(response.sent);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.send_message(
                task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                message="x",
            )
            print(response.sent)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.SendMessage(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.TaskSendMessageParams{\n\t\t\tMessage: \"x\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Sent)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks send-message \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --message x
  /tasks/{task_id}/attach:
    get:
      tags:
        - Tasks
      summary: Attach Task
      description: Attach to a running task and receive its events as an SSE stream.
      operationId: attach_task_tasks__task_id__attach_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            text/event-stream: {}
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            await client.tasks.attach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            client.tasks.attach(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\terr := client.Tasks.Attach(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks attach \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/status:
    get:
      tags:
        - Tasks
      summary: Get Task Status
      description: Get the status of a task.
      operationId: get_task_status_tasks__task_id__status_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStatusResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.tasks.getStatus('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.status);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.get_status(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.status)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.GetStatus(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Status)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks get-status \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/trajectory:
    get:
      tags:
        - Tasks
      summary: Get Task Trajectory
      description: Get the trajectory of a task.
      operationId: get_task_trajectory_tasks__task_id__trajectory_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskTrajectoryResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.tasks.getTrajectory('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.trajectory);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            response = client.tasks.get_trajectory(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.trajectory)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Tasks.GetTrajectory(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Trajectory)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks get-trajectory \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/ui_states:
    get:
      tags:
        - Tasks
      summary: Get Task Ui States
      description: List all UI state URLs for a task.
      operationId: get_task_ui_states_tasks__task_id__ui_states_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaListResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const uiStates = await
            client.tasks.uiStates.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(uiStates.urls);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            ui_states = client.tasks.ui_states.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(ui_states.urls)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuiStates, err := client.Tasks.UiStates.List(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", uiStates.URLs)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks:ui-states list \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/ui_states/{index}:
    get:
      tags:
        - Tasks
      summary: Get Task Ui State
      description: Get a specific UI state by index.
      operationId: get_task_ui_state_tasks__task_id__ui_states__index__get
      parameters:
        - name: index
          in: path
          required: true
          schema:
            type: integer
            title: Index
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const mediaResponse = await client.tasks.uiStates.retrieve(0, {
              task_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });

            console.log(mediaResponse.url);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            media_response = client.tasks.ui_states.retrieve(
                index=0,
                task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(media_response.url)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmediaResponse, err := client.Tasks.UiStates.Get(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tmobileruncloud.TaskUiStateGetParams{\n\t\t\tTaskID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", mediaResponse.URL)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks:ui-states retrieve \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --index 0
  /tasks/{task_id}/screenshots:
    get:
      tags:
        - Tasks
      summary: Get Task Screenshots
      description: List all screenshot URLs for a task.
      operationId: get_task_screenshots_tasks__task_id__screenshots_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaListResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const screenshots = await
            client.tasks.screenshots.list('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(screenshots.urls);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            screenshots = client.tasks.screenshots.list(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(screenshots.urls)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tscreenshots, err := client.Tasks.Screenshots.List(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", screenshots.URLs)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks:screenshots list \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /tasks/{task_id}/screenshots/{index}:
    get:
      tags:
        - Tasks
      summary: Get Task Screenshot
      description: Get a specific screenshot by index.
      operationId: get_task_screenshot_tasks__task_id__screenshots__index__get
      parameters:
        - name: index
          in: path
          required: true
          schema:
            type: integer
            title: Index
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const mediaResponse = await client.tasks.screenshots.retrieve(0, {
              task_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            });

            console.log(mediaResponse.url);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            media_response = client.tasks.screenshots.retrieve(
                index=0,
                task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(media_response.url)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmediaResponse, err := client.Tasks.Screenshots.Get(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tmobileruncloud.TaskScreenshotGetParams{\n\t\t\tTaskID: \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", mediaResponse.URL)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks:screenshots retrieve \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
              --index 0
  /tasks/{task_id}:
    get:
      tags:
        - Tasks
      summary: Get Task
      description: Get full details of a task by ID.
      operationId: get_task_tasks__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });


            const task = await
            client.tasks.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(task.task);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            task = client.tasks.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(task.task)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttask, err := client.Tasks.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", task.Task)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud tasks retrieve \
              --api-key 'My API Key' \
              --task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /models:
    get:
      tags:
        - Models
      summary: Get all LLM models
      description: Get all LLM models
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        object:
                          type: string
                        created:
                          type: number
                        owned_by:
                          type: string
                  object:
                    type: string
                    description: Always "list" for list responses
        '400':
          description: Not Found
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const models = await client.models.list();

            console.log(models.data);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            models = client.models.list()
            print(models.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tmodels, err := client.Models.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", models.Data)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud models list \
              --api-key 'My API Key'
components:
  schemas:
    TaskCreate:
      properties:
        agentId:
          type: integer
          title: Agentid
          default: 0
        llmModel:
          type: string
          title: Llmmodel
          description: >-
            The LLM model identifier to use for the task (e.g.
            'google/gemini-3.1-flash-lite')
          default: google/gemini-3.1-flash-lite
        task:
          type: string
          minLength: 1
          title: Task
        maxSteps:
          type: integer
          title: Maxsteps
          default: 100
        temperature:
          type: number
          title: Temperature
          default: 0.5
        reasoning:
          type: boolean
          title: Reasoning
          default: true
        accessibility:
          type: boolean
          title: Accessibility
          default: true
        vision:
          type: boolean
          title: Vision
          default: false
        executionTimeout:
          type: integer
          title: Executiontimeout
          default: 1000
        credentials:
          items:
            $ref: '#/components/schemas/PackageCredentials'
          type: array
          title: Credentials
        apps:
          items:
            type: string
          type: array
          title: Apps
        files:
          items:
            type: string
          type: array
          title: Files
        outputSchema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Outputschema
        vpnCountry:
          anyOf:
            - $ref: '#/components/schemas/VPNCountry'
            - type: 'null'
        subagentModel:
          type: string
          title: Subagentmodel
          description: >-
            LLM model used by sub-agent roles: executor, app_opener,
            structured_output
          default: google/gemini-3.1-flash-lite
        stealth:
          type: boolean
          title: Stealth
          default: false
        continueOnFailure:
          type: boolean
          title: Continueonfailure
          default: false
        memoryNamespace:
          type: string
          title: Memorynamespace
          description: Memory namespace for cross-task personalization
          default: default
        deviceId:
          type: string
          format: uuid
          title: Deviceid
          description: The ID of the device to run the task on.
        displayId:
          type: integer
          title: Displayid
          description: The display ID of the device to run the task on.
          default: 0
      type: object
      required:
        - task
        - deviceId
      title: TaskCreate
    TaskCreatedResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The ID of the task
        status:
          $ref: '#/components/schemas/TaskStatus'
          description: The status of the task (queued or created)
        streamUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Streamurl
          description: The URL of the stream (null when queued)
      type: object
      required:
        - id
        - status
      title: TaskCreatedResponse
    ErrorResponse:
      properties:
        title:
          type: string
          title: Title
          description: The title of the error
        status:
          type: integer
          title: Status
          description: The status code of the error
        detail:
          type: string
          title: Detail
          description: The detail of the error
        errors:
          items: {}
          type: array
          title: Errors
          description: The errors
      type: object
      required:
        - title
        - status
        - detail
        - errors
      title: ErrorResponse
    UnauthorizedResponse:
      properties:
        title:
          type: string
          title: Title
          description: The title of the error
          default: Unauthorized
        status:
          type: integer
          title: Status
          description: The status code of the error
          default: 401
        detail:
          type: string
          title: Detail
          description: The detail of the error
          default: You are not authorized to access this resource
        errors:
          items: {}
          type: array
          title: Errors
          description: The errors
          default: []
      type: object
      title: UnauthorizedResponse
    TaskStatus:
      type: string
      enum:
        - queued
        - created
        - running
        - cancelling
        - paused
        - completed
        - failed
        - cancelled
      title: TaskStatus
    PaginatedResult_TaskListItem_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/TaskListItem'
          type: array
          title: Items
          description: The paginated items
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
          description: Pagination metadata
      type: object
      required:
        - items
        - pagination
      title: PaginatedResult[TaskListItem]
    TaskCancelResponse:
      properties:
        cancelled:
          type: boolean
          title: Cancelled
          description: Whether the task was cancelled
      type: object
      required:
        - cancelled
      title: TaskCancelResponse
    TaskMessageCreate:
      properties:
        message:
          type: string
          maxLength: 4000000
          minLength: 1
          title: Message
          description: Message to send to the running agent
      type: object
      required:
        - message
      title: TaskMessageCreate
    TaskMessageResponse:
      properties:
        sent:
          type: boolean
          title: Sent
          description: Whether the message was queued for delivery
      type: object
      required:
        - sent
      title: TaskMessageResponse
    TaskStatusResponse:
      properties:
        status:
          $ref: '#/components/schemas/TaskStatus'
          description: The status of the task
        succeeded:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Succeeded
          description: Whether the task succeeded
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: The agent's final answer or failure reason
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output
          description: Structured output if outputSchema was set
        steps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Steps
          description: Number of steps taken
        lastResponse:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Lastresponse
          description: The last agent response (FastAgentResponseEvent or ManagerPlanEvent)
      type: object
      required:
        - status
      title: TaskStatusResponse
    TaskTrajectoryResponse:
      properties:
        trajectory:
          items:
            anyOf:
              - $ref: '#/components/schemas/TrajectoryQueuedEvent'
              - $ref: '#/components/schemas/TrajectoryCreatedEvent'
              - $ref: '#/components/schemas/TrajectoryExceptionEvent'
              - $ref: '#/components/schemas/TrajectoryCancelEvent'
              - $ref: '#/components/schemas/TrajectoryScreenshotEvent'
              - $ref: '#/components/schemas/TrajectoryStartEvent'
              - $ref: '#/components/schemas/TrajectoryFinalizeEvent'
              - $ref: '#/components/schemas/TrajectoryStopEvent'
              - $ref: '#/components/schemas/TrajectoryResultEvent'
              - $ref: '#/components/schemas/TrajectoryManagerInputEvent'
              - $ref: '#/components/schemas/TrajectoryManagerPlanEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorInputEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorResultEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentInputEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentResponseEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentToolCallEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentOutputEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentEndEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentExecuteEvent'
              - $ref: '#/components/schemas/TrajectoryFastAgentResultEvent'
              - $ref: '#/components/schemas/TrajectoryToolExecutionEvent'
              - $ref: '#/components/schemas/TrajectoryRecordUIStateEvent'
              - $ref: '#/components/schemas/TrajectoryManagerContextEvent'
              - $ref: '#/components/schemas/TrajectoryManagerResponseEvent'
              - $ref: '#/components/schemas/TrajectoryManagerPlanDetailsEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorContextEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorResponseEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorActionEvent'
              - $ref: '#/components/schemas/TrajectoryExecutorActionResultEvent'
              - $ref: '#/components/schemas/TrajectoryUserMessageEvent'
              - $ref: '#/components/schemas/TrajectoryUnknownEvent'
          type: array
          title: Trajectory
          description: The trajectory of the task
      type: object
      required:
        - trajectory
      title: TaskTrajectoryResponse
    MediaListResponse:
      properties:
        urls:
          items:
            type: string
          type: array
          title: Urls
          description: The list of media URLs
      type: object
      required:
        - urls
      title: MediaListResponse
    MediaResponse:
      properties:
        url:
          type: string
          title: Url
          description: The URL of the media
      type: object
      required:
        - url
      title: MediaResponse
    TaskResponse:
      properties:
        task:
          $ref: '#/components/schemas/TaskListItem'
          description: The task
      type: object
      required:
        - task
      title: TaskResponse
    PackageCredentials:
      properties:
        packageName:
          type: string
          title: Packagename
        credentialNames:
          items:
            type: string
          type: array
          title: Credentialnames
      type: object
      required:
        - packageName
        - credentialNames
      title: PackageCredentials
    VPNCountry:
      type: string
      enum:
        - US
        - BR
        - FR
        - DE
        - IN
        - JP
        - KR
        - ZA
      title: VPNCountry
    TaskListItem:
      properties:
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
        agentId:
          type: integer
          title: Agentid
          default: 0
        llmModel:
          type: string
          title: Llmmodel
          description: >-
            The LLM model identifier to use for the task (e.g.
            'gemini/gemini-2.5-flash')
        task:
          type: string
          minLength: 1
          title: Task
        maxSteps:
          type: integer
          title: Maxsteps
          default: 100
        temperature:
          type: number
          title: Temperature
          default: 0.5
        reasoning:
          type: boolean
          title: Reasoning
          default: true
        accessibility:
          type: boolean
          title: Accessibility
          default: true
        vision:
          type: boolean
          title: Vision
          default: false
        executionTimeout:
          type: integer
          title: Executiontimeout
          default: 1000
        credentials:
          items:
            $ref: '#/components/schemas/PackageCredentials'
          type: array
          title: Credentials
        apps:
          items:
            type: string
          type: array
          title: Apps
        files:
          items:
            type: string
          type: array
          title: Files
        outputSchema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Outputschema
        vpnCountry:
          anyOf:
            - $ref: '#/components/schemas/VPNCountry'
            - type: 'null'
        subagentModel:
          type: string
          title: Subagentmodel
          description: >-
            LLM model used by sub-agent roles: executor, app_opener,
            structured_output
          default: google/gemini-3.1-flash-lite
        stealth:
          type: boolean
          title: Stealth
          default: false
        continueOnFailure:
          type: boolean
          title: Continueonfailure
          default: false
        memoryNamespace:
          type: string
          title: Memorynamespace
          description: Memory namespace for cross-task personalization
          default: default
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/TaskStatus'
        deviceId:
          type: string
          format: uuid
          title: Deviceid
        displayId:
          type: integer
          title: Displayid
        tmpDevice:
          type: boolean
          title: Tmpdevice
        dispatchedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Dispatchedat
        claimedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Claimedat
        cancelRequestedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Cancelrequestedat
        streamUrl:
          anyOf:
            - type: string
            - type: 'null'
          title: Streamurl
        succeeded:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Succeeded
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Output
        steps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Steps
        finishedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finishedat
        creditsUsed:
          anyOf:
            - type: number
            - type: 'null'
          title: Creditsused
        userId:
          type: string
          title: Userid
          description: 'Deprecated: use ownerId (tenancy) / createdBy (actor).'
          deprecated: true
        ownerId:
          type: string
          title: Ownerid
        createdBy:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdby
      type: object
      required:
        - llmModel
        - task
        - id
        - status
        - deviceId
        - displayId
        - tmpDevice
        - userId
        - ownerId
      title: TaskListItem
      description: >-
        Task representation for list endpoints — omits the large trajectory
        field.
    PaginationMeta:
      properties:
        page:
          type: integer
          title: Page
          description: Current page number (1-based)
        pageSize:
          type: integer
          title: Pagesize
          description: Number of items per page
        total:
          type: integer
          title: Total
          description: Total number of items
        pages:
          type: integer
          title: Pages
          description: Total number of pages
        hasNext:
          type: boolean
          title: Hasnext
          description: Whether there is a next page
        hasPrev:
          type: boolean
          title: Hasprev
          description: Whether there is a previous page
      type: object
      required:
        - page
        - pageSize
        - total
        - pages
        - hasNext
        - hasPrev
      title: PaginationMeta
      description: Pagination metadata.
    TrajectoryQueuedEvent:
      properties:
        event:
          type: string
          const: QueuedEvent
          title: Event
        data:
          $ref: '#/components/schemas/QueuedEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryQueuedEvent
    TrajectoryCreatedEvent:
      properties:
        event:
          type: string
          const: CreatedEvent
          title: Event
        data:
          $ref: '#/components/schemas/CreatedEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryCreatedEvent
    TrajectoryExceptionEvent:
      properties:
        event:
          type: string
          const: ExceptionEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExceptionEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExceptionEvent
    TrajectoryCancelEvent:
      properties:
        event:
          type: string
          const: CancelEvent
          title: Event
        data:
          $ref: '#/components/schemas/CancelEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryCancelEvent
    TrajectoryScreenshotEvent:
      properties:
        event:
          type: string
          const: ScreenshotEvent
          title: Event
        data:
          $ref: '#/components/schemas/ScreenshotEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryScreenshotEvent
    TrajectoryStartEvent:
      properties:
        event:
          type: string
          const: StartEvent
          title: Event
        data:
          $ref: '#/components/schemas/StartEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryStartEvent
    TrajectoryFinalizeEvent:
      properties:
        event:
          type: string
          const: FinalizeEvent
          title: Event
        data:
          $ref: '#/components/schemas/FinalizeEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFinalizeEvent
    TrajectoryStopEvent:
      properties:
        event:
          type: string
          const: StopEvent
          title: Event
        data:
          $ref: '#/components/schemas/StopEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryStopEvent
    TrajectoryResultEvent:
      properties:
        event:
          type: string
          const: ResultEvent
          title: Event
        data:
          $ref: '#/components/schemas/TaskAPIResultEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryResultEvent
    TrajectoryManagerInputEvent:
      properties:
        event:
          type: string
          const: ManagerInputEvent
          title: Event
        data:
          $ref: '#/components/schemas/ManagerInputEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryManagerInputEvent
    TrajectoryManagerPlanEvent:
      properties:
        event:
          type: string
          const: ManagerPlanEvent
          title: Event
        data:
          $ref: '#/components/schemas/ManagerPlanEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryManagerPlanEvent
    TrajectoryExecutorInputEvent:
      properties:
        event:
          type: string
          const: ExecutorInputEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorInputEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorInputEvent
    TrajectoryExecutorResultEvent:
      properties:
        event:
          type: string
          const: ExecutorResultEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorResultEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorResultEvent
    TrajectoryFastAgentInputEvent:
      properties:
        event:
          type: string
          const: FastAgentInputEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentInputEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentInputEvent
    TrajectoryFastAgentResponseEvent:
      properties:
        event:
          type: string
          const: FastAgentResponseEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentResponseEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentResponseEvent
    TrajectoryFastAgentToolCallEvent:
      properties:
        event:
          type: string
          const: FastAgentToolCallEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentToolCallEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentToolCallEvent
    TrajectoryFastAgentOutputEvent:
      properties:
        event:
          type: string
          const: FastAgentOutputEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentOutputEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentOutputEvent
    TrajectoryFastAgentEndEvent:
      properties:
        event:
          type: string
          const: FastAgentEndEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentEndEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentEndEvent
    TrajectoryFastAgentExecuteEvent:
      properties:
        event:
          type: string
          const: FastAgentExecuteEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentExecuteEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentExecuteEvent
    TrajectoryFastAgentResultEvent:
      properties:
        event:
          type: string
          const: FastAgentResultEvent
          title: Event
        data:
          $ref: '#/components/schemas/FastAgentResultEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryFastAgentResultEvent
    TrajectoryToolExecutionEvent:
      properties:
        event:
          type: string
          const: ToolExecutionEvent
          title: Event
        data:
          $ref: '#/components/schemas/ToolExecutionEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryToolExecutionEvent
    TrajectoryRecordUIStateEvent:
      properties:
        event:
          type: string
          const: RecordUIStateEvent
          title: Event
        data:
          $ref: '#/components/schemas/RecordUIStateEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryRecordUIStateEvent
    TrajectoryManagerContextEvent:
      properties:
        event:
          type: string
          const: ManagerContextEvent
          title: Event
        data:
          $ref: '#/components/schemas/ManagerContextEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryManagerContextEvent
    TrajectoryManagerResponseEvent:
      properties:
        event:
          type: string
          const: ManagerResponseEvent
          title: Event
        data:
          $ref: '#/components/schemas/ManagerResponseEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryManagerResponseEvent
    TrajectoryManagerPlanDetailsEvent:
      properties:
        event:
          type: string
          const: ManagerPlanDetailsEvent
          title: Event
        data:
          $ref: '#/components/schemas/ManagerPlanDetailsEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryManagerPlanDetailsEvent
    TrajectoryExecutorContextEvent:
      properties:
        event:
          type: string
          const: ExecutorContextEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorContextEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorContextEvent
    TrajectoryExecutorResponseEvent:
      properties:
        event:
          type: string
          const: ExecutorResponseEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorResponseEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorResponseEvent
    TrajectoryExecutorActionEvent:
      properties:
        event:
          type: string
          const: ExecutorActionEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorActionEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorActionEvent
    TrajectoryExecutorActionResultEvent:
      properties:
        event:
          type: string
          const: ExecutorActionResultEvent
          title: Event
        data:
          $ref: '#/components/schemas/ExecutorActionResultEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryExecutorActionResultEvent
    TrajectoryUserMessageEvent:
      properties:
        event:
          type: string
          const: UserMessageEvent
          title: Event
        data:
          $ref: '#/components/schemas/UserMessageEvent'
      type: object
      required:
        - event
        - data
      title: TrajectoryUserMessageEvent
    TrajectoryUnknownEvent:
      properties:
        event:
          type: string
          title: Event
        data:
          additionalProperties: true
          type: object
          title: Data
          default: {}
      type: object
      required:
        - event
      title: TrajectoryUnknownEvent
    QueuedEvent:
      properties:
        id:
          type: string
          title: Id
        status:
          type: string
          title: Status
          default: queued
      type: object
      required:
        - id
      title: QueuedEvent
      description: Emitted to SSE clients when the task is waiting in the device queue.
    CreatedEvent:
      properties:
        id:
          type: string
          title: Id
        streamUrl:
          type: string
          title: Streamurl
      type: object
      required:
        - id
        - streamUrl
      title: CreatedEvent
    ExceptionEvent:
      properties:
        exception:
          type: string
          title: Exception
      type: object
      required:
        - exception
      title: ExceptionEvent
    CancelEvent:
      properties:
        reason:
          type: string
          title: Reason
      type: object
      required:
        - reason
      title: CancelEvent
    ScreenshotEvent:
      properties:
        url:
          type: string
          title: Url
        index:
          type: integer
          title: Index
      type: object
      required:
        - url
        - index
      title: ScreenshotEvent
    StartEvent:
      description: Implicit entry event sent to kick off a `Workflow.run()`.
      properties: {}
      title: StartEvent
      type: object
    FinalizeEvent:
      description: Trigger finalization.
      properties:
        success:
          title: Success
          type: boolean
        reason:
          title: Reason
          type: string
      required:
        - success
        - reason
      title: FinalizeEvent
      type: object
    StopEvent:
      description: >-
        Terminal event that signals the workflow has completed.


        The `result` property contains the return value of the workflow run.
        When a

        custom stop event subclass is used, the workflow result is that event

        instance itself.


        Examples:
            ```python
            # default stop event: result holds the value
            return StopEvent(result={"answer": 42})
            ```

            Subclassing to provide a custom result:

            ```python
            class MyStopEv(StopEvent):
                pass

            @step
            async def my_step(self, ctx: Context, ev: StartEvent) -> MyStopEv:
                return MyStopEv(result={"answer": 42})
      properties: {}
      title: StopEvent
      type: object
    TaskAPIResultEvent:
      properties:
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Success
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
        structured_output:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Structured Output
        steps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Steps
      type: object
      title: TaskAPIResultEvent
      description: |-
        Lazy wrapper — avoids importing droidrun at module level.

        The worker uses droidrun's ResultEvent directly; this model only
        exists so the API OpenAPI schema can reference it without the heavy
        droidrun import.
    ManagerInputEvent:
      description: Trigger Manager workflow for planning
      properties: {}
      title: ManagerInputEvent
      type: object
    ManagerPlanEvent:
      description: >-
        Coordination event from ManagerAgent to MobileAgent.


        Used for workflow step routing only (NOT streamed to frontend).

        For internal events with memory_update metadata, see
        ManagerPlanDetailsEvent.
      properties:
        plan:
          title: Plan
          type: string
        current_subgoal:
          title: Current Subgoal
          type: string
        thought:
          title: Thought
          type: string
        answer:
          default: ''
          title: Answer
          type: string
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Success
      required:
        - plan
        - current_subgoal
        - thought
      title: ManagerPlanEvent
      type: object
    ExecutorInputEvent:
      description: Trigger Executor workflow for action execution
      properties:
        current_subgoal:
          title: Current Subgoal
          type: string
      required:
        - current_subgoal
      title: ExecutorInputEvent
      type: object
    ExecutorResultEvent:
      description: Executor finished with action result.
      properties:
        action:
          additionalProperties: true
          title: Action
          type: object
        outcome:
          title: Outcome
          type: boolean
        error:
          title: Error
          type: string
        summary:
          title: Summary
          type: string
      required:
        - action
        - outcome
        - error
        - summary
      title: ExecutorResultEvent
      type: object
    FastAgentInputEvent:
      description: Input ready for LLM.
      properties: {}
      title: FastAgentInputEvent
      type: object
    FastAgentResponseEvent:
      description: LLM response received.
      properties:
        thought:
          title: Thought
          type: string
        code:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Code
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - thought
      title: FastAgentResponseEvent
      type: object
    FastAgentToolCallEvent:
      description: Tool calls ready to execute.
      properties:
        tool_calls_repr:
          title: Tool Calls Repr
          type: string
      required:
        - tool_calls_repr
      title: FastAgentToolCallEvent
      type: object
    FastAgentOutputEvent:
      description: Tool execution result.
      properties:
        output:
          title: Output
          type: string
      required:
        - output
      title: FastAgentOutputEvent
      type: object
    FastAgentEndEvent:
      description: FastAgent finished.
      properties:
        success:
          title: Success
          type: boolean
        reason:
          title: Reason
          type: string
        tool_call_count:
          default: 0
          title: Tool Call Count
          type: integer
      required:
        - success
        - reason
      title: FastAgentEndEvent
      type: object
    FastAgentExecuteEvent:
      properties:
        instruction:
          title: Instruction
          type: string
      required:
        - instruction
      title: FastAgentExecuteEvent
      type: object
    FastAgentResultEvent:
      properties:
        success:
          title: Success
          type: boolean
        reason:
          title: Reason
          type: string
        instruction:
          title: Instruction
          type: string
      required:
        - success
        - reason
        - instruction
      title: FastAgentResultEvent
      type: object
    ToolExecutionEvent:
      description: Emitted after every tool call dispatched through ToolRegistry.
      properties:
        tool_name:
          title: Tool Name
          type: string
        tool_args:
          additionalProperties: true
          title: Tool Args
          type: object
        success:
          title: Success
          type: boolean
        summary:
          title: Summary
          type: string
      required:
        - tool_name
        - tool_args
        - success
        - summary
      title: ToolExecutionEvent
      type: object
    RecordUIStateEvent:
      properties:
        url:
          type: string
          title: Url
        index:
          type: integer
          title: Index
      type: object
      required:
        - url
        - index
      title: RecordUIStateEvent
    ManagerContextEvent:
      description: Context prepared, ready for LLM call.
      properties: {}
      title: ManagerContextEvent
      type: object
    ManagerResponseEvent:
      description: LLM response received, ready for parsing.
      properties:
        response:
          title: Response
          type: string
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - response
      title: ManagerResponseEvent
      type: object
    ManagerPlanDetailsEvent:
      description: Plan parsed and ready (internal event with full details).
      properties:
        plan:
          title: Plan
          type: string
        subgoal:
          title: Subgoal
          type: string
        thought:
          title: Thought
          type: string
        answer:
          default: ''
          title: Answer
          type: string
        memory_update:
          default: ''
          title: Memory Update
          type: string
        progress_summary:
          default: ''
          title: Progress Summary
          type: string
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          default: null
          title: Success
        full_response:
          default: ''
          title: Full Response
          type: string
      required:
        - plan
        - subgoal
        - thought
      title: ManagerPlanDetailsEvent
      type: object
    ExecutorContextEvent:
      description: Context prepared, ready for LLM call.
      properties:
        subgoal:
          title: Subgoal
          type: string
      required:
        - subgoal
      title: ExecutorContextEvent
      type: object
    ExecutorResponseEvent:
      description: LLM response received, ready for parsing.
      properties:
        response:
          title: Response
          type: string
        usage:
          anyOf:
            - $ref: '#/components/schemas/UsageResult'
            - type: 'null'
          default: null
      required:
        - response
      title: ExecutorResponseEvent
      type: object
    ExecutorActionEvent:
      description: Action parsed, ready to execute.
      properties:
        action_json:
          title: Action Json
          type: string
        thought:
          title: Thought
          type: string
        description:
          title: Description
          type: string
        full_response:
          default: ''
          title: Full Response
          type: string
      required:
        - action_json
        - thought
        - description
      title: ExecutorActionEvent
      type: object
    ExecutorActionResultEvent:
      description: Action execution result (internal event with full details).
      properties:
        action:
          additionalProperties: true
          title: Action
          type: object
        success:
          title: Success
          type: boolean
        error:
          title: Error
          type: string
        summary:
          title: Summary
          type: string
        thought:
          default: ''
          title: Thought
          type: string
        full_response:
          default: ''
          title: Full Response
          type: string
      required:
        - action
        - success
        - error
        - summary
      title: ExecutorActionResultEvent
      type: object
    UserMessageEvent:
      properties:
        action:
          type: string
          title: Action
        message_ids:
          items:
            type: string
          type: array
          title: Message Ids
        consumer:
          anyOf:
            - type: string
            - type: 'null'
          title: Consumer
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        step_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Step Number
      type: object
      required:
        - action
        - message_ids
      title: UserMessageEvent
      description: >-
        Tracks the lifecycle of an external user message: queued → applied |
        dropped.
    UsageResult:
      properties:
        request_tokens:
          type: integer
          title: Request Tokens
        response_tokens:
          type: integer
          title: Response Tokens
        total_tokens:
          type: integer
          title: Total Tokens
        requests:
          type: integer
          title: Requests
      type: object
      required:
        - request_tokens
        - response_tokens
        - total_tokens
        - requests
      title: UsageResult
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header
