Agents API
Deploy, configure, and monitor your Hyperfold agents programmatically.
Overview
The Agents API provides full lifecycle management for your commerce agents, including deployment, configuration, scaling, and observability.
| Endpoint | Method | Description |
|---|---|---|
/v1/agents | GET | List all agents |
/v1/agents/:id | GET | Get agent details |
/v1/agents/deploy | POST | Deploy new agent |
/v1/agents/:id/config | PATCH | Update configuration |
/v1/agents/:id/logs | GET | Stream logs |
/v1/agents/:id/metrics | GET | Get metrics |
List Agents
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# GET /v1/agents# List all deployed agents curl -X GET https://api.hyperfold.io/v1/agents \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" # Response{ "data": [ { "id": "agent_neg_001", "name": "sales-negotiator", "type": "negotiator", "version": "1.2.0", "status": "running", "instances": 3, "created_at": "2025-01-15T10:00:00Z", "metrics": { "requests_24h": 4521, "avg_latency_ms": 340, "error_rate": 0.003 } }, { "id": "agent_ful_001", "name": "fulfillment-processor", "type": "fulfillment", "version": "1.0.0", "status": "running", "instances": 2 } ]} # GET /v1/agents/:id# Get agent details curl -X GET https://api.hyperfold.io/v1/agents/agent_neg_001 \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" # Response includes full configuration{ "id": "agent_neg_001", "name": "sales-negotiator", "type": "negotiator", "version": "1.2.0", "status": "running", "config": { "llm_provider": "openai", "llm_model": "gpt-4-turbo", "max_tokens": 4096, "temperature": 0.7 }, "scaling": { "min_instances": 2, "max_instances": 50, "current_instances": 3, "target_concurrency": 100 }, "capabilities": ["negotiate", "recommend", "bundle"], "endpoints": { "acp": "https://acp.acme.hyperfold.app/negotiator" }}Deploy Agent
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# POST /v1/agents/deploy# Deploy a new agent or update existing curl -X POST https://api.hyperfold.io/v1/agents/deploy \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" \ -H "Content-Type: application/json" \ -d '{ "name": "sales-negotiator", "type": "negotiator", "source": { "type": "git", "repository": "https://github.com/acme/agents", "branch": "main", "path": "negotiator/" }, "config": { "llm_provider": "openai", "llm_model": "gpt-4-turbo", "temperature": 0.7, "system_prompt_override": null }, "scaling": { "min_instances": 2, "max_instances": 50, "target_concurrency": 100 }, "environment": { "CUSTOM_VAR": "value" } }' # Response (202 Accepted){ "deployment_id": "deploy_xyz789", "agent_id": "agent_neg_001", "status": "deploying", "progress": { "stage": "building", "percent": 25 }, "estimated_completion": "2025-01-20T10:05:00Z"} # GET /v1/agents/deploy/:deployment_id# Check deployment status curl -X GET https://api.hyperfold.io/v1/agents/deploy/deploy_xyz789 \ -H "Authorization: Bearer hf_live_xxx" # Response{ "deployment_id": "deploy_xyz789", "agent_id": "agent_neg_001", "status": "completed", "version": "1.2.1", "completed_at": "2025-01-20T10:04:30Z", "logs_url": "https://console.hyperfold.io/deployments/deploy_xyz789/logs"}Deployment Sources
| Source Type | Description |
|---|---|
| git | Deploy from Git repository |
| docker | Deploy from container image |
| template | Use built-in agent template |
| upload | Upload source directly |
Configure
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# PATCH /v1/agents/:id/config# Update agent configuration (hot reload) curl -X PATCH https://api.hyperfold.io/v1/agents/agent_neg_001/config \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" \ -H "Content-Type: application/json" \ -d '{ "llm_model": "gpt-4o", "temperature": 0.5, "max_discount_percent": 25, "negotiation_style": "friendly" }' # Response{ "agent_id": "agent_neg_001", "config_version": 3, "changes": [ {"field": "llm_model", "from": "gpt-4-turbo", "to": "gpt-4o"}, {"field": "temperature", "from": 0.7, "to": 0.5} ], "applied_at": "2025-01-20T10:10:00Z", "rollout": "immediate"} # PATCH /v1/agents/:id/scaling# Update scaling configuration curl -X PATCH https://api.hyperfold.io/v1/agents/agent_neg_001/scaling \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" \ -H "Content-Type: application/json" \ -d '{ "min_instances": 5, "max_instances": 100, "target_concurrency": 150 }' # POST /v1/agents/:id/restart# Restart all agent instances curl -X POST https://api.hyperfold.io/v1/agents/agent_neg_001/restart \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" \ -d '{"strategy": "rolling"}'Configuration changes are applied immediately to running instances without downtime. Use the restart endpoint for changes requiring a full reload.
Logs & Metrics
bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# GET /v1/agents/:id/logs# Stream agent logs curl -X GET "https://api.hyperfold.io/v1/agents/agent_neg_001/logs?\since=1h&\level=info&\limit=100" \ -H "Authorization: Bearer hf_live_xxx" \ -H "X-Project-ID: proj_acme" # Response{ "logs": [ { "timestamp": "2025-01-20T10:15:30.123Z", "level": "info", "message": "Session started", "context": { "session_id": "sess_abc123", "customer_tier": "gold" } }, { "timestamp": "2025-01-20T10:15:30.456Z", "level": "info", "message": "Price quote generated", "context": { "product_id": "prod_xyz", "offered": 150.00, "counter": 162.00 } } ], "meta": { "count": 100, "has_more": true, "next_cursor": "cursor_xyz" }} # GET /v1/agents/:id/metrics# Get agent performance metrics curl -X GET "https://api.hyperfold.io/v1/agents/agent_neg_001/metrics?\period=24h&\granularity=1h" \ -H "Authorization: Bearer hf_live_xxx" # Response{ "agent_id": "agent_neg_001", "period": "24h", "summary": { "total_requests": 4521, "success_rate": 0.997, "avg_latency_ms": 340, "p95_latency_ms": 890, "conversions": 1247, "revenue": 187450.00 }, "timeseries": [ {"timestamp": "2025-01-20T00:00:00Z", "requests": 120, "latency_ms": 320}, {"timestamp": "2025-01-20T01:00:00Z", "requests": 85, "latency_ms": 310} ]}Log Levels
| Level | Description |
|---|---|
debug | Detailed debugging information |
info | General operational events |
warn | Warning conditions |
error | Error events |
Next: Manage payments with the Finance API.