curl --request POST \
--url 'https://api.hexelstudio.com/v1/harness/swarms:estimate' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header 'X-Workspace-Id: X_WORKSPACE_ID' \
--header 'X-Environment-Id: X_ENVIRONMENT_ID' \
--header 'Content-Type: application/json' \
--data '{
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string"
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string"
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each"
}
],
"board": {
"items": [
{
"key": "string",
"inputs": "string"
}
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string"
},
"access": {
"capabilities": [
"string"
]
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string"
},
"sandbox_template": "string"
}'
const res = await fetch("https://api.hexelstudio.com/v1/harness/swarms:estimate", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string"
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string"
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each"
}
],
"board": {
"items": [
{
"key": "string",
"inputs": "string"
}
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string"
},
"access": {
"capabilities": [
"string"
]
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string"
},
"sandbox_template": "string"
}),
})
const data = await res.json()
import os
import requests
res = requests.post(
"https://api.hexelstudio.com/v1/harness/swarms:estimate",
headers={"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}"},
json={
"pattern": "map",
"goal": "string",
"agent": "string",
"worker_agent": "string",
"items": [
"string",
],
"inputs": {},
"reduce": {
"agent": "string",
"goal": "string",
},
"stages": [
{
"name": "string",
"goal": "string",
"agent": "string",
"mode": "each",
},
],
"board": {
"items": [
{
"key": "string",
"inputs": "string",
},
],
"members": 0,
"item_ttl_s": 0,
"max_item_attempts": 0,
"on_item_failure": "string",
},
"access": {
"capabilities": [
"string",
],
},
"budget": {
"max_usd": 0,
"max_estimate_usd": 0,
},
"member_budget": {
"max_usd": 0,
"max_steps": 0,
"max_tokens": 0,
"max_wall_clock_s": 0,
"max_estimate_usd": 0,
},
"max_concurrency": 0,
"failure_rule": {
"max_attempts": 0,
"on_failure": "string",
"then": "string",
},
"sandbox_template": "string",
},
)
data = res.json()
{
"admitted": true,
"decision_id": "string",
"floor_usd": 0,
"max_estimate_usd": 0,
"members": 0,
"meter": "string",
"parts": [
{
"agent": "string",
"members": 0,
"per_member_usd": 0,
"source": "string",
"usd": 0
}
],
"per_member_usd": 0,
"quantity": 0,
"reasons": [
"string"
],
"refusal": "string",
"source": "string",
"usd": 0,
"within_budget": true
}