Skip to main content

Base URL

All API requests should be made to:
https://api.agentflare.com/v1

API Architecture

Authentication

The Agentflare API uses bearer token authentication. Include your API key in the Authorization header:
Authorization: Bearer <your-api-key>
curl -H "Authorization: Bearer <your-api-key>" \
  https://api.agentflare.com/v1/servers

Rate Limiting

API requests are rate limited to ensure fair usage:
  • Free tier: 60 requests per minute
  • Pro tier: 600 requests per minute
  • Enterprise: Custom limits
Rate limit information is included in response headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1640995200

Response Format

All API responses follow a consistent JSON structure:

Success Response

{
  "success": true,
  "data": {
    // Response data
  },
  "meta": {
    "timestamp": "2024-01-01T00:00:00Z",
    "request_id": "req_123abc"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "Invalid request parameters",
    "details": {
      // Additional error details
    }
  },
  "meta": {
    "timestamp": "2024-01-01T00:00:00Z",
    "request_id": "req_123abc"
  }
}

Status Codes

Status CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Too Many Requests
500Internal Server Error

Pagination

List endpoints support pagination using page and limit parameters:
GET /v1/tool-calls?page=2&limit=50
Pagination metadata is included in the response:
{
  "data": [...],
  "pagination": {
    "page": 2,
    "limit": 50,
    "total": 1234,
    "pages": 25
  }
}

Webhooks

Configure webhooks to receive real-time notifications:
  1. Go to Dashboard → Settings → Webhooks
  2. Add your webhook endpoint URL
  3. Select events to subscribe to
  4. Save and verify the webhook

Webhook Security

All webhooks include a signature header for verification:
X-Agentflare-Signature: sha256=...
const crypto = require("crypto");

function verifyWebhook(payload, signature, secret) {
  const hmac = crypto.createHmac("sha256", secret);
  const digest = "sha256=" + hmac.update(payload).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(digest));
}

Next Steps

I