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,
"apps": [
"<string>"
],
"continueOnFailure": false,
"credentials": [
{
"credentialNames": [
"<string>"
],
"packageName": "<string>"
}
],
"displayId": 0,
"executionTimeout": 1000,
"files": [
"<string>"
],
"llmModel": "openai/gpt-5.6-luna",
"maxSteps": 100,
"outputSchema": {},
"reasoning": true,
"recordingEnabled": false,
"stealth": false,
"subagentModel": "openai/gpt-5.6-luna",
"systemPrompt": "<string>",
"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,
'apps' => [
'<string>'
],
'continueOnFailure' => false,
'credentials' => [
[
'credentialNames' => [
'<string>'
],
'packageName' => '<string>'
]
],
'displayId' => 0,
'executionTimeout' => 1000,
'files' => [
'<string>'
],
'llmModel' => 'openai/gpt-5.6-luna',
'maxSteps' => 100,
'outputSchema' => [
],
'reasoning' => true,
'recordingEnabled' => false,
'stealth' => false,
'subagentModel' => 'openai/gpt-5.6-luna',
'systemPrompt' => '<string>',
'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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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>"
}Run Streamed Task
Create and dispatch a new agent task, returning an SSE stream of task events. Cancels the task if the client disconnects.
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,
"apps": [
"<string>"
],
"continueOnFailure": false,
"credentials": [
{
"credentialNames": [
"<string>"
],
"packageName": "<string>"
}
],
"displayId": 0,
"executionTimeout": 1000,
"files": [
"<string>"
],
"llmModel": "openai/gpt-5.6-luna",
"maxSteps": 100,
"outputSchema": {},
"reasoning": true,
"recordingEnabled": false,
"stealth": false,
"subagentModel": "openai/gpt-5.6-luna",
"systemPrompt": "<string>",
"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,
'apps' => [
'<string>'
],
'continueOnFailure' => false,
'credentials' => [
[
'credentialNames' => [
'<string>'
],
'packageName' => '<string>'
]
],
'displayId' => 0,
'executionTimeout' => 1000,
'files' => [
'<string>'
],
'llmModel' => 'openai/gpt-5.6-luna',
'maxSteps' => 100,
'outputSchema' => [
],
'reasoning' => true,
'recordingEnabled' => false,
'stealth' => false,
'subagentModel' => 'openai/gpt-5.6-luna',
'systemPrompt' => '<string>',
'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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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 \"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\": \"openai/gpt-5.6-luna\",\n \"maxSteps\": 100,\n \"outputSchema\": {},\n \"reasoning\": true,\n \"recordingEnabled\": false,\n \"stealth\": false,\n \"subagentModel\": \"openai/gpt-5.6-luna\",\n \"systemPrompt\": \"<string>\",\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
The ID of the device to run the task on.
1Show child attributes
Show child attributes
The display ID of the device to run the task on.
Maximum agent execution time in seconds (1–2700).
1 <= x <= 2700The LLM model identifier to use for the task (e.g. 'openai/gpt-5.6-luna')
Record device video for the whole task and persist a retrievable reference
LLM model used by sub-agent roles: executor, app_opener, structured_output
Optional custom behavioral overlay applied on top of the agent's default system prompts. Never echoed back in responses or errors.
32000Deprecated and ignored. Sampling behavior is controlled by the model provider.
US, BR, FR, DE, IN, JP, KR, ZA Response
Successful Response
Was this page helpful?