API Reference
Complete reference for all Aphelion Gateway v2.0 API endpoints with examples and response formats.
Base URL
https://api.aphl.aiAuthentication
All endpoints (except system health and Auth0 info) require JWT authentication:
Authorization: Bearer <your-jwt-token>See the Authentication guide for details on obtaining tokens.
Quick Reference
System
GET
/healthHealth checkGET
/API documentationAuthentication
GET
/auth/infoGet Auth0 configurationGET
/auth/debugDebug JWT tokenGET
/auth/profileGet user profileGET
/auth/db-statusDatabase statusService Registry
POST
/owner/servicesRegister API serviceGET
/owner/servicesGet user servicesGET
/owner/services/{serviceId}Get service detailsDELETE
/owner/services/{serviceId}Delete serviceGET
/servicesList public servicesGET
/services/{serviceId}/manifestGet service manifestSessions & Execution
POST
/v1/agentsCreate agent sessionGET
/v1/agentsGet user sessionsGET
/v1/agents/{sessionId}Get session detailsPOST
/v1/agents/{sessionId}/executeExecute toolSubscriptions
POST
/subscriptionsSubscribe to serviceGET
/subscriptionsGet user subscriptionsDELETE
/subscriptions/{subscriptionId}Cancel subscriptionGET
/subscriptions/services/idsGet subscribed service IDsMemory
GET
/memoryGet user memoriesGET
/memory/paginatedGet paginated memoriesGET
/memory/searchSearch memoriesGET
/memory/context/agentGet agent contextGET
/memory/sessions/{sessionId}/timelineGet session timelinePOST
/memory/sessions/{sessionId}/summarizeCreate session summaryGET
/memory/statsGet memory statisticsDELETE
/memoryDelete all memoriesSearch
GET
/searchUniversal searchGET
/search/toolsSearch toolsGET
/search/popularGet popular toolsGET
/search/recommendationsGet recommendationsGET
/search/suggestionsGet search suggestionsAnalytics
GET
/analytics/userGet user analyticsGET
/analytics/systemGet system analyticsGET
/analytics/toolsGet tool analyticsGET
/analytics/realtimeGet real-time metricsCommon Endpoints
Health Check
GET
/healthResponse
{
"status": "ok",
"uptime": 3600,
"version": "2.0.0",
"timestamp": "2025-06-21T10:00:00Z"
}Execute Tool
POST
/v1/agents/{sessionId}/executeRequest
{
"tool": "weather.api.get_current_weather",
"params": {
"location": "San Francisco"
}
}Response
{
"id": "execution-uuid",
"tool_name": "weather.api.get_current_weather",
"parameters": {
"location": "San Francisco"
},
"result": {
"temperature": 72,
"condition": "sunny",
"humidity": 65
},
"execution_time": 245,
"cost": 0.002,
"created_at": "2025-06-21T10:00:00Z"
}Built-in Tools
These tools are always available in every session:
Echo
{
"tool": "echo",
"params": {
"message": "Hello World"
}
}Calculate
{
"tool": "calculate",
"params": {
"expression": "2 + 2 * 3"
}
}Get Current Time
{
"tool": "get_current_time",
"params": {}
}Error Responses
All endpoints return structured error responses:
400Bad Request
{
"error": "Invalid request parameters",
"details": "Missing required field: location",
"code": "VALIDATION_ERROR"
}401Unauthorized
{
"error": "Authentication required",
"code": "MISSING_AUTHORIZATION"
}403Forbidden
{
"error": "Access denied",
"details": "Insufficient permissions for this operation",
"code": "ACCESS_DENIED"
}404Not Found
{
"error": "Resource not found",
"details": "Service with ID 'invalid-uuid' does not exist",
"code": "RESOURCE_NOT_FOUND"
}429Too Many Requests
{
"error": "Rate limit exceeded",
"details": "Maximum 100 requests per hour exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"retry_after": 3600
}500Internal Server Error
{
"error": "Internal server error",
"details": "An unexpected error occurred",
"code": "INTERNAL_ERROR"
}Rate Limits
| Endpoint Category | Rate Limit |
|---|---|
| Authentication | 10 requests per minute |
| Service Registration | 5 requests per minute |
| Tool Execution (Free tier) | 100 requests per hour |
| Memory Operations | 50 requests per minute |
| Analytics | 20 requests per minute |
ℹ️Rate Limit Headers
Check response headers
X-RateLimit-Remaining and X-RateLimit-Resetto monitor your rate limit status.Request/Response Headers
Request Headers
Content-Type: application/json
Accept: application/json
Authorization: Bearer <token>
User-Agent: aphelion-frontend/2.0.0Response Headers
Content-Type: application/json
X-Request-ID: request-uuid
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200SDKs & Tools
Python SDK
pip install aphelion
TypeScript SDK
npm install aphelion
Go SDK
go get github.com/aphelion/go-sdk
Postman Collection
Import the provided Postman collection for interactive testing:
- • Complete Auth0 authentication flow
- • All endpoint examples with proper authentication
- • Environment variables for easy testing
- • Pre-request scripts for token management
Support
Need help with the API? We're here to assist.