@octavus/docs 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/content/01-getting-started/01-introduction.md +93 -0
- package/content/01-getting-started/02-quickstart.md +268 -0
- package/content/01-getting-started/_meta.md +4 -0
- package/content/02-server-sdk/01-overview.md +133 -0
- package/content/02-server-sdk/02-sessions.md +164 -0
- package/content/02-server-sdk/03-tools.md +242 -0
- package/content/02-server-sdk/04-streaming.md +211 -0
- package/content/02-server-sdk/_meta.md +4 -0
- package/content/03-client-sdk/01-overview.md +148 -0
- package/content/03-client-sdk/02-messages.md +207 -0
- package/content/03-client-sdk/03-streaming.md +215 -0
- package/content/03-client-sdk/04-execution-blocks.md +231 -0
- package/content/03-client-sdk/_meta.md +4 -0
- package/content/04-protocol/01-overview.md +142 -0
- package/content/04-protocol/02-input-resources.md +200 -0
- package/content/04-protocol/03-triggers.md +209 -0
- package/content/04-protocol/04-tools.md +255 -0
- package/content/04-protocol/05-handlers.md +251 -0
- package/content/04-protocol/06-agent-config.md +215 -0
- package/content/04-protocol/_meta.md +4 -0
- package/content/05-api-reference/01-overview.md +129 -0
- package/content/05-api-reference/02-sessions.md +232 -0
- package/content/05-api-reference/03-agents.md +222 -0
- package/content/05-api-reference/_meta.md +4 -0
- package/dist/chunk-2YMRODFE.js +421 -0
- package/dist/chunk-2YMRODFE.js.map +1 -0
- package/dist/chunk-6JQ3OMGF.js +421 -0
- package/dist/chunk-6JQ3OMGF.js.map +1 -0
- package/dist/chunk-ESGSYVGK.js +421 -0
- package/dist/chunk-ESGSYVGK.js.map +1 -0
- package/dist/chunk-GDCTM2SV.js +421 -0
- package/dist/chunk-GDCTM2SV.js.map +1 -0
- package/dist/chunk-J26MLMLN.js +421 -0
- package/dist/chunk-J26MLMLN.js.map +1 -0
- package/dist/chunk-LWYMRXBF.js +421 -0
- package/dist/chunk-LWYMRXBF.js.map +1 -0
- package/dist/chunk-NFVJQNDP.js +421 -0
- package/dist/chunk-NFVJQNDP.js.map +1 -0
- package/dist/chunk-SCKIOGKI.js +421 -0
- package/dist/chunk-SCKIOGKI.js.map +1 -0
- package/dist/chunk-VWPQ6ORV.js +421 -0
- package/dist/chunk-VWPQ6ORV.js.map +1 -0
- package/dist/chunk-WUNFFJ32.js +421 -0
- package/dist/chunk-WUNFFJ32.js.map +1 -0
- package/dist/chunk-XVSMRXBJ.js +421 -0
- package/dist/chunk-XVSMRXBJ.js.map +1 -0
- package/dist/content.d.ts +37 -0
- package/dist/content.js +17 -0
- package/dist/content.js.map +1 -0
- package/dist/docs.json +173 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/search-index.json +1 -0
- package/dist/search.d.ts +19 -0
- package/dist/search.js +30 -0
- package/dist/search.js.map +1 -0
- package/dist/sections.json +213 -0
- package/dist/types-BNRNBPDE.d.ts +28 -0
- package/dist/types-BltYGlWI.d.ts +36 -0
- package/package.json +52 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: REST API overview and authentication.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# API Reference
|
|
7
|
+
|
|
8
|
+
The Octavus API is a RESTful API that enables programmatic access to agent management and session execution.
|
|
9
|
+
|
|
10
|
+
## Base URL
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
https://octavus.ai
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Authentication
|
|
17
|
+
|
|
18
|
+
All API requests require authentication using a Bearer token:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
curl -H "Authorization: Bearer YOUR_API_KEY" \
|
|
22
|
+
https://octavus.ai/api/agents
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
API keys can be created in the Octavus Platform under Project Settings → API Keys.
|
|
26
|
+
|
|
27
|
+
## Response Format
|
|
28
|
+
|
|
29
|
+
All responses are JSON. Success responses return the data directly (not wrapped in a `data` field).
|
|
30
|
+
|
|
31
|
+
### Success Response
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"sessionId": "sess_abc123"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Error Response
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"error": {
|
|
44
|
+
"code": "NOT_FOUND",
|
|
45
|
+
"message": "Agent not found"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## HTTP Status Codes
|
|
51
|
+
|
|
52
|
+
| Code | Description |
|
|
53
|
+
|------|-------------|
|
|
54
|
+
| 200 | Success |
|
|
55
|
+
| 201 | Created |
|
|
56
|
+
| 400 | Bad Request - Invalid parameters |
|
|
57
|
+
| 401 | Unauthorized - Missing or invalid API key |
|
|
58
|
+
| 403 | Forbidden - Insufficient permissions |
|
|
59
|
+
| 404 | Not Found |
|
|
60
|
+
| 429 | Too Many Requests - Rate limited |
|
|
61
|
+
| 500 | Internal Server Error |
|
|
62
|
+
|
|
63
|
+
## Rate Limits
|
|
64
|
+
|
|
65
|
+
- **Standard tier**: 100 requests/minute
|
|
66
|
+
- **Pro tier**: 1,000 requests/minute
|
|
67
|
+
- **Enterprise**: Custom limits
|
|
68
|
+
|
|
69
|
+
Rate limit headers are included in responses:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
X-RateLimit-Limit: 100
|
|
73
|
+
X-RateLimit-Remaining: 95
|
|
74
|
+
X-RateLimit-Reset: 1735312800
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Endpoints Overview
|
|
78
|
+
|
|
79
|
+
### Agents
|
|
80
|
+
|
|
81
|
+
| Method | Endpoint | Description |
|
|
82
|
+
|--------|----------|-------------|
|
|
83
|
+
| GET | `/api/agents` | List all agents |
|
|
84
|
+
| GET | `/api/agents/:id` | Get agent by ID |
|
|
85
|
+
| POST | `/api/agents` | Create agent |
|
|
86
|
+
| PATCH | `/api/agents/:id` | Update agent |
|
|
87
|
+
|
|
88
|
+
### Sessions
|
|
89
|
+
|
|
90
|
+
| Method | Endpoint | Description |
|
|
91
|
+
|--------|----------|-------------|
|
|
92
|
+
| POST | `/api/agent-sessions` | Create session |
|
|
93
|
+
| GET | `/api/agent-sessions/:id` | Get session state |
|
|
94
|
+
| POST | `/api/agent-sessions/:id/trigger` | Execute trigger (SSE) |
|
|
95
|
+
|
|
96
|
+
## Streaming
|
|
97
|
+
|
|
98
|
+
The trigger endpoint returns Server-Sent Events (SSE):
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
curl -N -H "Authorization: Bearer YOUR_API_KEY" \
|
|
102
|
+
-H "Content-Type: application/json" \
|
|
103
|
+
-d '{"triggerName": "user-message", "input": {"USER_MESSAGE": "Hello"}}' \
|
|
104
|
+
https://octavus.ai/api/agent-sessions/SESSION_ID/trigger
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Response format:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
data: {"type":"block-start","blockId":"...","blockName":"Respond"}
|
|
111
|
+
|
|
112
|
+
data: {"type":"text-delta","content":"Hello"}
|
|
113
|
+
|
|
114
|
+
data: {"type":"text-delta","content":"!"}
|
|
115
|
+
|
|
116
|
+
data: {"type":"done","finishReason":"stop"}
|
|
117
|
+
|
|
118
|
+
data: [DONE]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## SDKs
|
|
122
|
+
|
|
123
|
+
We recommend using our SDKs instead of calling the API directly:
|
|
124
|
+
|
|
125
|
+
- **Server SDK**: `@octavus/server-sdk` - For Node.js backends
|
|
126
|
+
- **Client SDK**: `@octavus/client-sdk` - For React frontends
|
|
127
|
+
|
|
128
|
+
The SDKs handle authentication, streaming, and tool execution automatically.
|
|
129
|
+
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Sessions
|
|
3
|
+
description: Session management API endpoints.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Sessions API
|
|
7
|
+
|
|
8
|
+
Sessions represent conversations with agents. They store conversation history, resources, and variables.
|
|
9
|
+
|
|
10
|
+
## Create Session
|
|
11
|
+
|
|
12
|
+
Create a new agent session.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
POST /api/agent-sessions
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Request Body
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"agentId": "support-chat",
|
|
23
|
+
"input": {
|
|
24
|
+
"COMPANY_NAME": "Acme Corp",
|
|
25
|
+
"PRODUCT_NAME": "Widget Pro",
|
|
26
|
+
"USER_ID": "user-123"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
| Field | Type | Required | Description |
|
|
32
|
+
|-------|------|----------|-------------|
|
|
33
|
+
| `agentId` | string | Yes | Agent identifier (slug) |
|
|
34
|
+
| `input` | object | No | Input variables for the agent |
|
|
35
|
+
|
|
36
|
+
### Response
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"sessionId": "sess_abc123xyz"
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Example
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
curl -X POST https://octavus.ai/api/agent-sessions \
|
|
48
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
49
|
+
-H "Content-Type: application/json" \
|
|
50
|
+
-d '{
|
|
51
|
+
"agentId": "support-chat",
|
|
52
|
+
"input": {
|
|
53
|
+
"COMPANY_NAME": "Acme Corp",
|
|
54
|
+
"PRODUCT_NAME": "Widget Pro"
|
|
55
|
+
}
|
|
56
|
+
}'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Get Session
|
|
60
|
+
|
|
61
|
+
Retrieve session state including messages and resources.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
GET /api/agent-sessions/:sessionId
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Response
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"id": "sess_abc123xyz",
|
|
72
|
+
"agentId": "support-chat",
|
|
73
|
+
"input": {
|
|
74
|
+
"COMPANY_NAME": "Acme Corp",
|
|
75
|
+
"PRODUCT_NAME": "Widget Pro"
|
|
76
|
+
},
|
|
77
|
+
"variables": {},
|
|
78
|
+
"resources": {
|
|
79
|
+
"CONVERSATION_SUMMARY": ""
|
|
80
|
+
},
|
|
81
|
+
"messages": [
|
|
82
|
+
{
|
|
83
|
+
"id": "msg_1",
|
|
84
|
+
"role": "user",
|
|
85
|
+
"parts": [
|
|
86
|
+
{ "type": "text", "visible": true, "content": "How do I reset my password?" }
|
|
87
|
+
],
|
|
88
|
+
"content": "How do I reset my password?",
|
|
89
|
+
"createdAt": "2024-01-15T10:30:00Z"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "msg_2",
|
|
93
|
+
"role": "assistant",
|
|
94
|
+
"parts": [
|
|
95
|
+
{ "type": "text", "visible": true, "content": "I can help you reset your password..." }
|
|
96
|
+
],
|
|
97
|
+
"content": "I can help you reset your password...",
|
|
98
|
+
"createdAt": "2024-01-15T10:30:05Z"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
102
|
+
"updatedAt": "2024-01-15T10:30:05Z"
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Example
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
curl https://octavus.ai/api/agent-sessions/sess_abc123xyz \
|
|
110
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Trigger Session
|
|
114
|
+
|
|
115
|
+
Execute a trigger on a session. Returns a Server-Sent Events stream.
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
POST /api/agent-sessions/:sessionId/trigger
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Request Body
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"triggerName": "user-message",
|
|
126
|
+
"input": {
|
|
127
|
+
"USER_MESSAGE": "How do I reset my password?"
|
|
128
|
+
},
|
|
129
|
+
"toolResults": []
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
| Field | Type | Required | Description |
|
|
134
|
+
|-------|------|----------|-------------|
|
|
135
|
+
| `triggerName` | string | Yes | Name of the trigger to execute |
|
|
136
|
+
| `input` | object | No | Input variables for the trigger |
|
|
137
|
+
| `toolResults` | array | No | Tool results for continuation (handled by SDK) |
|
|
138
|
+
|
|
139
|
+
### Response
|
|
140
|
+
|
|
141
|
+
Returns `text/event-stream` with SSE events:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
data: {"type":"block-start","blockId":"b1","blockName":"Add user message","blockType":"add-message","display":"hidden"}
|
|
145
|
+
|
|
146
|
+
data: {"type":"block-end","blockId":"b1"}
|
|
147
|
+
|
|
148
|
+
data: {"type":"block-start","blockId":"b2","blockName":"Respond to user","blockType":"next-message","display":"stream","outputToChat":true}
|
|
149
|
+
|
|
150
|
+
data: {"type":"text-start","id":"t1"}
|
|
151
|
+
|
|
152
|
+
data: {"type":"text-delta","content":"I"}
|
|
153
|
+
|
|
154
|
+
data: {"type":"text-delta","content":" can"}
|
|
155
|
+
|
|
156
|
+
data: {"type":"text-delta","content":" help"}
|
|
157
|
+
|
|
158
|
+
data: {"type":"text-delta","content":" you"}
|
|
159
|
+
|
|
160
|
+
data: {"type":"text-delta","content":" reset"}
|
|
161
|
+
|
|
162
|
+
data: {"type":"text-delta","content":" your"}
|
|
163
|
+
|
|
164
|
+
data: {"type":"text-delta","content":" password"}
|
|
165
|
+
|
|
166
|
+
data: {"type":"text-delta","content":"!"}
|
|
167
|
+
|
|
168
|
+
data: {"type":"text-end","id":"t1"}
|
|
169
|
+
|
|
170
|
+
data: {"type":"block-end","blockId":"b2"}
|
|
171
|
+
|
|
172
|
+
data: {"type":"done","finishReason":"stop"}
|
|
173
|
+
|
|
174
|
+
data: [DONE]
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Event Types
|
|
178
|
+
|
|
179
|
+
| Event | Description |
|
|
180
|
+
|-------|-------------|
|
|
181
|
+
| `block-start` | Execution block started |
|
|
182
|
+
| `block-end` | Execution block completed |
|
|
183
|
+
| `text-start` | Text generation started |
|
|
184
|
+
| `text-delta` | Incremental text content |
|
|
185
|
+
| `text-end` | Text generation ended |
|
|
186
|
+
| `tool-call-start` | Tool call initiated |
|
|
187
|
+
| `tool-call-args` | Tool arguments (JSON string) |
|
|
188
|
+
| `tool-call-result` | Tool completed with result |
|
|
189
|
+
| `tool-call-error` | Tool failed |
|
|
190
|
+
| `tool-request` | Platform requesting tool execution |
|
|
191
|
+
| `thinking-start` | Extended reasoning started |
|
|
192
|
+
| `thinking-delta` | Reasoning content |
|
|
193
|
+
| `thinking-end` | Extended reasoning ended |
|
|
194
|
+
| `resource-update` | Resource value changed |
|
|
195
|
+
| `done` | Execution complete |
|
|
196
|
+
| `error` | Error occurred |
|
|
197
|
+
|
|
198
|
+
### Example
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
curl -N -X POST https://octavus.ai/api/agent-sessions/sess_abc123xyz/trigger \
|
|
202
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
203
|
+
-H "Content-Type: application/json" \
|
|
204
|
+
-d '{
|
|
205
|
+
"triggerName": "user-message",
|
|
206
|
+
"input": { "USER_MESSAGE": "How do I reset my password?" }
|
|
207
|
+
}'
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Tool Continuation
|
|
211
|
+
|
|
212
|
+
When the agent calls external tools, you'll receive a `tool-request` event. Execute the tools and send results back:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"triggerName": "user-message",
|
|
217
|
+
"input": { "USER_MESSAGE": "..." },
|
|
218
|
+
"toolResults": [
|
|
219
|
+
{
|
|
220
|
+
"toolCallId": "tc_123",
|
|
221
|
+
"toolName": "get-user-account",
|
|
222
|
+
"result": {
|
|
223
|
+
"name": "Demo User",
|
|
224
|
+
"email": "demo@example.com"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The Server SDK handles this continuation pattern automatically.
|
|
232
|
+
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agents
|
|
3
|
+
description: Agent management API endpoints.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agents API
|
|
7
|
+
|
|
8
|
+
Manage agent definitions including protocols and prompts.
|
|
9
|
+
|
|
10
|
+
## List Agents
|
|
11
|
+
|
|
12
|
+
Get all agents in the project.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
GET /api/agents
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Response
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"agents": [
|
|
23
|
+
{
|
|
24
|
+
"id": "agt_abc123",
|
|
25
|
+
"slug": "support-chat",
|
|
26
|
+
"name": "Support Chat",
|
|
27
|
+
"description": "Customer support agent",
|
|
28
|
+
"format": "interactive",
|
|
29
|
+
"createdAt": "2024-01-10T08:00:00Z",
|
|
30
|
+
"updatedAt": "2024-01-15T10:00:00Z"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Example
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
curl https://octavus.ai/api/agents \
|
|
40
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Get Agent
|
|
44
|
+
|
|
45
|
+
Get a single agent by ID or slug.
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
GET /api/agents/:id
|
|
49
|
+
GET /api/agents/:slug?by=slug
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Response
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"id": "agt_abc123",
|
|
57
|
+
"slug": "support-chat",
|
|
58
|
+
"name": "Support Chat",
|
|
59
|
+
"description": "Customer support agent",
|
|
60
|
+
"format": "interactive",
|
|
61
|
+
"protocol": "input:\n COMPANY_NAME: { type: string }\n...",
|
|
62
|
+
"prompts": [
|
|
63
|
+
{
|
|
64
|
+
"name": "system",
|
|
65
|
+
"content": "You are a support agent for {{COMPANY_NAME}}..."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "user-message",
|
|
69
|
+
"content": "{{USER_MESSAGE}}"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"createdAt": "2024-01-10T08:00:00Z",
|
|
73
|
+
"updatedAt": "2024-01-15T10:00:00Z"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Example
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# By ID
|
|
81
|
+
curl https://octavus.ai/api/agents/agt_abc123 \
|
|
82
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
83
|
+
|
|
84
|
+
# By slug
|
|
85
|
+
curl "https://octavus.ai/api/agents/support-chat?by=slug" \
|
|
86
|
+
-H "Authorization: Bearer YOUR_API_KEY"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Create Agent
|
|
90
|
+
|
|
91
|
+
Create a new agent.
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
POST /api/agents
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Request Body
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"settings": {
|
|
102
|
+
"slug": "support-chat",
|
|
103
|
+
"name": "Support Chat",
|
|
104
|
+
"description": "Customer support agent",
|
|
105
|
+
"format": "interactive"
|
|
106
|
+
},
|
|
107
|
+
"protocol": "input:\n COMPANY_NAME: { type: string }\n...",
|
|
108
|
+
"prompts": [
|
|
109
|
+
{
|
|
110
|
+
"name": "system",
|
|
111
|
+
"content": "You are a support agent..."
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| Field | Type | Required | Description |
|
|
118
|
+
|-------|------|----------|-------------|
|
|
119
|
+
| `settings.slug` | string | Yes | URL-safe identifier |
|
|
120
|
+
| `settings.name` | string | Yes | Display name |
|
|
121
|
+
| `settings.description` | string | No | Agent description |
|
|
122
|
+
| `settings.format` | string | Yes | `interactive` or `generation` |
|
|
123
|
+
| `protocol` | string | Yes | YAML protocol definition |
|
|
124
|
+
| `prompts` | array | Yes | Prompt files |
|
|
125
|
+
|
|
126
|
+
### Response
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"agentId": "agt_abc123"
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Example
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
curl -X POST https://octavus.ai/api/agents \
|
|
138
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
139
|
+
-H "Content-Type: application/json" \
|
|
140
|
+
-d '{
|
|
141
|
+
"settings": {
|
|
142
|
+
"slug": "my-agent",
|
|
143
|
+
"name": "My Agent",
|
|
144
|
+
"format": "interactive"
|
|
145
|
+
},
|
|
146
|
+
"protocol": "agent:\n model: anthropic/claude-sonnet-4-5\n system: system",
|
|
147
|
+
"prompts": [
|
|
148
|
+
{ "name": "system", "content": "You are a helpful assistant." }
|
|
149
|
+
]
|
|
150
|
+
}'
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Update Agent
|
|
154
|
+
|
|
155
|
+
Update an existing agent.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
PATCH /api/agents/:id
|
|
159
|
+
PATCH /api/agents/:slug?by=slug
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Request Body
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"protocol": "input:\n COMPANY_NAME: { type: string }\n...",
|
|
167
|
+
"prompts": [
|
|
168
|
+
{
|
|
169
|
+
"name": "system",
|
|
170
|
+
"content": "Updated system prompt..."
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
All fields are optional. Only provided fields are updated.
|
|
177
|
+
|
|
178
|
+
### Response
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"agentId": "agt_abc123"
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Example
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
curl -X PATCH https://octavus.ai/api/agents/agt_abc123 \
|
|
190
|
+
-H "Authorization: Bearer YOUR_API_KEY" \
|
|
191
|
+
-H "Content-Type: application/json" \
|
|
192
|
+
-d '{
|
|
193
|
+
"protocol": "agent:\n model: anthropic/claude-sonnet-4-5\n system: system\n thinking: high"
|
|
194
|
+
}'
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Sync Agent
|
|
198
|
+
|
|
199
|
+
The Server SDK provides a `sync` method that creates or updates an agent:
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
const { agentId, created } = await client.agents.sync({
|
|
203
|
+
settings: {
|
|
204
|
+
slug: 'support-chat',
|
|
205
|
+
name: 'Support Chat',
|
|
206
|
+
format: 'interactive',
|
|
207
|
+
},
|
|
208
|
+
protocol: protocolYaml,
|
|
209
|
+
prompts: [
|
|
210
|
+
{ name: 'system', content: systemPrompt },
|
|
211
|
+
],
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
if (created) {
|
|
215
|
+
console.log('Created new agent:', agentId);
|
|
216
|
+
} else {
|
|
217
|
+
console.log('Updated existing agent:', agentId);
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
This is useful for CI/CD pipelines to deploy agent updates.
|
|
222
|
+
|