JavaScript
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);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)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Tasks.RunStreamed(context.TODO(), mobileruncloud.TaskRunStreamedParams{
DeviceID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Task: "x",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}mobilerun-cloud tasks run-streamed \
--api-key 'My API Key' \
--device-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--task xcurl --request POST \
--url https://api.mobilerun.ai/tasks/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task": "<string>",
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": 0,
"llmModel": "google/gemini-3.1-flash-lite",
"maxSteps": 100,
"temperature": 0.5,
"reasoning": true,
"accessibility": true,
"vision": false,
"executionTimeout": 1000,
"credentials": [
{
"packageName": "<string>",
"credentialNames": [
"<string>"
]
}
],
"apps": [
"<string>"
],
"files": [
"<string>"
],
"outputSchema": {},
"subagentModel": "google/gemini-3.1-flash-lite",
"stealth": false,
"continueOnFailure": false,
"memoryNamespace": "default",
"displayId": 0
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/tasks/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task' => '<string>',
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentId' => 0,
'llmModel' => 'google/gemini-3.1-flash-lite',
'maxSteps' => 100,
'temperature' => 0.5,
'reasoning' => true,
'accessibility' => true,
'vision' => false,
'executionTimeout' => 1000,
'credentials' => [
[
'packageName' => '<string>',
'credentialNames' => [
'<string>'
]
]
],
'apps' => [
'<string>'
],
'files' => [
'<string>'
],
'outputSchema' => [
],
'subagentModel' => 'google/gemini-3.1-flash-lite',
'stealth' => false,
'continueOnFailure' => false,
'memoryNamespace' => 'default',
'displayId' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/tasks/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"task\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentId\": 0,\n \"llmModel\": \"google/gemini-3.1-flash-lite\",\n \"maxSteps\": 100,\n \"temperature\": 0.5,\n \"reasoning\": true,\n \"accessibility\": true,\n \"vision\": false,\n \"executionTimeout\": 1000,\n \"credentials\": [\n {\n \"packageName\": \"<string>\",\n \"credentialNames\": [\n \"<string>\"\n ]\n }\n ],\n \"apps\": [\n \"<string>\"\n ],\n \"files\": [\n \"<string>\"\n ],\n \"outputSchema\": {},\n \"subagentModel\": \"google/gemini-3.1-flash-lite\",\n \"stealth\": false,\n \"continueOnFailure\": false,\n \"memoryNamespace\": \"default\",\n \"displayId\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/tasks/stream")
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 \"task\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentId\": 0,\n \"llmModel\": \"google/gemini-3.1-flash-lite\",\n \"maxSteps\": 100,\n \"temperature\": 0.5,\n \"reasoning\": true,\n \"accessibility\": true,\n \"vision\": false,\n \"executionTimeout\": 1000,\n \"credentials\": [\n {\n \"packageName\": \"<string>\",\n \"credentialNames\": [\n \"<string>\"\n ]\n }\n ],\n \"apps\": [\n \"<string>\"\n ],\n \"files\": [\n \"<string>\"\n ],\n \"outputSchema\": {},\n \"subagentModel\": \"google/gemini-3.1-flash-lite\",\n \"stealth\": false,\n \"continueOnFailure\": false,\n \"memoryNamespace\": \"default\",\n \"displayId\": 0\n}"
response = http.request(request)
puts response.read_body{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "Unauthorized",
"status": 401,
"detail": "You are not authorized to access this resource",
"errors": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}Tasks
Run Streamed Task
Create and dispatch a new agent task, returning an SSE stream of task events. Cancels the task if the client disconnects.
POST
/
tasks
/
stream
JavaScript
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);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)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Tasks.RunStreamed(context.TODO(), mobileruncloud.TaskRunStreamedParams{
DeviceID: "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
Task: "x",
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}mobilerun-cloud tasks run-streamed \
--api-key 'My API Key' \
--device-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--task xcurl --request POST \
--url https://api.mobilerun.ai/tasks/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"task": "<string>",
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": 0,
"llmModel": "google/gemini-3.1-flash-lite",
"maxSteps": 100,
"temperature": 0.5,
"reasoning": true,
"accessibility": true,
"vision": false,
"executionTimeout": 1000,
"credentials": [
{
"packageName": "<string>",
"credentialNames": [
"<string>"
]
}
],
"apps": [
"<string>"
],
"files": [
"<string>"
],
"outputSchema": {},
"subagentModel": "google/gemini-3.1-flash-lite",
"stealth": false,
"continueOnFailure": false,
"memoryNamespace": "default",
"displayId": 0
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/tasks/stream",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task' => '<string>',
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agentId' => 0,
'llmModel' => 'google/gemini-3.1-flash-lite',
'maxSteps' => 100,
'temperature' => 0.5,
'reasoning' => true,
'accessibility' => true,
'vision' => false,
'executionTimeout' => 1000,
'credentials' => [
[
'packageName' => '<string>',
'credentialNames' => [
'<string>'
]
]
],
'apps' => [
'<string>'
],
'files' => [
'<string>'
],
'outputSchema' => [
],
'subagentModel' => 'google/gemini-3.1-flash-lite',
'stealth' => false,
'continueOnFailure' => false,
'memoryNamespace' => 'default',
'displayId' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/tasks/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"task\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentId\": 0,\n \"llmModel\": \"google/gemini-3.1-flash-lite\",\n \"maxSteps\": 100,\n \"temperature\": 0.5,\n \"reasoning\": true,\n \"accessibility\": true,\n \"vision\": false,\n \"executionTimeout\": 1000,\n \"credentials\": [\n {\n \"packageName\": \"<string>\",\n \"credentialNames\": [\n \"<string>\"\n ]\n }\n ],\n \"apps\": [\n \"<string>\"\n ],\n \"files\": [\n \"<string>\"\n ],\n \"outputSchema\": {},\n \"subagentModel\": \"google/gemini-3.1-flash-lite\",\n \"stealth\": false,\n \"continueOnFailure\": false,\n \"memoryNamespace\": \"default\",\n \"displayId\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/tasks/stream")
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 \"task\": \"<string>\",\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agentId\": 0,\n \"llmModel\": \"google/gemini-3.1-flash-lite\",\n \"maxSteps\": 100,\n \"temperature\": 0.5,\n \"reasoning\": true,\n \"accessibility\": true,\n \"vision\": false,\n \"executionTimeout\": 1000,\n \"credentials\": [\n {\n \"packageName\": \"<string>\",\n \"credentialNames\": [\n \"<string>\"\n ]\n }\n ],\n \"apps\": [\n \"<string>\"\n ],\n \"files\": [\n \"<string>\"\n ],\n \"outputSchema\": {},\n \"subagentModel\": \"google/gemini-3.1-flash-lite\",\n \"stealth\": false,\n \"continueOnFailure\": false,\n \"memoryNamespace\": \"default\",\n \"displayId\": 0\n}"
response = http.request(request)
puts response.read_body{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "Unauthorized",
"status": 401,
"detail": "You are not authorized to access this resource",
"errors": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}Authorizations
Bearer token via Authorization header
Body
application/json
Minimum string length:
1The ID of the device to run the task on.
The LLM model identifier to use for the task (e.g. 'google/gemini-3.1-flash-lite')
Show child attributes
Show child attributes
Available options:
US, BR, FR, DE, IN, JP, KR, ZA LLM model used by sub-agent roles: executor, app_opener, structured_output
Memory namespace for cross-task personalization
The display ID of the device to run the task on.
Response
Successful Response
Was this page helpful?
⌘I