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)curl --request POST \
--url https://api.mobilerun.ai/v1/tasks/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task": "<string>",
"accessibility": true,
"agentId": 0,
"apps": [
"<string>"
],
"continueOnFailure": false,
"credentials": [
{
"credentialNames": [
"<string>"
],
"packageName": "<string>"
}
],
"displayId": 0,
"executionTimeout": 1000,
"files": [
"<string>"
],
"llmModel": "google/gemini-3.5-flash",
"maxSteps": 100,
"memoryNamespace": "default",
"outputSchema": {},
"reasoning": true,
"stealth": false,
"subagentModel": "google/gemini-3.5-flash",
"temperature": 0.5,
"vision": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/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([
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'task' => '<string>',
'accessibility' => true,
'agentId' => 0,
'apps' => [
'<string>'
],
'continueOnFailure' => false,
'credentials' => [
[
'credentialNames' => [
'<string>'
],
'packageName' => '<string>'
]
],
'displayId' => 0,
'executionTimeout' => 1000,
'files' => [
'<string>'
],
'llmModel' => 'google/gemini-3.5-flash',
'maxSteps' => 100,
'memoryNamespace' => 'default',
'outputSchema' => [
],
'reasoning' => true,
'stealth' => false,
'subagentModel' => 'google/gemini-3.5-flash',
'temperature' => 0.5,
'vision' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/tasks/stream"
payload := strings.NewReader("{\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/tasks/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/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 \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "You are not authorized to access this resource",
"errors": [],
"status": 401,
"title": "Unauthorized"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}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)curl --request POST \
--url https://api.mobilerun.ai/v1/tasks/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deviceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task": "<string>",
"accessibility": true,
"agentId": 0,
"apps": [
"<string>"
],
"continueOnFailure": false,
"credentials": [
{
"credentialNames": [
"<string>"
],
"packageName": "<string>"
}
],
"displayId": 0,
"executionTimeout": 1000,
"files": [
"<string>"
],
"llmModel": "google/gemini-3.5-flash",
"maxSteps": 100,
"memoryNamespace": "default",
"outputSchema": {},
"reasoning": true,
"stealth": false,
"subagentModel": "google/gemini-3.5-flash",
"temperature": 0.5,
"vision": false
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/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([
'deviceId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'task' => '<string>',
'accessibility' => true,
'agentId' => 0,
'apps' => [
'<string>'
],
'continueOnFailure' => false,
'credentials' => [
[
'credentialNames' => [
'<string>'
],
'packageName' => '<string>'
]
],
'displayId' => 0,
'executionTimeout' => 1000,
'files' => [
'<string>'
],
'llmModel' => 'google/gemini-3.5-flash',
'maxSteps' => 100,
'memoryNamespace' => 'default',
'outputSchema' => [
],
'reasoning' => true,
'stealth' => false,
'subagentModel' => 'google/gemini-3.5-flash',
'temperature' => 0.5,
'vision' => false
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/tasks/stream"
payload := strings.NewReader("{\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/tasks/stream")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/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 \"deviceId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"task\": \"<string>\",\n \"accessibility\": true,\n \"agentId\": 0,\n \"apps\": [\n \"<string>\"\n ],\n \"continueOnFailure\": false,\n \"credentials\": [\n {\n \"credentialNames\": [\n \"<string>\"\n ],\n \"packageName\": \"<string>\"\n }\n ],\n \"displayId\": 0,\n \"executionTimeout\": 1000,\n \"files\": [\n \"<string>\"\n ],\n \"llmModel\": \"google/gemini-3.5-flash\",\n \"maxSteps\": 100,\n \"memoryNamespace\": \"default\",\n \"outputSchema\": {},\n \"reasoning\": true,\n \"stealth\": false,\n \"subagentModel\": \"google/gemini-3.5-flash\",\n \"temperature\": 0.5,\n \"vision\": false\n}"
response = http.request(request)
puts response.read_body{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "You are not authorized to access this resource",
"errors": [],
"status": 401,
"title": "Unauthorized"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}{
"detail": "<string>",
"errors": [
"<unknown>"
],
"status": 123,
"title": "<string>"
}Authorizations
Bearer token via Authorization header
Body
application/json
The ID of the device to run the task on.
Minimum string length:
1Show child attributes
Show child attributes
The display ID of the device to run the task on.
The LLM model identifier to use for the task (e.g. 'google/gemini-3.5-flash')
Memory namespace for cross-task personalization
LLM model used by sub-agent roles: executor, app_opener, structured_output
Available options:
US, BR, FR, DE, IN, JP, KR, ZA Response
Successful Response
Was this page helpful?
⌘I