部署
立即运行部署
通过 OMA API 立即运行部署。
POST
/
v1
/
deployments
/
{deployment_id}
/
run
立即运行部署
curl --request POST \
--url http://localhost:38080/v1/deployments/{deployment_id}/run \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments/{deployment_id}/run"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments/{deployment_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments/{deployment_id}/run"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "deployment_run",
"id": "<string>",
"deployment_id": "<string>",
"trigger_context": {
"type": "schedule",
"scheduled_at": "2023-11-07T05:31:56Z"
},
"session_id": "<string>",
"error": {
"type": "environment_archived_error",
"message": "<string>"
},
"agent": {
"type": "agent",
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"version": 1
},
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}每个请求都必须发送
?beta=true、anthropic-version: 2023-06-01 与 anthropic-beta: managed-agents-2026-04-01。授权
omaApiKeyomaBearer
OMA 工作区 API 密钥。
路径参数
部署标识符。
查询参数
为此接口启用 Beta API 合同,必须为 true。
可用选项:
true 响应
请求成功。
单次部署执行的持久化、仅追加记录。记录会话创建的成功或失败——不跟踪会话生命周期。
可用选项:
deployment_run 本次 run 的唯一标识符(drun_...)。
产生本次 run 的部署 ID。
触发此次运行的原因以及触发器特定的元数据。
- Option 1
- Option 2
Show child attributes
Show child attributes
成功时填充。创建失败时为 Null。session_id 与 error 中恰好有一个非 null。
创建失败时填充。成功时为 Null。session_id 与 error 中恰好有一个非 null。
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
- Option 15
- Option 16
Show child attributes
Show child attributes
触发时刻该智能体的快照。始终为完全解析状态 —— 部署固定了智能体 + 版本。
Show child attributes
Show child attributes
示例:
{ "type": "agent", "id": "agent_011CZkYqphY8vELVzwCUpqiQ", "version": 1 }
此运行记录的持久化时间。
此页面对您有帮助吗?
⌘I
立即运行部署
curl --request POST \
--url http://localhost:38080/v1/deployments/{deployment_id}/run \
--header 'X-Api-Key: <api-key>' \
--header 'anthropic-beta: <anthropic-beta>' \
--header 'anthropic-version: <anthropic-version>'import requests
url = "http://localhost:38080/v1/deployments/{deployment_id}/run"
headers = {
"anthropic-version": "<anthropic-version>",
"anthropic-beta": "<anthropic-beta>",
"X-Api-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'anthropic-version': '<anthropic-version>',
'anthropic-beta': '<anthropic-beta>',
'X-Api-Key': '<api-key>'
}
};
fetch('http://localhost:38080/v1/deployments/{deployment_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:38080/v1/deployments/{deployment_id}/run"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("anthropic-version", "<anthropic-version>")
req.Header.Add("anthropic-beta", "<anthropic-beta>")
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"type": "deployment_run",
"id": "<string>",
"deployment_id": "<string>",
"trigger_context": {
"type": "schedule",
"scheduled_at": "2023-11-07T05:31:56Z"
},
"session_id": "<string>",
"error": {
"type": "environment_archived_error",
"message": "<string>"
},
"agent": {
"type": "agent",
"id": "agent_011CZkYqphY8vELVzwCUpqiQ",
"version": 1
},
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}{
"error": {
"message": "Invalid request",
"type": "invalid_request_error"
},
"request_id": "<string>",
"type": "error"
}