API Introduction
The Seclai REST API allows you to programmatically create and manage AI agents, knowledge bases, sources, and runs. This page provides an overview of how to get started with the API.
Base URL
All API requests should be made to:
https://api.seclai.com/
Authentication
The Seclai API uses API keys for authentication. Include your API key in the X-API-Key header of each request:
X-API-Key: YOUR_API_KEY
Get Your API Key
- Log in to your Seclai account
- Navigate to API Keys in the left sidebar
- Click "Create API Key"
- Copy your key and store it securely right away. The key will not be shown again.
Important: Treat your API keys like passwords. Never share them or commit them to version control.
Making Requests
Example Request
curl https://api.seclai.com/agents \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Request Headers
| Header | Required | Description |
|---|---|---|
X-API-Key | Yes | Your API key in the format YOUR_API_KEY |
Content-Type | Yes | Set to application/json for POST/PUT requests |
Response Format
All responses are returned as JSON. Successful responses will have a 200 status code and include the requested data:
{
"id": "agent_abc123",
"name": "My Agent",
"status": "active",
"created_at": "2026-01-12T10:00:00Z"
}
Error Responses
Error responses include an error object with details:
{
"error": {
"type": "invalid_request_error",
"message": "Missing required field: name",
"code": "missing_field"
}
}
Pagination
List endpoints support pagination using limit and offset parameters:
curl "https://api.seclai.com/agents?limit=20&offset=0" \
-H "X-API-Key: YOUR_API_KEY"
Response:
{
"data": [...],
"has_more": true,
"total": 150
}
SDKs
We provide official SDKs to make integration easier:
- Python SDK -
pip install seclai - JavaScript SDK -
npm install @seclai/sdk - Go SDK -
go get github.com/seclai/seclai-go - C# SDK -
dotnet add package Seclai - CLI Tool -
npm install -g @seclai/cli
Webhooks
Configure webhooks to receive real-time notifications about events in your account:
{
"event": "agent.run.completed",
"data": {
"run_id": "run_xyz789",
"agent_id": "agent_abc123",
"status": "completed"
}
}
Set up webhooks in your account settings.
Next Steps
- API Reference - Complete endpoint documentation
- API Examples - Common use cases and code samples
- Authentication Guide - Detailed authentication setup