@extends('dashboard') @section('page-title', $agent->name . ' - API Documentation') @section('content')
Complete API documentation for integrating with your AI agent.
All API requests require authentication using your agent's API key. Include the API key in the header of each request.
X-API-Key: YOUR_API_KEY
Never share your API key publicly or commit it to version control. You can regenerate your API key at any time from the agent settings page.
All API requests should be made to the following base URL:
{{ $agent->deployment_url }}
Send a message to the AI agent and receive a response.
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | The message to send to the agent. |
| conversation_id | string | No | ID of an existing conversation. Include this to continue a previous conversation. |
| context | object | No | Additional context information to help the agent generate better responses. |
curl -X POST "{{ $agent->deployment_url }}/api/v1/chat" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"message": "What services do you offer?",
"context": {
"user_type": "prospect",
"referrer": "pricing_page"
}
}'
{
"response": "We offer a wide range of services including web hosting, domain registration, email hosting, and AI-powered solutions. Our hosting plans start at $5.99/month and include 24/7 support. Would you like me to provide more details about any specific service?",
"conversation_id": "conv_3f8a9d2e7c1b",
"created_at": "2023-08-15T14:32:07Z"
}
Check if the agent is available and get its current status.
curl -X GET "{{ $agent->deployment_url }}/api/v1/status" \
-H "X-API-Key: YOUR_API_KEY"
{
"status": "available",
"version": "1.0.0",
"model": "{{ $agent->model_type }}"
}
| Code | Description |
|---|---|
| 200 | Success. The request was processed successfully. |
| 400 | Bad Request. The request was malformed or missing required parameters. |
| 401 | Unauthorized. Invalid or missing API key. |
| 429 | Too Many Requests. You've exceeded the rate limit for your plan. |
| 500 | Server Error. Something went wrong on our end. |
API requests are subject to rate limiting to ensure fair usage across all users.
Current rate limits for your plan:
| Endpoint | Limit | Window |
|---|---|---|
| /api/v1/chat | 60 requests | per minute |
| /api/v1/status | 300 requests | per minute |
When a rate limit is exceeded, the API will return a 429 response code with a Retry-After header indicating when you can try again.
We provide official client libraries to help you integrate with the API more easily: