Authentication
Authenticating with API Keys
To authenticate, you will need your API key. You can find your API key in the API section of your HostedAI dashboard. Once you have your key, include it in the Authorization header of your API requests, like this: Authorization: Bearer YOUR_API_KEY.
Troubleshooting
If you encounter a 401 Unauthorized error, double-check that your API key is correctly placed in the Authorization header, hasn't expired, isn't IP restricted and hasn't been revoked. Also, make sure you are targeting the correct URL. If you continue to experience problems, you can create a new API key without any IP, expiry restrictions, then if that works edit the API token to additional restrictions if required.
Making API Requests
Base URL
The base URL for all API requests is https://USER_PANEL_URL/api.
For example, to retrieve user data, use: GET https://USER_PANEL_URL/api/users.
Supported HTTP Methods
GET: Retrieve data.
POST: Create new resources.
PUT: Update existing resources.
DELETE: Remove resources.
Refer to the documentation for specific method support per endpoint.
Error Handling
HTTP Status Codes
200 OK: Successful request201 Created: New resource created400 Bad Request: Request is incorrect401 Unauthorized: Authentication required403 Forbidden: Access is not allowed404 Not Found: Resource not found500 Internal Server Error: Server error
Dates
When you provide dates to the system automatically adds midnight timestamps (00:00:00):
For example: 2025-10-31
System interprets as:
2025-10-31 00:00:00 (midnight at the start of October 31st)
When you query the same date for both start and end:
When you use the same date: /api/team-billing/summary/{team_id}/2025-10-31/2025-10-31
What the system sees:
Start time: 2025-10-31 00:00:00 (midnight starting Oct 31st)
End time: 2025-10-31 00:00:00 (same exact moment)
Time range: 0 seconds
When you use different dates: /api/team-billing/summary/{team_id}/2025-10-30/2025-10-31
What the system sees:
Start time: 2025-10-30 00:00:00 (midnight starting Oct 30th)
End time: 2025-10-31 00:00:00 (midnight starting Oct 31st)
Time range: 24 hours (all of October 30th) Result: Returns billing for October 30th
Language Integration
Use any language supporting HTTP requests.
Here is an example using Python's requests library (replace YOUR_API_KEY):
import requests
url = "https://USER_PANEL_URL/api/users"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.json())