curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Add input validation to the /users endpoint"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"prompt": "Add input validation to the /users endpoint"},
stream=True,
)
for line in response.iter_lines():
if line:
print(line.decode())
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Add input validation to the /users endpoint",
}),
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
{
"type": "text",
"content": "I'll add input validation to the /users endpoint using Zod..."
}
Prompts
Send Prompt
Send a prompt to the coding agent in the session
POST
/
api
/
sessions
/
{session_id}
/
prompt
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Add input validation to the /users endpoint"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"prompt": "Add input validation to the /users endpoint"},
stream=True,
)
for line in response.iter_lines():
if line:
print(line.decode())
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Add input validation to the /users endpoint",
}),
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
{
"type": "text",
"content": "I'll add input validation to the /users endpoint using Zod..."
}
Sends a prompt to the coding agent running in the session. Returns a streaming response with the agent’s output.
Required scope:
sessions:prompt
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxBody
string
required
The prompt text to send to the agent.
string
Tab ID for multi-tab sessions. Defaults to the primary tab.
Response
Returns a streaming response (text/event-stream) with agent output events.
string
Event type:
text, tool_use, tool_result, error, done.string
Event content (text output, tool call details, etc.).
curl -X POST "https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt" \
-H "Authorization: Bearer runtm_xxx" \
-H "Content-Type: application/json" \
-d '{"prompt": "Add input validation to the /users endpoint"}'
import requests
response = requests.post(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
headers={
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
json={"prompt": "Add input validation to the /users endpoint"},
stream=True,
)
for line in response.iter_lines():
if line:
print(line.decode())
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/prompt",
{
method: "POST",
headers: {
"Authorization": "Bearer runtm_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "Add input validation to the /users endpoint",
}),
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
console.log(decoder.decode(value));
}
{
"type": "text",
"content": "I'll add input validation to the /users endpoint using Zod..."
}