curl --request POST \
--url https://api.agentsfleet.net/v1/runners/me/leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accepted_kinds": [],
"holds": [
"<string>"
]
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases"
payload = {
"accepted_kinds": [],
"holds": ["<string>"]
}
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({accepted_kinds: [], holds: ['<string>']})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases', 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.agentsfleet.net/v1/runners/me/leases",
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([
'accepted_kinds' => [
],
'holds' => [
'<string>'
]
]),
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.agentsfleet.net/v1/runners/me/leases"
payload := strings.NewReader("{\n \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\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.agentsfleet.net/v1/runners/me/leases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases")
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 \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"lease": {
"event": {
"actor": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"event_id": "<string>",
"event_type": "chat",
"fleet_id": "<string>",
"request_json": "<string>",
"workspace_id": "<string>"
},
"fencing_token": 1,
"history": [
{
"answer": "<string>",
"message": "<string>"
}
],
"instructions": "<string>",
"lease_expires_at": "2023-11-07T05:31:56Z",
"lease_id": "<string>",
"policy": {
"api_key": "<string>",
"context": {
"context_cap_tokens": 1,
"memory_checkpoint_every": 1,
"model": "<string>",
"stage_chunk_threshold": 0.5,
"tool_window": 1
},
"http_origin_policies": [
{
"credential_names": [
"<string>"
],
"host": "<string>",
"requests": [
{
"json_fields": [
{
"name": "<string>",
"boolean_value": true,
"string_value": "<string>"
}
],
"method": "get",
"path": "<string>",
"path_match": "exact",
"permitted_fields": [
"<string>"
]
}
]
}
],
"inference_host": "<string>",
"mintable": [
{
"integration": "<string>",
"name": "<string>"
}
],
"network_policy": {
"allow": [
"<string>"
],
"read_only": true,
"read_post_paths": [
"<string>"
]
},
"provider": "<string>",
"tools": [
"<string>"
],
"base_url": "<string>",
"inference": {
"api": "chat",
"base_url": "<string>",
"max_output_tokens": 1,
"dialect": "<string>"
},
"model_context_tokens": 1,
"repository_binding": {
"access": "read",
"base_branch": "<string>",
"repositories": [
"<string>"
]
},
"secrets_map": "<unknown>"
},
"resume_hold": true,
"secret_delivery": "inline",
"kind": "fleet",
"limits": {
"cpu_millis": 16125,
"disk_bytes": 137975824384,
"memory_bytes": 34493956096
}
},
"retry_after_ms": 1
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}Request the next work assignment
Returns the next work assignment, or how long to wait before polling again. Previously held fleet sandboxes are preferred. Required accepted_kinds selects fleet work, private setup work, or both. Budget, approval, and policy checks happen before assignment.
curl --request POST \
--url https://api.agentsfleet.net/v1/runners/me/leases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accepted_kinds": [],
"holds": [
"<string>"
]
}
'import requests
url = "https://api.agentsfleet.net/v1/runners/me/leases"
payload = {
"accepted_kinds": [],
"holds": ["<string>"]
}
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({accepted_kinds: [], holds: ['<string>']})
};
fetch('https://api.agentsfleet.net/v1/runners/me/leases', 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.agentsfleet.net/v1/runners/me/leases",
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([
'accepted_kinds' => [
],
'holds' => [
'<string>'
]
]),
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.agentsfleet.net/v1/runners/me/leases"
payload := strings.NewReader("{\n \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\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.agentsfleet.net/v1/runners/me/leases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentsfleet.net/v1/runners/me/leases")
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 \"accepted_kinds\": [],\n \"holds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"lease": {
"event": {
"actor": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"event_id": "<string>",
"event_type": "chat",
"fleet_id": "<string>",
"request_json": "<string>",
"workspace_id": "<string>"
},
"fencing_token": 1,
"history": [
{
"answer": "<string>",
"message": "<string>"
}
],
"instructions": "<string>",
"lease_expires_at": "2023-11-07T05:31:56Z",
"lease_id": "<string>",
"policy": {
"api_key": "<string>",
"context": {
"context_cap_tokens": 1,
"memory_checkpoint_every": 1,
"model": "<string>",
"stage_chunk_threshold": 0.5,
"tool_window": 1
},
"http_origin_policies": [
{
"credential_names": [
"<string>"
],
"host": "<string>",
"requests": [
{
"json_fields": [
{
"name": "<string>",
"boolean_value": true,
"string_value": "<string>"
}
],
"method": "get",
"path": "<string>",
"path_match": "exact",
"permitted_fields": [
"<string>"
]
}
]
}
],
"inference_host": "<string>",
"mintable": [
{
"integration": "<string>",
"name": "<string>"
}
],
"network_policy": {
"allow": [
"<string>"
],
"read_only": true,
"read_post_paths": [
"<string>"
]
},
"provider": "<string>",
"tools": [
"<string>"
],
"base_url": "<string>",
"inference": {
"api": "chat",
"base_url": "<string>",
"max_output_tokens": 1,
"dialect": "<string>"
},
"model_context_tokens": 1,
"repository_binding": {
"access": "read",
"base_branch": "<string>",
"repositories": [
"<string>"
]
},
"secrets_map": "<unknown>"
},
"resume_hold": true,
"secret_delivery": "inline",
"kind": "fleet",
"limits": {
"cpu_millis": 16125,
"disk_bytes": 137975824384,
"memory_bytes": 34493956096
}
},
"retry_after_ms": 1
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}{
"detail": "<string>",
"docs_uri": "<string>",
"error_code": "<string>",
"request_id": "<string>",
"title": "<string>",
"action_id": "<string>",
"current_state": "<string>",
"etag": "<string>",
"gate_id": "<string>",
"outcome": "<string>",
"resolved_at": "2023-11-07T05:31:56Z",
"resolved_by": "<string>",
"user_message": "<string>"
}Authorizations
Runner token beginning with agt_r, returned once by POST /v1/runners
Body
Runner's request for work. Lists held fleet sandboxes to prefer their next events; an empty list may be omitted. Accepted work kinds are required.
The nonempty set of work protocols implemented by this worker.
1 - 2 elementsThe two independent work domains sharing a physical host's workers.
fleet, authoring Every fleet this runner holds a frozen sandbox for. Absent decodes as empty.
6436Response
A lease to run, or a backoff to wait out
POST /v1/runners/me/leases reply. Always 200.
lease is the work, or null with retry_after_ms set when there is none —
a backoff hint rather than a 204.