Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.
Required on API-key calls. A stable id for the terminal user. Omitting it returns 400. OAuth calls do not need it. Billing still charges the API key owner.
请求体
application/json
agent
object · objectstring
Expert object for this run. id is the expert. model, rules, subagents, expert_partner, and tools override the platform values when present. A bare string is also accepted and means the id only. Top-level expert_identifier is an alias and wins over agent.id.
Show child attributes
示例:
{ "id": "my-expert", "model": "gpt-6-astra" }
expert_identifier
string
Alias of agent. When both are set, this value wins.
environment
object
Where this run executes. Omitted type means profy_hosted. openai_hosted and any other type return 400. A built_in skill loads that primary-runtime skill (documents, pdf, spreadsheets, presentations, and the rest of that set); name "*" loads every primary-runtime plugin. A plugin id ending in @profy-primary-runtime loads that plugin. Other plugin ids select installed plugins. Omit plugins and a new session selects none.
Show child attributes
input
stringmessages · object[]
What to send the Expert. Switch between a string and a message array. The last user message is used. Missing input returns Missing required field: input, unless tool_confirmations is non-empty.
message
string
Alias of input. Used only when input is omitted.
stream
boolean
默认值:true
Must be true or omitted. false returns 400. This endpoint is SSE only.
session_id
string
Platform-issued session id from the X-Session-Id response header. An unknown id is replaced with a new session.
model
string
Alias of agent.model. The value inside agent wins.
metadata
object
Optional. profy_eval binds this turn to an offline experiment: experiment_id, task, trial. The key owner must be the expert creator. The object is removed before the prompt and attachments. The caller cannot submit a score.
Show child attributes
attachment_file_ids
string[]
File ids from POST /v1/files. Ids only — the platform never fetches a caller-supplied URL.
Maximum array length: 20
tool_confirmations
object[]
HITL resume answers. When non-empty, input may be omitted. Reuse the session_id from the turn that emitted request_user_input.
Show child attributes
enabled_plugins
string[]
Plugin ids for this turn. Prefer environment.plugins. Empty array clears sticky selection.
skill_names
string[]
Qualified skill names: user/ or expert/.
enable_memory
boolean
默认值:false
Opt-in memory for Platform invokes. Default false.
permission_mode
enum<string>
Only "plan" is accepted.
可用选项:
plan
working_directory
string
selected_image_model
string
selected_video_model
string
selected_speech_model
string
selected_music_model
string
image_parameters
object
video_parameters
object
响应
text/event-stream. Each event is an event: line, a data: line of JSON, then a blank line. Every JSON object has type and a monotonic event_id starting at 1. The stream ends with data: [DONE], which is not JSON. Read output text from delta, not content. tool_call.arguments.delta carries args_chunk. The tool result is tool_call.result, not a field on tool_call.completed. run.failed carries error, not message. usage.token carries prompt_tokens, completion_tokens, and total_tokens. Unknown event names are passed through. Response header X-Session-Id is the session id and is set when the handshake succeeds. Closing the connection after that does not cancel the run. Stop with POST /v1/sessions/{id}/interrupt. The same body while the run is generating resubscribes.
SSE text. Do not JSON.parse a line until you have skipped data: [DONE].
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Profy","description":"Profy: Create, distribute, and monetize autonomous AI Experts","colors":{"primary":"#a8866a","light":"#c4a882","dark":"#8c6e54"},"logo":{"light":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/light.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=ffc1ff6107891bf45491112c285c11a0","dark":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/dark.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=7b54e1f376f1ff2c09e632a500e53662"},"favicon":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/favicon.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=56aea7fcf58bfa0eea34e8528d6a751c","api":{"playground":{"display":"interactive"}},"navbar":{"links":[{"icon":"arrow-up-right-from-square","href":"https://app.profy.cn","label":"控制台"}]},"footer":{"socials":{"website":"https://profy.cn"},"links":[{"header":"产品","items":[{"label":"控制台","href":"https://app.profy.cn"},{"label":"开放平台","href":"https://platform.profy.cn"}]},{"header":"文档","items":[{"label":"快速开始","href":"https://docs.profy.cn/zh/documentation/get-started/quickstart"},{"label":"开发者","href":"https://docs.profy.cn/zh/developers/overview"}]}]},"search":{},"seo":{"indexing":"navigable"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"zh","href":"zh/documentation/get-started/what-is-profy"},{"language":"en","href":"en/documentation/get-started/what-is-profy"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"profy-46233240","hasAudioNarration":false,"actualSubdomain":"profy-46233240","customDomains":["docs.profy.cn"],"gitSource":{"type":"github","owner":"autoagents-ai","repo":"profy","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10e8429ffae5051c41430f"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b13ef2a6e4c9d2585379605","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"zh","tag":"文档","count":92},{"language":"en","tag":"Documentation","count":91},{"language":"en","tag":"Guides","count":57},{"language":"zh","tag":"使用指南","count":57},{"language":"en","tag":"Developers","count":29},{"language":"zh","tag":"开发者","count":29},{"language":"zh","tag":"平台与账户","count":16},{"language":"en","tag":"API Reference","count":15},{"language":"en","tag":"Platform \u0026 Account","count":15},{"language":"zh","tag":"API 参考","count":15},{"language":"en","tag":"Creators","count":12},{"language":"en","tag":"Deep Dive","count":12},{"language":"en","tag":"Plugin Tools","count":12},{"language":"zh","tag":"创作者","count":12},{"language":"zh","tag":"深入了解","count":12},{"language":"zh","tag":"插件工具","count":12},{"language":"en","tag":"How It Works","count":11},{"language":"zh","tag":"技术揭秘","count":11},{"language":"en","tag":"Reference","count":10},{"language":"zh","tag":"参考","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"zh/api/agents-run","slug":"/zh/api/agents-run","pageMetadata":{"title":"调用专家(SSE 流式)","openapi":"POST /v1/agents/run","description":"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.","href":"/zh/api/agents-run"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"调用专家(SSE 流式)","openapi":"POST /v1/agents/run","description":"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.","href":"/zh/api/agents-run"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"agentsRun","tags":["Agents API"],"summary":"Invoke an Expert (SSE stream)","description":"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.","security":["ce8bc2cd-0b60-42f4-879a-df6886f28dd7","6514acad-64f4-4971-aaf2-4746870481d2"],"requestBody":"bb94431d-5f6c-4e7b-a04e-1711153a09db","parameters":["7ad9f42c-77af-41a9-940e-afa0c48a0b5f"],"responses":{"200":"0841948a-dd3f-4144-ad13-323565517580","400":"3caba5d6-c416-4132-b394-05e9d1b7204e","401":"cfe190bb-881a-45ee-b00f-59b237f45b84","403":"b00f98ed-5451-49bd-b460-0ba47ddbb5cc","404":"a88178c6-9b53-4d09-9e3d-c177f1349004","409":"a7a53da3-d6e4-4f5a-9b53-e3cb7ed8b84e","500":"77edfc2e-87a5-4668-8397-3c2f5cb24698","502":"64f0a0a3-9ed2-42fe-9957-4fde367f81a2","503":"206e7bfd-bb74-4556-b145-0d3248988599","504":"4c876ad6-d8f5-4118-8262-e2e3822e4961"},"method":"post","type":"path","servers":["bf2619c6-5b55-4e1e-af75-c36b120d48f5"],"path":"/v1/agents/run","baseUrlOptions":["https://api.profy.cn"],"title":"Invoke an Expert (SSE stream)","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"7ad9f42c-77af-41a9-940e-afa0c48a0b5f":{"name":"X-Profy-End-User-Id","in":"header","required":false,"schema":{"type":"string","isRequired":false,"description":"Required on API-key calls. A stable id for the terminal user. Omitting it returns 400. OAuth calls do not need it. Billing still charges the API key owner.","uniqueKey":"","typeLabel":"string"},"example":"user-123","description":"Required on API-key calls. A stable id for the terminal user. Omitting it returns 400. OAuth calls do not need it. Billing still charges the API key owner."}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"oneOf":[{"type":"object","title":"object","description":"Expert object for this run. id is the expert. model, rules, subagents, expert_partner, and tools override the platform values when present. A bare string is also accepted and means the id only. Top-level expert_identifier is an alias and wins over agent.id.","example":{"id":"my-expert","model":"gpt-6-astra"},"properties":{"id":{"type":"string","uniqueKey":"agent.oneOf.0.id","typeLabel":"string"},"model":{"type":"string","description":"Model id only. Wins over the top-level model alias.","uniqueKey":"agent.oneOf.0.model","typeLabel":"string"},"rules":{"type":"array","description":"Replaces this expert's identity, soul, agent, and guard for this run. Omit to keep the Studio values. An empty array clears them. Each type may appear once.","items":{"type":"object","required":["type","content"],"properties":{"type":{"type":"string","enum":["identity","soul","agent","guard"],"isRequired":true,"uniqueKey":"agent.oneOf.0.rules.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"content":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.rules.items.[INDEX].content","typeLabel":"string"}},"uniqueKey":"agent.oneOf.0.rules.items.[INDEX]","typeLabel":"object"},"uniqueKey":"agent.oneOf.0.rules","typeLabel":"object[]"},"subagents":{"type":"object","description":"Replaces this expert's subagent roster for this run and turns spawning on. Omit to keep the Studio roster and the caller's multi-task switch.","properties":{"model":{"type":"string","description":"Default model for subagents. Each agent may override it.","uniqueKey":"agent.oneOf.0.subagents.model","typeLabel":"string"},"agents":{"type":"array","items":{"type":"object","required":["name","description","system_prompt","tools"],"properties":{"name":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].name","typeLabel":"string"},"description":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].description","typeLabel":"string"},"system_prompt":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].system_prompt","typeLabel":"string"},"tools":{"type":"array","items":{"type":"string","uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].tools.items.[INDEX]","typeLabel":"string"},"isRequired":true,"uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].tools","typeLabel":"string[]"},"model":{"type":"string","uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX].model","typeLabel":"string"}},"uniqueKey":"agent.oneOf.0.subagents.agents.items.[INDEX]","typeLabel":"object"},"uniqueKey":"agent.oneOf.0.subagents.agents","typeLabel":"object[]"}},"uniqueKey":"agent.oneOf.0.subagents","typeLabel":"object"},"expert_partner":{"type":"array","description":"Replaces this run's delegation roster. Omit to keep the platform roster. An empty array clears it. Listing an expert here does not grant access; delegate still checks that the caller can use that expert.","items":{"type":"object","required":["identifier"],"properties":{"identifier":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX].identifier","typeLabel":"string"},"name":{"type":"string","uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX].name","typeLabel":"string"},"brief":{"type":"string","uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX].brief","typeLabel":"string"},"description":{"type":"string","description":"Alias of brief.","uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX].description","typeLabel":"string"},"mentioned":{"type":"boolean","uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX].mentioned","typeLabel":"boolean"}},"uniqueKey":"agent.oneOf.0.expert_partner.items.[INDEX]","typeLabel":"object"},"uniqueKey":"agent.oneOf.0.expert_partner","typeLabel":"object[]"},"tools":{"type":"array","description":"This list extends the expert's platform tools for this run. A tool the array does not name keeps its platform on or off state. A named extension, web_search, or web_fetch is on for this run even when the platform switch is off. An empty array names nothing. Omitting the field also keeps the platform list. Each entry is {\"type\": ...}. Strings are rejected. Allowed types: request_user_input, imagegen, video, music, audio, generate_3d, postprocess_3d, generate_world, schedule, knowledge, obsidian_knowledge, memory, delegation, distill, web_search, web_fetch, mcp. mcp requires server_label and transport.type=http with server_url. The same server_label uses this request's URL and headers. MCP the request does not name stays on the expert. read, bash, and skill stay either way. Plugins are environment.plugins, not this list.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","isRequired":true,"uniqueKey":"agent.oneOf.0.tools.items.[INDEX].type","typeLabel":"string"},"server_label":{"type":"string","uniqueKey":"agent.oneOf.0.tools.items.[INDEX].server_label","typeLabel":"string"},"transport":{"type":"object","properties":{"type":{"type":"string","enum":["http"],"uniqueKey":"agent.oneOf.0.tools.items.[INDEX].transport.type","typeLabel":"enum\u003cstring>"},"server_url":{"type":"string","uniqueKey":"agent.oneOf.0.tools.items.[INDEX].transport.server_url","typeLabel":"string"}},"uniqueKey":"agent.oneOf.0.tools.items.[INDEX].transport","typeLabel":"object"}},"uniqueKey":"agent.oneOf.0.tools.items.[INDEX]","typeLabel":"object"},"uniqueKey":"agent.oneOf.0.tools","typeLabel":"object[]"}},"uniqueKey":"agent.oneOf.0","typeLabel":"object · object"},{"type":"string","title":"string","description":"Expert object for this run. id is the expert. model, rules, subagents, expert_partner, and tools override the platform values when present. A bare string is also accepted and means the id only. Top-level expert_identifier is an alias and wins over agent.id.","example":"my-expert","uniqueKey":"agent.oneOf.1","typeLabel":"string"}],"uniqueKey":"agent","typeLabel":"object · object | string"},"expert_identifier":{"type":"string","description":"Alias of agent. When both are set, this value wins.","uniqueKey":"expert_identifier","typeLabel":"string"},"environment":{"type":"object","description":"Where this run executes. Omitted type means profy_hosted. openai_hosted and any other type return 400. A built_in skill loads that primary-runtime skill (documents, pdf, spreadsheets, presentations, and the rest of that set); name \"*\" loads every primary-runtime plugin. A plugin id ending in @profy-primary-runtime loads that plugin. Other plugin ids select installed plugins. Omit plugins and a new session selects none.","properties":{"type":{"type":"string","enum":["profy_hosted","self_hosted","none"],"uniqueKey":"environment.type","typeLabel":"enum\u003cstring>"},"skills":{"type":"array","items":{"type":"object","description":"One skill for this run. built_in loads that primary-runtime skill. name \"*\" loads every primary-runtime plugin. customize reads the key owner's or the expert's library on profy_hosted, and ~/.agents/skills/\u003cname>/SKILL.md on self_hosted.","required":["type","name"],"properties":{"type":{"type":"string","enum":["built_in","customize"],"description":"built_in reads a primary-runtime skill. customize reads a library or local skill.","isRequired":true,"uniqueKey":"environment.skills.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"name":{"type":"string","description":"Skill name. For built_in, \"*\" loads every primary-runtime plugin. A stored name docx, xlsx, or pptx is read as documents, spreadsheets, or presentations.","isRequired":true,"uniqueKey":"environment.skills.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"environment.skills.items.[INDEX]","typeLabel":"object"},"description":"Primary-runtime skills are not loaded unless you list them here or pass a plugin id ending in @profy-primary-runtime. A built_in entry loads that one skill. name \"*\" loads every primary-runtime plugin. Omit both and this run has no document plugins. customize names a skill in the key owner's or the expert's library on profy_hosted, or ~/.agents/skills/\u003cname>/SKILL.md on self_hosted. User, expert, and workspace skills still appear in discovery without this field. An expert skill marked builtin_pack or auto_evolution includes its full text. Other library skills include full text only when named here as customize, or through skill_names.","example":[{"type":"built_in","name":"docx"}],"uniqueKey":"environment.skills","typeLabel":"object[]"},"plugins":{"type":"array","items":{"type":"object","description":"One plugin to turn on for this run. An id ending in @profy-primary-runtime loads that document plugin. Any other id selects an installed plugin.","required":["type"],"properties":{"type":{"type":"string","enum":["built_in"],"description":"Only built_in is accepted.","isRequired":true,"uniqueKey":"environment.plugins.items.[INDEX].type","typeLabel":"enum\u003cstring>"},"id":{"type":"string","description":"Installed plugin id, such as sites.","uniqueKey":"environment.plugins.items.[INDEX].id","typeLabel":"string"},"name":{"type":"string","description":"Accepted in place of id.","uniqueKey":"environment.plugins.items.[INDEX].name","typeLabel":"string"}},"uniqueKey":"environment.plugins.items.[INDEX]","typeLabel":"object"},"description":"Plugin selection for this run. Omit it and a new session selects none; a later turn in the same session keeps the previous selection. Pass a list and only those installed plugins are on. An empty array clears the selection. Enabling a plugin also brings the tools and skills that plugin declares. An id ending in @profy-primary-runtime loads that document plugin and is not an installed-plugin chip.","example":[{"type":"built_in","id":"sites"}],"uniqueKey":"environment.plugins","typeLabel":"object[]"},"capability_directories":{"type":"array","items":{"type":"string","uniqueKey":"environment.capability_directories.items.[INDEX]","typeLabel":"string"},"description":"Local directories for self_hosted. Paths must not contain ..","uniqueKey":"environment.capability_directories","typeLabel":"string[]"}},"uniqueKey":"environment","typeLabel":"object"},"input":{"oneOf":[{"type":"string","title":"string","description":"What to send the Expert. Switch between a string and a message array. The last user message is used. Missing input returns Missing required field: input, unless tool_confirmations is non-empty.","uniqueKey":"input.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","uniqueKey":"input.oneOf.1.items.[INDEX].role","typeLabel":"string"},"content":{"oneOf":[{"type":"string","uniqueKey":"input.oneOf.1.items.[INDEX].content.oneOf.0","typeLabel":"string"},{"type":"array","items":{"type":"object","uniqueKey":"input.oneOf.1.items.[INDEX].content.oneOf.1.items.[INDEX]","typeLabel":"object"},"uniqueKey":"input.oneOf.1.items.[INDEX].content.oneOf.1","typeLabel":"object[]"}],"uniqueKey":"input.oneOf.1.items.[INDEX].content","typeLabel":"string | object[]"}},"uniqueKey":"input.oneOf.1.items.[INDEX]","typeLabel":"object"},"title":"messages","description":"What to send the Expert. Switch between a string and a message array. The last user message is used. Missing input returns Missing required field: input, unless tool_confirmations is non-empty.","uniqueKey":"input.oneOf.1","typeLabel":"messages · object[]"}],"uniqueKey":"input","typeLabel":"string | messages · object[]"},"message":{"type":"string","description":"Alias of input. Used only when input is omitted.","uniqueKey":"message","typeLabel":"string"},"stream":{"type":"boolean","default":true,"description":"Must be true or omitted. false returns 400. This endpoint is SSE only.","uniqueKey":"stream","typeLabel":"boolean"},"session_id":{"type":"string","description":"Platform-issued session id from the X-Session-Id response header. An unknown id is replaced with a new session.","uniqueKey":"session_id","typeLabel":"string"},"model":{"type":"string","description":"Alias of agent.model. The value inside agent wins.","uniqueKey":"model","typeLabel":"string"},"metadata":{"type":"object","description":"Optional. profy_eval binds this turn to an offline experiment: experiment_id, task, trial. The key owner must be the expert creator. The object is removed before the prompt and attachments. The caller cannot submit a score.","properties":{"profy_eval":{"type":"object","required":["experiment_id","task","trial"],"properties":{"experiment_id":{"type":"string","isRequired":true,"uniqueKey":"metadata.profy_eval.experiment_id","typeLabel":"string"},"task":{"type":"string","isRequired":true,"uniqueKey":"metadata.profy_eval.task","typeLabel":"string"},"trial":{"type":"integer","minimum":1,"isRequired":true,"uniqueKey":"metadata.profy_eval.trial","typeLabel":"integer"}},"uniqueKey":"metadata.profy_eval","typeLabel":"object"}},"uniqueKey":"metadata","typeLabel":"object"},"attachment_file_ids":{"type":"array","items":{"type":"string","uniqueKey":"attachment_file_ids.items.[INDEX]","typeLabel":"string"},"maxItems":20,"description":"File ids from POST /v1/files. Ids only — the platform never fetches a caller-supplied URL.","uniqueKey":"attachment_file_ids","typeLabel":"string[]"},"tool_confirmations":{"type":"array","description":"HITL resume answers. When non-empty, input may be omitted. Reuse the session_id from the turn that emitted request_user_input.","items":{"type":"object","required":["tool_call_id","tool_name","decision"],"properties":{"tool_call_id":{"type":"string","isRequired":true,"uniqueKey":"tool_confirmations.items.[INDEX].tool_call_id","typeLabel":"string"},"tool_name":{"type":"string","isRequired":true,"uniqueKey":"tool_confirmations.items.[INDEX].tool_name","typeLabel":"string"},"decision":{"type":"string","isRequired":true,"uniqueKey":"tool_confirmations.items.[INDEX].decision","typeLabel":"string"},"modified_parameters":{"type":"object","uniqueKey":"tool_confirmations.items.[INDEX].modified_parameters","typeLabel":"object"},"original_parameters":{"type":"object","uniqueKey":"tool_confirmations.items.[INDEX].original_parameters","typeLabel":"object"},"result":{"oneOf":[{}],"uniqueKey":"tool_confirmations.items.[INDEX].result","typeLabel":"any"},"rejection_reason":{"type":"string","uniqueKey":"tool_confirmations.items.[INDEX].rejection_reason","typeLabel":"string"},"is_error":{"type":"boolean","uniqueKey":"tool_confirmations.items.[INDEX].is_error","typeLabel":"boolean"}},"uniqueKey":"tool_confirmations.items.[INDEX]","typeLabel":"object"},"uniqueKey":"tool_confirmations","typeLabel":"object[]"},"enabled_plugins":{"type":"array","items":{"type":"string","uniqueKey":"enabled_plugins.items.[INDEX]","typeLabel":"string"},"description":"Plugin ids for this turn. Prefer environment.plugins. Empty array clears sticky selection.","uniqueKey":"enabled_plugins","typeLabel":"string[]"},"skill_names":{"type":"array","items":{"type":"string","uniqueKey":"skill_names.items.[INDEX]","typeLabel":"string"},"description":"Qualified skill names: user/\u003cname> or expert/\u003cname>.","uniqueKey":"skill_names","typeLabel":"string[]"},"enable_memory":{"type":"boolean","default":false,"description":"Opt-in memory for Platform invokes. Default false.","uniqueKey":"enable_memory","typeLabel":"boolean"},"permission_mode":{"type":"string","enum":["plan"],"description":"Only \"plan\" is accepted.","uniqueKey":"permission_mode","typeLabel":"enum\u003cstring>"},"working_directory":{"type":"string","uniqueKey":"working_directory","typeLabel":"string"},"selected_image_model":{"type":"string","uniqueKey":"selected_image_model","typeLabel":"string"},"selected_video_model":{"type":"string","uniqueKey":"selected_video_model","typeLabel":"string"},"selected_speech_model":{"type":"string","uniqueKey":"selected_speech_model","typeLabel":"string"},"selected_music_model":{"type":"string","uniqueKey":"selected_music_model","typeLabel":"string"},"image_parameters":{"type":"object","uniqueKey":"image_parameters","typeLabel":"object"},"video_parameters":{"type":"object","uniqueKey":"video_parameters","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"agent":{"id":"my-expert","model":"gpt-6-astra","rules":[{"type":"identity","content":"Be brief."},{"type":"guard","content":"Do not reveal secrets."}],"subagents":{"model":"small","agents":[{"name":"researcher","description":"Looks things up","system_prompt":"Search before you answer.","tools":["web_search"],"model":"mini"}]},"expert_partner":[{"identifier":"researcher","name":"Researcher","brief":"Looks things up"}],"tools":[{"type":"knowledge"},{"type":"web_search"},{"type":"web_fetch"},{"type":"mcp","server_label":"openai_docs","transport":{"type":"http","server_url":"https://example.com/mcp"}}]},"environment":{"type":"profy_hosted","skills":[{"type":"built_in","name":"docx"},{"type":"customize","name":"my-skill"}],"plugins":[{"type":"built_in","id":"sites"}],"capability_directories":["/Users/me/.agents/skills"]},"input":"Create tree.py and run it.","stream":true,"session_id":"ses_abc123","attachment_file_ids":["file_abc123"],"tool_confirmations":[{"tool_call_id":"call_abc","tool_name":"ask","decision":"approved","modified_parameters":{"result":"yes"},"original_parameters":{},"result":"yes","rejection_reason":"","is_error":false}],"enabled_plugins":["sites"],"skill_names":["user/my-skill"],"enable_memory":false,"permission_mode":"plan","working_directory":"/home/user/workspace","selected_image_model":"image-model","selected_video_model":"video-model","selected_speech_model":"speech-model","selected_music_model":"music-model","image_parameters":{},"video_parameters":{}},"examples":{"Example":{"title":"Example","value":{"agent":{"id":"my-expert","model":"gpt-6-astra","rules":[{"type":"identity","content":"Be brief."},{"type":"guard","content":"Do not reveal secrets."}],"subagents":{"model":"small","agents":[{"name":"researcher","description":"Looks things up","system_prompt":"Search before you answer.","tools":["web_search"],"model":"mini"}]},"expert_partner":[{"identifier":"researcher","name":"Researcher","brief":"Looks things up"}],"tools":[{"type":"knowledge"},{"type":"web_search"},{"type":"web_fetch"},{"type":"mcp","server_label":"openai_docs","transport":{"type":"http","server_url":"https://example.com/mcp"}}]},"environment":{"type":"profy_hosted","skills":[{"type":"built_in","name":"docx"},{"type":"customize","name":"my-skill"}],"plugins":[{"type":"built_in","id":"sites"}],"capability_directories":["/Users/me/.agents/skills"]},"input":"Create tree.py and run it.","stream":true,"session_id":"ses_abc123","attachment_file_ids":["file_abc123"],"tool_confirmations":[{"tool_call_id":"call_abc","tool_name":"ask","decision":"approved","modified_parameters":{"result":"yes"},"original_parameters":{},"result":"yes","rejection_reason":"","is_error":false}],"enabled_plugins":["sites"],"skill_names":["user/my-skill"],"enable_memory":false,"permission_mode":"plan","working_directory":"/home/user/workspace","selected_image_model":"image-model","selected_video_model":"video-model","selected_speech_model":"speech-model","selected_music_model":"music-model","image_parameters":{},"video_parameters":{}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"0841948a-dd3f-4144-ad13-323565517580":{"description":"text/event-stream. Each event is an event: line, a data: line of JSON, then a blank line. Every JSON object has type and a monotonic event_id starting at 1. The stream ends with data: [DONE], which is not JSON. Read output text from delta, not content. tool_call.arguments.delta carries args_chunk. The tool result is tool_call.result, not a field on tool_call.completed. run.failed carries error, not message. usage.token carries prompt_tokens, completion_tokens, and total_tokens. Unknown event names are passed through. Response header X-Session-Id is the session id and is set when the handshake succeeds. Closing the connection after that does not cancel the run. Stop with POST /v1/sessions/{id}/interrupt. The same body while the run is generating resubscribes.","headers":{"X-Session-Id":{"schema":{"type":"string"},"description":"Session id. Send it back as session_id to continue this conversation."}},"content":{"text/event-stream":{"schema":{"type":"string","description":"SSE text. Do not JSON.parse a line until you have skipped data: [DONE].","uniqueKey":"","typeLabel":"string"},"example":"event: run.created\ndata: {\"type\":\"run.created\",\"event_id\":1}\n\nevent: output.text.delta\ndata: {\"type\":\"output.text.delta\",\"delta\":\"Hello\",\"event_id\":2}\n\nevent: tool_call.arguments.delta\ndata: {\"type\":\"tool_call.arguments.delta\",\"tool_name\":\"web_search\",\"args_chunk\":\"query\",\"event_id\":3}\n\nevent: tool_call.result\ndata: {\"type\":\"tool_call.result\",\"tool_name\":\"web_search\",\"event_id\":4}\n\nevent: usage.token\ndata: {\"type\":\"usage.token\",\"prompt_tokens\":10,\"completion_tokens\":4,\"total_tokens\":14,\"event_id\":5}\n\nevent: run.completed\ndata: {\"type\":\"run.completed\",\"event_id\":6}\n\ndata: [DONE]\n","examples":{"Example":{"title":"Example","value":"event: run.created\ndata: {\"type\":\"run.created\",\"event_id\":1}\n\nevent: output.text.delta\ndata: {\"type\":\"output.text.delta\",\"delta\":\"Hello\",\"event_id\":2}\n\nevent: tool_call.arguments.delta\ndata: {\"type\":\"tool_call.arguments.delta\",\"tool_name\":\"web_search\",\"args_chunk\":\"query\",\"event_id\":3}\n\nevent: tool_call.result\ndata: {\"type\":\"tool_call.result\",\"tool_name\":\"web_search\",\"event_id\":4}\n\nevent: usage.token\ndata: {\"type\":\"usage.token\",\"prompt_tokens\":10,\"completion_tokens\":4,\"total_tokens\":14,\"event_id\":5}\n\nevent: run.completed\ndata: {\"type\":\"run.completed\",\"event_id\":6}\n\ndata: [DONE]\n"}},"exampleType":"examples"}},"exampleType":"examples"},"3caba5d6-c416-4132-b394-05e9d1b7204e":{"description":"Missing required fields or no LLM config available","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"cfe190bb-881a-45ee-b00f-59b237f45b84":{"description":"Unauthorized — invalid or missing API key / token","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"b00f98ed-5451-49bd-b460-0ba47ddbb5cc":{"description":"Expert access denied (not purchased or trial exhausted)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"a88178c6-9b53-4d09-9e3d-c177f1349004":{"description":"An attachment_file_ids entry is unknown or not owned by the caller","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"a7a53da3-d6e4-4f5a-9b53-e3cb7ed8b84e":{"description":"A run is already in progress for this session and the body differs from it. Interrupt before sending a different input. The same body resubscribes instead of returning 409.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"77edfc2e-87a5-4668-8397-3c2f5cb24698":{"description":"Internal server error. Body is { code, message, data: null }.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"64f0a0a3-9ed2-42fe-9957-4fde367f81a2":{"description":"Agent runtime error","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"206e7bfd-bb74-4556-b145-0d3248988599":{"description":"Cannot connect to agent runtime","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"4c876ad6-d8f5-4118-8262-e2e3822e4961":{"description":"Agent runtime timeout","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"ce8bc2cd-0b60-42f4-879a-df6886f28dd7":{"BearerToken":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 access token issued via POST /oauth/token","scopes":[],"schemeName":"BearerToken"}},"6514acad-64f4-4971-aaf2-4746870481d2":{"ApiKey":{"type":"http","scheme":"bearer","description":"Developer API Key (sk-pro-xxx) created at platform.profy.cn","scopes":[],"schemeName":"ApiKey"}}},"servers":{"bf2619c6-5b55-4e1e-af75-c36b120d48f5":{"url":"https://api.profy.cn","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth2 access token issued via POST /oauth/token","scopes":[],"schemeName":"BearerToken"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"OAuth2 access token issued via POST /oauth/token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"BearerToken","name":"Authorization"}],"title":"BearerToken"},{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Developer API Key (sk-pro-xxx) created at platform.profy.cn","scopes":[],"schemeName":"ApiKey"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Developer API Key (sk-pro-xxx) created at platform.profy.cn","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"ApiKey","name":"Authorization"}],"title":"ApiKey"}]},"originalFileLocation":"openapi.json"},"subdomain":"profy-46233240","siteName":"Profy","title":"调用专家(SSE 流式) - Profy","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh":{"href":"/zh/api/agents-run","matchLevel":0},"en":{"href":"/en/api/agents-run","matchLevel":1}}},"lastModified":"2026-10-19T06:57:32.156Z","originalFileLocation":"zh/api/agents-run.mdx","locale":"zh"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Profy\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"调用专家(SSE 流式) - Profy\">\u003cmeta data-mint-head property=\"og:description\" content=\"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Profy\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.profy.cn/zh/api/agents-run\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://profy-46233240.mintlify.site/_mintlify/api/og/v2?division=Agents+API\u0026amp;title=%E8%B0%83%E7%94%A8%E4%B8%93%E5%AE%B6%EF%BC%88SSE+%E6%B5%81%E5%BC%8F%EF%BC%89\u0026amp;description=Invoke+a+Profy+Expert.+SSE+only%3A+omit+stream+or+set+it+true.+stream+false+returns+400.+The+canonical+body+is+agent+%2B+environment+%2B+input.+expert_identifier+alia\u0026amp;theme=21fcbde36f00c72e0b79908e\u0026amp;signature=7d4f25ab3bd43efbbeec22074622f5998125fd048bdd3bf5511f9c96fa65cb8a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"调用专家(SSE 流式) - Profy\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://profy-46233240.mintlify.site/_mintlify/api/og/v2?division=Agents+API\u0026amp;title=%E8%B0%83%E7%94%A8%E4%B8%93%E5%AE%B6%EF%BC%88SSE+%E6%B5%81%E5%BC%8F%EF%BC%89\u0026amp;description=Invoke+a+Profy+Expert.+SSE+only%3A+omit+stream+or+set+it+true.+stream+false+returns+400.+The+canonical+body+is+agent+%2B+environment+%2B+input.+expert_identifier+alia\u0026amp;theme=21fcbde36f00c72e0b79908e\u0026amp;signature=7d4f25ab3bd43efbbeec22074622f5998125fd048bdd3bf5511f9c96fa65cb8a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Profy\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#a8866a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.profy.cn/zh/api/agents-run\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/zh/api/agents-run.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.profy.cn/zh/api/agents-run\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.profy.cn/en/api/agents-run\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.profy.cn/zh/api/agents-run\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.profy.cn/#organization\",\"name\":\"Profy\",\"url\":\"https://docs.profy.cn\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/light.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=ffc1ff6107891bf45491112c285c11a0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.profy.cn#website\",\"name\":\"Profy\",\"url\":\"https://docs.profy.cn\",\"publisher\":{\"@id\":\"https://docs.profy.cn/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.profy.cn/zh/api/agents-run#webpage\",\"url\":\"https://docs.profy.cn/zh/api/agents-run\",\"name\":\"调用专家(SSE 流式)\",\"description\":\"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\",\"dateModified\":\"2026-10-19T06:57:32.156Z\",\"isPartOf\":{\"@id\":\"https://docs.profy.cn#website\"},\"breadcrumb\":{\"@id\":\"https://docs.profy.cn/zh/api/agents-run#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.profy.cn/zh/api/agents-run#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Profy\",\"item\":\"https://docs.profy.cn\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"调用专家(SSE 流式)\",\"item\":\"https://docs.profy.cn/zh/api/agents-run\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.profy.cn/zh/api/agents-run#apireference\",\"headline\":\"调用专家(SSE 流式)\",\"name\":\"调用专家(SSE 流式)\",\"description\":\"Invoke a Profy Expert. SSE only: omit stream or set it true. stream false returns 400. The canonical body is agent + environment + input. expert_identifier aliases agent, and message aliases input. Persona is not accepted on this request.\",\"url\":\"https://docs.profy.cn/zh/api/agents-run\",\"mainEntityOfPage\":{\"@id\":\"https://docs.profy.cn/zh/api/agents-run#webpage\"},\"dateModified\":\"2026-10-19T06:57:32.156Z\",\"publisher\":{\"@id\":\"https://docs.profy.cn/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.profy.cn#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Profy\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Profy\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/zh/api/agents-run.md","siteName":"Profy","nav":{"global":null,"languages":[{"language":"zh","tabs":[{"tab":"文档","pages":[{"title":"文档","href":"/zh/documentation/get-started/what-is-profy"}]},{"tab":"创作者","pages":[{"title":"创作者","href":"/zh/creators/overview"}]},{"tab":"开发者","pages":[{"title":"开发者","href":"/zh/developers/overview"}]},{"tab":"API 参考","groups":[{"group":"Agents API","pages":[{"title":"调用专家(SSE 流式)","openapi":"POST /v1/agents/run","href":"/zh/api/agents-run"}]},{"group":"会话","pages":[{"title":"创建会话","openapi":"POST /v1/sessions","description":"Creates a long-lived session bound to an agent. Provisions no sandbox and charges nothing — cost starts at the first event.","href":"/zh/api/create-session"},{"title":"列出会话","openapi":"GET /v1/sessions","href":"/zh/api/list-sessions"},{"title":"获取会话","openapi":"GET /v1/sessions/{session_id}","href":"/zh/api/get-session"},{"title":"删除会话","openapi":"DELETE /v1/sessions/{session_id}","href":"/zh/api/delete-session"},{"title":"发送会话事件(SSE)","openapi":"POST /v1/sessions/{session_id}/events","href":"/zh/api/post-session-events"},{"title":"回放或续订会话事件","openapi":"GET /v1/sessions/{session_id}/events","href":"/zh/api/get-session-events"},{"title":"中断会话","openapi":"POST /v1/sessions/{session_id}/interrupt","href":"/zh/api/interrupt-session"}]},{"group":"Platform API","pages":[{"title":"对话补全(OpenAI 兼容)","openapi":"POST /v1/chat/completions","href":"/zh/api/chat-completions"},{"title":"获取可用模型列表","openapi":"GET /v1/models","href":"/zh/api/models"}]},{"group":"OAuth","pages":[{"title":"获取 App 信息","openapi":"GET /oauth/app-info","href":"/zh/api/get-app-info"},{"title":"重定向到授权页面","openapi":"GET /oauth/authorize","href":"/zh/api/get-authorize"},{"title":"用户批准授权","openapi":"POST /oauth/authorize","href":"/zh/api/post-authorize"},{"title":"交换 Token","openapi":"POST /oauth/token","href":"/zh/api/post-token"},{"title":"撤销 Token","openapi":"POST /oauth/revoke","href":"/zh/api/post-revoke"}]}]},{"tab":"SDK 参考","pages":[{"title":"SDK 参考","href":"/zh/developers/sdk-typescript"}]},{"tab":"更新日志","pages":[{"title":"更新日志","href":"/zh/changelog"}]}]},{"language":"en","pages":[{"title":"en","href":"/en/api/agents-run"}]}]},"basePath":"","title":"调用专家(SSE 流式) - Profy","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-BuieBNTB.js","snippetPresets-alIv9Yoc.js","utils-BS41p-Nj.js","style-to-object-BY3JEAdk.js","utils-D0Za9LU_.js","v4-DIgz8zy6.js","addTypeLabelsToSchema-Lx7TZ5XR.js","conditional-requirements-CFM0id0Q.js","cloneDeep-4e5CS5ZI.js","_Uint8Array-B2-W7EM3.js","isObject-FP1Yky1u.js","ApiExamples-sCe6z2hN.js","usePlaygroundInputsStore-cU_dFE5n.js","shallow-BwNCr__O.js","isEqual-Cnvzqd4L.js","CodeSnippets-CMIr49P8.js","CodeSnippet-BC-bKzyy.js","use-playground-group-access-c3bgmn-x.js","Page-Acw_JRP6.js","api-description-markdown-1o8U1kkQ.js","DynamicMarkdown-CvOkzads.js","SectionHeading-CJ97Kdt-.js","MethodPill-DynWltjQ.js","getPastedJson-CBCnXiWl.js","Check2Icon-CPHq_WNu.js","axios-CsQoIw0U.js","Markdown-4tjIF-hK.js","AssistantPageLink-BcChI7L3.js","dist-MIf_HGLZ.js","lib-DMeTj1gb.js","lib-B8HbPgcC.js","katex-Dbtb6Wk7.js","html-void-elements-mCSPHezU.js","marked.esm-CZWythHk.js"]}