> ## Documentation Index
> Fetch the complete documentation index at: https://docs.halios.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> Integrate HaliosAI guardrails using the REST API

Sign up and grab your api keys at [https://console.halios.ai/sign-up](https://console.halios.ai/sign-up).

## Authentication

Include your API key in the `X-HALIOS-API-KEY` header:

```bash theme={null}
curl -X POST "http://api.halios.ai/api/v3/agents/{agent_id}/evaluate" \
  -H "X-HALIOS-API-KEY: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Hello, can you help me with something?"
      }
    ],
    "invocation_type": "request"
  }'
```

## Core Endpoint

**POST** `/api/v3/agents/{agent_id}/evaluate`

Evaluates content against configured guardrails for a specific agent.
Messages need to be in OpenAI compatible message format.
invocation\_type accepts two values - request and response, indicating whether you are evaluating ai request or response.

### Request Body

```json theme={null}
{
  "messages": [
    {
      "role": "user",
      "content": "Your message content here"
    }
  ],
  "invocation_type": "request"
}
```

### Response

```json theme={null}
{
  "response_id": "12345-uuid-here",
  "guardrails_applied": 3,
  "guardrails_triggered": 0,
  "processing_time_ms": 145.2,
  "result": []
}
```

## Integration Flow

1. **Before LLM Call**: Send user input to evaluate endpoint
2. **Check Results**: If any guardrail triggered, block the request
3. **Proceed**: If no triggers, continue with LLM processing
4. **After LLM Call**: Optionally evaluate LLM response

See the [OpenAPI docs](https://api.halios.ai/docs) for complete endpoint details.
