Send a user event (SSE)
curl --request POST \
--url https://api.profy.cn/v1/sessions/{session_id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"type": "user.message",
"model": "<string>",
"attachment_file_ids": [
"<string>"
],
"tool_confirmations": [
{
"tool_call_id": "<string>",
"tool_name": "<string>",
"decision": "<string>",
"modified_parameters": {}
}
],
"enabled_plugins": [
"<string>"
],
"skill_names": [
"<string>"
],
"enable_memory": false,
"permission_mode": "plan",
"working_directory": "<string>",
"selected_image_model": "<string>",
"selected_video_model": "<string>",
"selected_speech_model": "<string>",
"selected_music_model": "<string>",
"image_parameters": {},
"video_parameters": {}
}
'import requests
url = "https://api.profy.cn/v1/sessions/{session_id}/events"
payload = {
"content": "<string>",
"type": "user.message",
"model": "<string>",
"attachment_file_ids": ["<string>"],
"tool_confirmations": [
{
"tool_call_id": "<string>",
"tool_name": "<string>",
"decision": "<string>",
"modified_parameters": {}
}
],
"enabled_plugins": ["<string>"],
"skill_names": ["<string>"],
"enable_memory": False,
"permission_mode": "plan",
"working_directory": "<string>",
"selected_image_model": "<string>",
"selected_video_model": "<string>",
"selected_speech_model": "<string>",
"selected_music_model": "<string>",
"image_parameters": {},
"video_parameters": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
type: 'user.message',
model: '<string>',
attachment_file_ids: ['<string>'],
tool_confirmations: [
{
tool_call_id: '<string>',
tool_name: '<string>',
decision: '<string>',
modified_parameters: {}
}
],
enabled_plugins: ['<string>'],
skill_names: ['<string>'],
enable_memory: false,
permission_mode: 'plan',
working_directory: '<string>',
selected_image_model: '<string>',
selected_video_model: '<string>',
selected_speech_model: '<string>',
selected_music_model: '<string>',
image_parameters: {},
video_parameters: {}
})
};
fetch('https://api.profy.cn/v1/sessions/{session_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.profy.cn/v1/sessions/{session_id}/events",
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([
'content' => '<string>',
'type' => 'user.message',
'model' => '<string>',
'attachment_file_ids' => [
'<string>'
],
'tool_confirmations' => [
[
'tool_call_id' => '<string>',
'tool_name' => '<string>',
'decision' => '<string>',
'modified_parameters' => [
]
]
],
'enabled_plugins' => [
'<string>'
],
'skill_names' => [
'<string>'
],
'enable_memory' => false,
'permission_mode' => 'plan',
'working_directory' => '<string>',
'selected_image_model' => '<string>',
'selected_video_model' => '<string>',
'selected_speech_model' => '<string>',
'selected_music_model' => '<string>',
'image_parameters' => [
],
'video_parameters' => [
]
]),
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.profy.cn/v1/sessions/{session_id}/events"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\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.profy.cn/v1/sessions/{session_id}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.profy.cn/v1/sessions/{session_id}/events")
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 \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\n}"
response = http.request(request)
puts response.read_body<string>Sessions
Send a Session Event (SSE)
Appends a user message and streams the agent response. Same SSE vocabulary as POST /v1/agents/run. Billing precharges per event, not per session. Closing the stream does not cancel the run. The same body while a run is generating resubscribes; a different body returns 409.
POST
/
v1
/
sessions
/
{session_id}
/
events
Send a user event (SSE)
curl --request POST \
--url https://api.profy.cn/v1/sessions/{session_id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>",
"type": "user.message",
"model": "<string>",
"attachment_file_ids": [
"<string>"
],
"tool_confirmations": [
{
"tool_call_id": "<string>",
"tool_name": "<string>",
"decision": "<string>",
"modified_parameters": {}
}
],
"enabled_plugins": [
"<string>"
],
"skill_names": [
"<string>"
],
"enable_memory": false,
"permission_mode": "plan",
"working_directory": "<string>",
"selected_image_model": "<string>",
"selected_video_model": "<string>",
"selected_speech_model": "<string>",
"selected_music_model": "<string>",
"image_parameters": {},
"video_parameters": {}
}
'import requests
url = "https://api.profy.cn/v1/sessions/{session_id}/events"
payload = {
"content": "<string>",
"type": "user.message",
"model": "<string>",
"attachment_file_ids": ["<string>"],
"tool_confirmations": [
{
"tool_call_id": "<string>",
"tool_name": "<string>",
"decision": "<string>",
"modified_parameters": {}
}
],
"enabled_plugins": ["<string>"],
"skill_names": ["<string>"],
"enable_memory": False,
"permission_mode": "plan",
"working_directory": "<string>",
"selected_image_model": "<string>",
"selected_video_model": "<string>",
"selected_speech_model": "<string>",
"selected_music_model": "<string>",
"image_parameters": {},
"video_parameters": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: '<string>',
type: 'user.message',
model: '<string>',
attachment_file_ids: ['<string>'],
tool_confirmations: [
{
tool_call_id: '<string>',
tool_name: '<string>',
decision: '<string>',
modified_parameters: {}
}
],
enabled_plugins: ['<string>'],
skill_names: ['<string>'],
enable_memory: false,
permission_mode: 'plan',
working_directory: '<string>',
selected_image_model: '<string>',
selected_video_model: '<string>',
selected_speech_model: '<string>',
selected_music_model: '<string>',
image_parameters: {},
video_parameters: {}
})
};
fetch('https://api.profy.cn/v1/sessions/{session_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.profy.cn/v1/sessions/{session_id}/events",
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([
'content' => '<string>',
'type' => 'user.message',
'model' => '<string>',
'attachment_file_ids' => [
'<string>'
],
'tool_confirmations' => [
[
'tool_call_id' => '<string>',
'tool_name' => '<string>',
'decision' => '<string>',
'modified_parameters' => [
]
]
],
'enabled_plugins' => [
'<string>'
],
'skill_names' => [
'<string>'
],
'enable_memory' => false,
'permission_mode' => 'plan',
'working_directory' => '<string>',
'selected_image_model' => '<string>',
'selected_video_model' => '<string>',
'selected_speech_model' => '<string>',
'selected_music_model' => '<string>',
'image_parameters' => [
],
'video_parameters' => [
]
]),
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.profy.cn/v1/sessions/{session_id}/events"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\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.profy.cn/v1/sessions/{session_id}/events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.profy.cn/v1/sessions/{session_id}/events")
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 \"content\": \"<string>\",\n \"type\": \"user.message\",\n \"model\": \"<string>\",\n \"attachment_file_ids\": [\n \"<string>\"\n ],\n \"tool_confirmations\": [\n {\n \"tool_call_id\": \"<string>\",\n \"tool_name\": \"<string>\",\n \"decision\": \"<string>\",\n \"modified_parameters\": {}\n }\n ],\n \"enabled_plugins\": [\n \"<string>\"\n ],\n \"skill_names\": [\n \"<string>\"\n ],\n \"enable_memory\": false,\n \"permission_mode\": \"plan\",\n \"working_directory\": \"<string>\",\n \"selected_image_model\": \"<string>\",\n \"selected_video_model\": \"<string>\",\n \"selected_speech_model\": \"<string>\",\n \"selected_music_model\": \"<string>\",\n \"image_parameters\": {},\n \"video_parameters\": {}\n}"
response = http.request(request)
puts response.read_body<string>Authorizations
BearerTokenApiKey
OAuth2 access token issued via POST /oauth/token
Path Parameters
Body
application/json
Available options:
user.message Maximum array length:
20Show child attributes
Show child attributes
Available options:
plan Response
SSE stream (text/event-stream)
The response is of type string.

