API Overview
The FAOS API enables developers to programmatically interact with agents, workflows, and data. This reference documents all available endpoints.
Base URLβ
Production: https://api.faosx.ai/v1
Sandbox: https://sandbox.api.faosx.ai/v1
Authenticationβ
All API requests require authentication via API key or OAuth 2.0 token.
# API Key (Header)
curl -H "Authorization: Bearer sk_live_xxx" \
https://api.faosx.ai/v1/agents
# API Key (Query parameter - not recommended)
curl https://api.faosx.ai/v1/agents?api_key=sk_live_xxx
See Authentication for detailed setup.
Request Formatβ
- Content-Type:
application/json - Accept:
application/json - Character Encoding: UTF-8
curl -X POST https://api.faosx.ai/v1/agents \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"name": "My Agent", "template": "customer-service"}'
Response Formatβ
All responses are JSON with consistent structure:
{
"data": { ... },
"meta": {
"request_id": "req_abc123",
"timestamp": "2025-01-15T10:30:00Z"
}
}
Error Responsesβ
{
"error": {
"code": "invalid_request",
"message": "The 'name' field is required",
"param": "name"
},
"meta": {
"request_id": "req_abc123"
}
}
Paginationβ
List endpoints support cursor-based pagination:
GET /v1/agents?limit=20&cursor=abc123
Response includes pagination metadata:
{
"data": [...],
"meta": {
"has_more": true,
"next_cursor": "def456"
}
}
Rate Limitsβ
| Plan | Requests/Minute | Requests/Day |
|---|---|---|
| Starter | 60 | 10,000 |
| Growth | 300 | 100,000 |
| Enterprise | Custom | Custom |
Rate limit headers are included in responses:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1705312800
API Endpointsβ
Agentsβ
GET /v1/agents- List agentsPOST /v1/agents- Create agentGET /v1/agents/:id- Get agentPATCH /v1/agents/:id- Update agentDELETE /v1/agents/:id- Delete agent
Workflowsβ
GET /v1/workflows- List workflowsPOST /v1/workflows- Create workflowPOST /v1/workflows/:id/run- Execute workflow
Messagesβ
POST /v1/agents/:id/messages- Send message to agentGET /v1/agents/:id/messages- Get conversation history
Webhooksβ
POST /v1/webhooks- Create webhookGET /v1/webhooks- List webhooksDELETE /v1/webhooks/:id- Delete webhook
OpenAPI Specificationβ
The FAOS API is fully described using the OpenAPI 3.1 specification. You can use the spec to generate clients, validate requests, or import into tools like Postman.
https://api.faosx.ai/v1/openapi.json
Import into Postmanβ
- Open Postman and click Import
- Enter the URL:
https://api.faosx.ai/v1/openapi.json - Click Import to generate a full collection
SDKsβ
Official SDKs are available:
# Python
pip install faos
# TypeScript / JavaScript
npm install @faos/sdk
See the SDK Documentation for full reference and examples.
Next Stepsβ
- Authentication - Set up API access
- Agents API - Work with agents
- Webhooks - Real-time events
- Errors - Error handling
- Python SDK - Python SDK reference
- TypeScript SDK - TypeScript SDK reference