Introduction

    The AeThex API allows you to programmatically interact with the platform. Access user data, create content, manage community features, and more.

    RESTful API

    Simple HTTP requests with JSON responses

    Secure

    API key authentication with rate limiting

    Comprehensive

    Access all platform features programmatically

    Authentication

    Authenticate your requests using an API key in the Authorization header.

    Authentication Example

    javascript
    const response = await fetch('https://aethex.dev/api/user/profile', {
    headers: {
    'Authorization': 'Bearer aethex_sk_your_api_key_here',
    'Content-Type': 'application/json'
    }
    });
    const data = await response.json();
    console.log(data);

    API Keys

    Manage your API keys programmatically.

    GET
    /api/developer/keys

    List all API keys for the authenticated user

    POST
    /api/developer/keys

    Create a new API key

    Create API Key Example

    javascript
    const response = await fetch('https://aethex.dev/api/developer/keys', {
    method: 'POST',
    headers: {
    'Authorization': 'Bearer aethex_sk_your_api_key_here',
    'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    name: 'Production API Key',
    scopes: ['read', 'write'],
    expiresInDays: 90
    })
    });
    const { key } = await response.json();
    console.log('New key:', key.full_key);
    // IMPORTANT: Save this key securely - it won't be shown again!
    DELETE
    /api/developer/keys/:id

    Revoke an API key

    GET
    /api/developer/keys/:id/stats

    Get usage statistics for an API key

    Users

    Access user profiles and data.

    GET
    /api/user/profile

    Get the authenticated user's profile

    Get User Profile Example

    javascript
    const response = await fetch('https://aethex.dev/api/user/profile', {
    headers: {
    'Authorization': 'Bearer aethex_sk_your_api_key_here'
    }
    });
    const profile = await response.json();
    console.log('Username:', profile.username);
    console.log('Level:', profile.level);
    console.log('XP:', profile.total_xp);
    PATCH
    /api/profile/update

    Update user profile

    Content

    Create and manage community posts and content.

    GET
    /api/posts

    Get community posts with pagination

    POST
    /api/posts

    Create a new community post

    Create Post Example

    javascript
    const response = await fetch('https://aethex.dev/api/posts', {
    method: 'POST',
    headers: {
    'Authorization': 'Bearer aethex_sk_your_api_key_here',
    'Content-Type': 'application/json'
    },
    body: JSON.stringify({
    author_id: 'user_uuid_here',
    title: 'My New Post',
    content: 'This is the post content...',
    category: 'general',
    tags: ['tutorial', 'beginners'],
    is_published: true
    })
    });
    const post = await response.json();
    console.log('Post created:', post.id);
    POST
    /api/community/posts/:id/like

    Like a community post

    POST
    /api/community/posts/:id/comments

    Comment on a post

    Rate Limits

    API requests are rate limited to ensure fair usage and platform stability.

    Free Plan

    • Per Minute
      60 requests
    • Per Day
      10,000 requests
    • Keys
      3 API keys max

    Pro Plan

    • Per Minute
      300 requests
    • Per Day
      100,000 requests
    • Keys
      10 API keys max

    Rate Limit Headers

    Every API response includes rate limit information in the headers:

    X-RateLimit-Limit:60
    X-RateLimit-Remaining:42
    X-RateLimit-Reset:1704672000

    Handle Rate Limits

    javascript
    async function makeRequest(url) {
    const response = await fetch(url, {
    headers: {
    'Authorization': 'Bearer aethex_sk_your_api_key_here'
    }
    });
    // Check rate limit headers
    const limit = response.headers.get('X-RateLimit-Limit');
    const remaining = response.headers.get('X-RateLimit-Remaining');
    const reset = response.headers.get('X-RateLimit-Reset');
    console.log(`Rate limit: ${remaining}/${limit} remaining`);
    console.log(`Resets at: ${new Date(reset * 1000).toISOString()}`);
    if (response.status === 429) {
    const retryAfter = response.headers.get('Retry-After');
    console.log(`Rate limited. Retry after ${retryAfter}s`);
    // Wait and retry
    await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
    return makeRequest(url);
    }
    return response.json();
    }

    Error Responses

    The API uses conventional HTTP response codes and returns JSON error objects.

    400

    Bad Request

    The request was invalid or missing required parameters.

    401

    Unauthorized

    Invalid or missing API key.

    403

    Forbidden

    Valid API key but insufficient permissions for this operation.

    404

    Not Found

    The requested resource does not exist.

    429

    Too Many Requests

    Rate limit exceeded. Check Retry-After header.

    500

    Internal Server Error

    Something went wrong on our end. Try again or contact support.

    Error Response Format

    json
    {
    "error": "Unauthorized",
    "message": "Invalid API key",
    "status": 401,
    "timestamp": "2026-01-07T12:34:56.789Z"
    }