v1
Agent API
Access your account agents over HTTP using your account API key. List available agents, send chats to a specific agent ID, and choose streaming or non-streaming responses per request.
Authentication
Every API request needs your account key. Generate and rotate keys from the dashboard only, then pass them via X-API-Key or Authorization: Bearer ....
Endpoints
GET
/api/agentsReturns agents owned by the account tied to the provided API key.
curl -X GET "https://ai.sultatech.com/api/agents" \
-H "X-API-Key: sulta_sk_xxx..."POST
/api/agents/chatChat with one specific agent by its ID. Supports stream and non-stream modes.
Chat API
| Field | Type | Required | Description |
|---|---|---|---|
| agentId | string | yes | Target agent to run. |
| message | string | yes* | User message. Required unless you pass messages/history. |
| stream | boolean | no | If true, returns a streaming text response. |
| newChat | boolean | no | Marks the request as a new conversation for analytics. |
Non-stream request body
{
"agentId": "AGENT_ID",
"message": "Give me a summary of today's support tickets",
"stream": false,
"newChat": true
}cURL request
curl -X POST "https://ai.sultatech.com/api/agents/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: sulta_sk_xxx..." \
-d '{
"agentId": "AGENT_ID",
"message": "Hello!",
"stream": false
}'JavaScript streaming request
const response = await fetch("https://ai.sultatech.com/api/agents/chat", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "sulta_sk_xxx..."
},
body: JSON.stringify({
agentId: "AGENT_ID",
message: "Walk me through this month\'s KPI changes.",
stream: true
})
});
if (!response.ok) throw new Error("Request failed");
const reader = response.body?.getReader();
const decoder = new TextDecoder();
while (reader) {
const { value, done } = await reader.read();
if (done) break;
process.stdout.write(decoder.decode(value));
}Non-stream response shape
{
"content": "Here is your agent response...",
"model": "gemini-3-flash-preview",
"usage": {
"inputTokens": 241,
"outputTokens": 73,
"totalTokens": 314
}
}Error Codes
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key. |
| 403 | API key does not have access to the requested agent. |
| 404 | Agent not found. |
| 500 | Server or model-provider configuration error. |