API Introduction

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

  1. Log in to your Seclai account
  2. Navigate to API Keys in the left sidebar
  3. Click "Create API Key"
  4. 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

HeaderRequiredDescription
X-API-KeyYesYour API key in the format YOUR_API_KEY
Content-TypeYesSet 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:

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