The custom integration lets you connect any AI agent to Secureagentics using plain HTTP requests. Use this approach when your agent is built on a framework not covered by a native integration, runs in a language other than Python or TypeScript, or follows a proprietary architecture. If a native integration exists for your framework (OpenAI, LangChain), prefer that — it requires less code. If not, the REST API gives you full flexibility.Documentation Index
Fetch the complete documentation index at: https://docs.adrian.secureagentics.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Secureagentics account with an API key. Find your key in Settings → API Keys.
- The ability to make outbound HTTPS requests from your agent’s runtime.
Steps
Register your agent
Send a Save the
POST /v1/agents request with "custom" as the framework value. You only need to do this once per agent.id from the response. All event submissions reference this ID.Understand the event schema
Every event you send to
Event types:
POST /v1/agents/{id}/events must follow this structure:| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Event type. One of prompt, completion, tool_call, error, custom. |
payload | object | Yes | Arbitrary JSON object containing the event data. |
trace_id | string | No | A correlation ID you supply to group related events for a single request. |
timestamp | string | No | ISO 8601 timestamp. Defaults to the time Secureagentics receives the event. |
prompt— The input sent to an LLM.completion— The output returned by an LLM.tool_call— An external tool or function invoked by the agent.error— An exception or failure in the agent pipeline.custom— Any other event meaningful to your application.
The
payload object has no enforced schema — you can include any fields that are useful for your monitoring needs. Secureagentics indexes common fields like model, prompt, response, and token_count automatically when present.Send events
Post events to
https://api.secureagentics.ai/v1/agents/{id}/events with your API key in the Authorization header.Batch events for efficiency
If your agent generates a high volume of events, use the batch endpoint to send multiple events in a single request. This reduces the number of outbound HTTP calls and helps you stay within rate limits.Send a
POST request to https://api.secureagentics.ai/v1/agents/{id}/events/batch with a JSON array of event objects.Handle errors
The Secureagentics API returns standard HTTP status codes. Handle these in your integration to avoid silent failures.
| Status | Meaning | Action |
|---|---|---|
401 | Invalid or missing API key | Check your Authorization header and verify the key is active. |
404 | Agent ID not found | Confirm the agent_id matches a registered agent. |
429 | Rate limit exceeded | Back off and retry. See the Retry-After response header. |