curl --request POST \
--url https://api.openworklabs.com/v1/personal-agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"never": [
{
"app": "<string>",
"action": "<string>"
}
],
"monthlyBudgetMicros": 500000000000,
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents"
payload = {
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"never": [
{
"app": "<string>",
"action": "<string>"
}
],
"monthlyBudgetMicros": 500000000000,
"idempotencyKey": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
brief: '<string>',
toolPolicy: {connections: {}, tools: {}},
never: [{app: '<string>', action: '<string>'}],
monthlyBudgetMicros: 500000000000,
idempotencyKey: '<string>'
})
};
fetch('https://api.openworklabs.com/v1/personal-agents', 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.openworklabs.com/v1/personal-agents",
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([
'name' => '<string>',
'brief' => '<string>',
'toolPolicy' => [
'connections' => [
],
'tools' => [
]
],
'never' => [
[
'app' => '<string>',
'action' => '<string>'
]
],
'monthlyBudgetMicros' => 500000000000,
'idempotencyKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/personal-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/personal-agents")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"pausedAt": "2023-11-07T05:31:56Z"
},
"revision": {
"id": "<string>",
"agentId": "<string>",
"version": 123,
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"defaultExecutionTarget": "desktop",
"monthlyBudgetMicros": 500000000000,
"digest": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
},
"routineCount": 4503599627370495,
"role": "owner",
"owner": {
"memberId": "<string>",
"name": "<string>"
},
"sharedWith": [],
"routines": [
{
"id": "<string>",
"name": "<string>",
"state": "active",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"nextDueAt": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
}
],
"spend": {
"monthMicros": 4503599627370495,
"unpricedTokens": 4503599627370495,
"budgetMicros": 500000000000,
"ownerBudgetMicros": 500000000000,
"adminBudgetMicros": 500000000000,
"overBudget": true
},
"openRequestCount": 0,
"audience": {
"organization": false,
"autoAddOrganization": false,
"teams": []
},
"listed": true,
"canShare": true
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Create an agent
An agent has an owner, a name, a brief that says how it works, and rules for which tools it can use. Every change to the brief or tool policy makes a new version. An agent does its work through routines. A routine is a Cloud Automation that belongs to the agent, so it also appears in the Automation capabilities; each run starts from the agent’s brief and can use only what the agent’s tool policy allows. The owner can share the agent with teammates. Managers can change who can collaborate. The owner must approve changes a manager proposes to the brief, tool policy or routines. Collaborators can use the agent and ask for changes. Runs started by a teammate are private. Scheduled runs use the owner’s accounts and share their results with the team. Create one only when the person asks for an agent. Write the brief as Markdown from what they said: what the agent watches or does, how it decides, and how it reports. The agent does nothing until it has a routine; add one with createPersonalAgentRoutine.
curl --request POST \
--url https://api.openworklabs.com/v1/personal-agents \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"never": [
{
"app": "<string>",
"action": "<string>"
}
],
"monthlyBudgetMicros": 500000000000,
"idempotencyKey": "<string>"
}
'import requests
url = "https://api.openworklabs.com/v1/personal-agents"
payload = {
"name": "<string>",
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"never": [
{
"app": "<string>",
"action": "<string>"
}
],
"monthlyBudgetMicros": 500000000000,
"idempotencyKey": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
brief: '<string>',
toolPolicy: {connections: {}, tools: {}},
never: [{app: '<string>', action: '<string>'}],
monthlyBudgetMicros: 500000000000,
idempotencyKey: '<string>'
})
};
fetch('https://api.openworklabs.com/v1/personal-agents', 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.openworklabs.com/v1/personal-agents",
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([
'name' => '<string>',
'brief' => '<string>',
'toolPolicy' => [
'connections' => [
],
'tools' => [
]
],
'never' => [
[
'app' => '<string>',
'action' => '<string>'
]
],
'monthlyBudgetMicros' => 500000000000,
'idempotencyKey' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.openworklabs.com/v1/personal-agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.openworklabs.com/v1/personal-agents")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.openworklabs.com/v1/personal-agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"brief\": \"<string>\",\n \"toolPolicy\": {\n \"connections\": {},\n \"tools\": {}\n },\n \"never\": [\n {\n \"app\": \"<string>\",\n \"action\": \"<string>\"\n }\n ],\n \"monthlyBudgetMicros\": 500000000000,\n \"idempotencyKey\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"id": "<string>",
"organizationId": "<string>",
"ownerMemberId": "<string>",
"name": "<string>",
"state": "active",
"currentRevisionId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"pausedAt": "2023-11-07T05:31:56Z"
},
"revision": {
"id": "<string>",
"agentId": "<string>",
"version": 123,
"brief": "<string>",
"toolPolicy": {
"connections": {},
"tools": {}
},
"defaultExecutionTarget": "desktop",
"monthlyBudgetMicros": 500000000000,
"digest": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
},
"routineCount": 4503599627370495,
"role": "owner",
"owner": {
"memberId": "<string>",
"name": "<string>"
},
"sharedWith": [],
"routines": [
{
"id": "<string>",
"name": "<string>",
"state": "active",
"schedule": {
"kind": "once",
"timezone": "<string>",
"at": 4503599627370495
},
"nextDueAt": "2023-11-07T05:31:56Z",
"latestRun": {
"id": "<string>",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z"
}
}
],
"spend": {
"monthMicros": 4503599627370495,
"unpricedTokens": 4503599627370495,
"budgetMicros": 500000000000,
"ownerBudgetMicros": 500000000000,
"adminBudgetMicros": 500000000000,
"overBudget": true
},
"openRequestCount": 0,
"audience": {
"organization": false,
"autoAddOrganization": false,
"teams": []
},
"listed": true,
"canShare": true
}{
"error": "invalid_request",
"details": [
{
"message": "<string>",
"path": [
"<string>"
]
}
],
"message": "<string>",
"capability": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Body
Response
Agent created or returned from an earlier request.
Was this page helpful?