API Reference
Complete API documentation for Onairos endpoints.
🌐 Base URL
https://api2.onairos.uk
http://localhost:8080
🔐 Authentication
All API requests require Bearer token authentication in the header:
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Test User API
/inferenceTest
Test route to validate the format of Onairos user API requests before production.
📥 Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
inputData | array | ✅ | Array of inference input objects |
inputData[].text | string | ✅ | Text content for inference |
inputData[].category | string | ✅ | Category of the content |
inputData[].img_url | string | ❌ | Optional URL to an image |
accessToken | string | ✅ | JWT token for authentication |
Request Example
{
"inputData": [
{
"text": "I love hiking and outdoor adventures",
"category": "interests",
"img_url": "https://example.com/hiking.jpg"
}
],
"accessToken": "eyJhbGciOiJIUzI1NiIs..."
}
Response (200 OK)
{
"InferenceResult": {
"output": {
"sentiment": [[0.9234]],
"confidence": 0.95
}
}
}
Get API Access Token
/getAPIurl
Retrieve access token and approved requests for a user who just agreed to connect their data.
📥 Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
Info.web3Type | string | ✅ | Type of web3 auth (e.g., "Othent") |
Info.confirmations | array | ✅ | Array of data confirmations |
Info.Domain | string | ✅ | Your registered domain |
Info.EncryptedUserPin | string | ✅ | Onairos encrypted PIN |
Info.proofMode | boolean | ✅ | Enable ZK proof mode |
Info.account | string | ✅ | User account identifier |
Request Example
{
"Info": {
"web3Type": "Othent",
"confirmations": [
{ "data": "Traits", "date": "2024-12-27" }
],
"Domain": "yourapp.com",
"EncryptedUserPin": "encrypted_pin_here",
"OthentSub": "sub_123456",
"proofMode": false,
"account": "user_account_id"
}
}
Response (200 OK)
{
"apiUrl": "https://api2.onairos.uk/inference/abc123",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6..."
}
User Mind Reading API
/inferenceNoProof
Generate user preferences, insights, and memories based on their authorized data. This is the main inference endpoint.
📥 Request Body
Same structure as Test User API - array of input objects with text, category, and optional image URL.
📤 Response Codes
| 200 | Successful inference - returns ML results |
| 400 | Bad request - invalid input data format |
| 401 | Unauthorized - invalid or expired token |
| 413 | Payload too large - input exceeds size limit |
| 500 | Server error - internal processing failed |
User Traits API
/traits
Generate only user personality traits without full inference. Lighter weight endpoint for trait-only applications.
Request Example
{
"inputData": [
{
"text": "User profile content...",
"category": "profile"
}
],
"accessToken": "your_jwt_token"
}
Response (200 OK)
{
"Traits": {
"positive_traits": {
"creativity": 9.7,
"empathy": 9.6,
"curiosity": 9.1
},
"traits_to_improve": {
"patience": 3.2,
"organization": 4.1
}
}
}
⚠️ Error Response Format
All API errors return a consistent JSON structure:
{
"message": "Human-readable error description",
"details": {
"code": "ERROR_CODE",
"field": "problematic_field",
"suggestion": "How to fix the issue"
}
}
Contact our developer support at support@onairos.uk or join our Discord community.