Files
aitbc/docs/developer/api/coordinator/authentication.md
oib ff5486fe08 ```
chore: refactor logging module, update genesis timestamp, remove model relationships, and reorganize routers

- Rename logging.py to logger.py and update import paths in poa.py and main.py
- Update devnet genesis timestamp to 1766828620
- Remove SQLModel Relationship declarations from Block, Transaction, and Receipt models
- Add SessionDep type alias and get_session dependency in coordinator-api deps
- Reorganize coordinator-api routers: replace explorer/registry with exchange, users, marketplace
2025-12-28 21:05:53 +01:00

2.0 KiB

title, description
title description
API Authentication Understanding authentication for the Coordinator API

API Authentication

All Coordinator API endpoints require authentication using API keys.

Getting Started

  1. Sign up at AITBC Dashboard
  2. Generate an API key
  3. Include the key in your requests

Authentication Methods

X-API-Key: your_api_key_here

Query Parameter

GET /v1/jobs?api_key=your_api_key_here

Example Requests

cURL

curl -X GET https://aitbc.bubuit.net/api/v1/jobs \
  -H "X-API-Key: your_api_key_here"

Python

import requests

headers = {
    "X-API-Key": "your_api_key_here"
}

response = requests.get(
    "https://aitbc.bubuit.net/api/v1/jobs",
    headers=headers
)

JavaScript

const headers = {
    "X-API-Key": "your_api_key_here"
};

fetch("https://aitbc.bubuit.net/api/v1/jobs", {
    headers: headers
})
.then(response => response.json())
.then(data => console.log(data));

Security Best Practices

  • Never expose API keys in client-side code
  • Use environment variables in production
  • Rotate keys regularly
  • Monitor API usage
  • Use HTTPS for all requests

Rate Limits

API requests are rate-limited based on your plan:

  • Free: 60 requests/minute
  • Pro: 600 requests/minute
  • Enterprise: 6000 requests/minute

Rate limit headers are included in responses:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1640995200

Error Handling

{
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid"
  }
}

Key Management

View Your Keys

Visit the Dashboard

Revoke a Key

curl -X DELETE https://aitbc.bubuit.net/api/v1/api-keys/{key_id} \
  -H "X-API-Key: your_master_key"

Regenerate a Key

curl -X POST https://aitbc.bubuit.net/api/v1/api-keys/{key_id}/regenerate \
  -H "X-API-Key: your_master_key"