The MageBank API enables developers to integrate AI-driven financial agent functionality into their applications. This section provides a comprehensive reference for all available endpoints.

API Base URL

All API endpoints are accessible at:

https://api.magebank.ai

Authentication

Every API request must include your API key in the x-api-key header:

x-api-key: YOUR_API_KEY

To get your API key, visit the MageBank Dashboard and navigate to the “Integrate Agent” section.

API Endpoints

The MageBank API is organized into the following categories:

Response Format

All API responses are returned in JSON format. Successful responses typically include:

{
  "success": true,
  "... additional data fields ..."
}

Error Handling

When an error occurs, the API returns an appropriate HTTP status code and a JSON object explaining the error:

{
  "error": "Descriptive error message"
}

Common HTTP status codes:

Status CodeDescription
200Success
400Bad Request - Invalid parameters or request format
401Unauthorized - Invalid or missing API key
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Something went wrong on our end

Pagination

For endpoints that return lists of resources, pagination is supported through the following query parameters:

  • page: Page number (starts at 1)
  • limit: Number of items per page (default: 20, max: 100)

Example:

GET https://api.magebank.ai/user/payments?page=2&limit=50

Rate Limiting

To ensure service stability, API requests are rate-limited to:

  • 100 requests per minute per API key
  • 5,000 requests per day per API key

If you exceed these limits, you’ll receive a 429 Too Many Requests status code. The response headers include information about your current rate limit status:

  • X-RateLimit-Limit: The maximum number of requests allowed in the current time window
  • X-RateLimit-Remaining: The number of requests remaining in the current time window
  • X-RateLimit-Reset: The time when the current rate limit window resets (Unix timestamp)

Explore the API

Explore the various endpoints through the interactive API playground available in each endpoint’s documentation. You can test requests directly and see responses in real-time.

API Versioning

The current API version is v1. When breaking changes are introduced, we’ll release a new version and provide migration guides. To ensure compatibility, you can specify the API version in your requests:

https://api.magebank.ai/v1/agents

The current version (v1) is used by default if no version is specified.

Support

If you encounter any issues or have questions about the API, reach out to our support team at contact@magebank.ai.