🔐
Authentication
Secure your API requests with authentication tokens
POST
/api/auth/token
Generate API Token
Generate a new API token for accessing the AI Agents API.
Parameters
Name | Type | Required | Description |
---|---|---|---|
client_id | string | Required | Your API client ID |
client_secret | string | Required | Your API client secret |
Example Request
curl -X POST https://api.aiagents.com/auth/token \
-H "Content-Type: application/json" \
-d '{
"client_id": "your_client_id",
"client_secret": "your_client_secret"
}'
Example Response
{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"token_type": "Bearer",
"expires_in": 3600
}
🤖
AI Agents
Interact with AI agents through the API
POST
/api/agents/chat
Chat with AI Agent
Send a message to an AI agent and receive a response.
Parameters
Name | Type | Required | Description |
---|---|---|---|
agent_id | string | Required | ID of the AI agent to chat with |
message | string | Required | Message to send to the agent |
context | object | Optional | Additional context for the conversation |
Example Request
curl -X POST https://api.aiagents.com/agents/chat \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "trading_analyst",
"message": "Analyze BTC market trend",
"context": {
"timeframe": "1d"
}
}'
Example Response
{
"response": "Based on the 1-day timeframe analysis...",
"confidence": 0.95,
"analysis_data": {
"trend": "bullish",
"indicators": { ... }
}
}
📊
Analytics
Access usage analytics and insights
GET
/api/analytics/usage
Get Usage Statistics
Retrieve usage statistics for your AI agents.
Parameters
Name | Type | Required | Description |
---|---|---|---|
start_date | string | Required | Start date for the analytics period (YYYY-MM-DD) |
end_date | string | Required | End date for the analytics period (YYYY-MM-DD) |
Example Request
curl https://api.aiagents.com/analytics/usage \
-H "Authorization: Bearer YOUR_TOKEN" \
-G \
--data-urlencode "start_date=2023-01-01" \
--data-urlencode "end_date=2023-12-31"
Example Response
{
"total_requests": 1500,
"total_tokens": 75000,
"usage_by_agent": {
"trading_analyst": 500,
"business_developer": 450,
"marketing_strategist": 550
}
}