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/agents

Returns 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/chat

Chat with one specific agent by its ID. Supports stream and non-stream modes.

Chat API

FieldTypeRequiredDescription
agentIdstringyesTarget agent to run.
messagestringyes*User message. Required unless you pass messages/history.
streambooleannoIf true, returns a streaming text response.
newChatbooleannoMarks 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

StatusMeaning
401Missing or invalid API key.
403API key does not have access to the requested agent.
404Agent not found.
500Server or model-provider configuration error.