> For the complete documentation index, see [llms.txt](https://onairos.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://onairos.gitbook.io/docs/api-reference.md).

# API Reference

## Test user API

> Test route to test format of Onairos user API

```json
{"openapi":"3.0.3","info":{"title":"Onairos Backend API","version":"1.0.0"},"servers":[{"url":"https://api2.onairos.uk","description":"Production server"},{"url":"http://localhost:8080","description":"Development server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"InferenceInput":{"type":"object","required":["inputData","accessToken"],"properties":{"inputData":{"type":"array","items":{"type":"object","required":["text","category"],"properties":{"text":{"type":"string","description":"Text content for inference"},"category":{"type":"string","description":"Category of the content"},"img_url":{"type":"string","description":"Optional URL to an image"}}}},"accessToken":{"type":"string","description":"JWT token for authentication"}}},"InferenceResponse":{"type":"object","properties":{"InferenceResult":{"type":"object","properties":{"output":{"type":"object","description":"ML inference results"}}}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"details":{"type":"object","description":"Detailed error information"}}}}},"paths":{"/inferenceTest":{"post":{"summary":"Test user API","description":"Test route to test format of Onairos user API","tags":["User","Development"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceInput"}}}},"responses":{"200":{"description":"Successful test inference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get API access token

> Retrieve access token and approved requests for user who just agreed to connect data

```json
{"openapi":"3.0.3","info":{"title":"Onairos Backend API","version":"1.0.0"},"servers":[{"url":"https://api2.onairos.uk","description":"Production server"},{"url":"http://localhost:8080","description":"Development server"}],"paths":{"/getAPIurl":{"post":{"summary":"Get API access token","description":"Retrieve access token and approved requests for user who just agreed to connect data","tags":["Authentication"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAPIUrlInput"}}}},"responses":{"200":{"description":"Successful API URL generation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAPIUrlResponse"}}}},"403":{"description":"Forbidden - domain not registered","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"GetAPIUrlInput":{"type":"object","required":["Info"],"properties":{"Info":{"type":"object","required":["web3Type","confirmations","Domain","EncryptedUserPin","OthentSub","proofMode","account"],"properties":{"web3Type":{"type":"string","description":"Type of web3 authentication (e.g., \"Othent\")"},"confirmations":{"type":"array","items":{"type":"object","properties":{"data":{"type":"string","description":"Type of data being confirmed (e.g., \"Traits\", \"Large\", \"Medium\", \"Small\")"},"date":{"type":"string","description":"Date of confirmation"}}}},"Domain":{"type":"string","description":"Domain requesting the API URL"},"EncryptedUserPin":{"type":"string","description":"Onairos encrypted PIN"},"OthentSub":{"type":"string","description":"Othent subscription ID"},"proofMode":{"type":"boolean","description":"Whether to use proof mode"},"account":{"type":"string","description":"User account identifier"}}}}},"GetAPIUrlResponse":{"type":"object","properties":{"apiUrl":{"type":"string","description":"URL for API access"},"token":{"type":"string","description":"JWT token for authentication"}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"details":{"type":"object","description":"Detailed error information"}}}}}}
```

## User mind reading API

> Mind reading API to generate preferences/insights and memories for approved user

```json
{"openapi":"3.0.3","info":{"title":"Onairos Backend API","version":"1.0.0"},"servers":[{"url":"https://api2.onairos.uk","description":"Production server"},{"url":"http://localhost:8080","description":"Development server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"InferenceInput":{"type":"object","required":["inputData","accessToken"],"properties":{"inputData":{"type":"array","items":{"type":"object","required":["text","category"],"properties":{"text":{"type":"string","description":"Text content for inference"},"category":{"type":"string","description":"Category of the content"},"img_url":{"type":"string","description":"Optional URL to an image"}}}},"accessToken":{"type":"string","description":"JWT token for authentication"}}},"InferenceResponse":{"type":"object","properties":{"InferenceResult":{"type":"object","properties":{"output":{"type":"object","description":"ML inference results"}}}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"details":{"type":"object","description":"Detailed error information"}}}}},"paths":{"/inferenceNoProof":{"post":{"summary":"User mind reading API","description":"Mind reading API to generate preferences/insights and memories for approved user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceInput"}}}},"responses":{"200":{"description":"Successful inference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"400":{"description":"Bad request - invalid input data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Payload too large - input exceeds size limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## User traits API

> Generate only user personality traits

```json
{"openapi":"3.0.3","info":{"title":"Onairos Backend API","version":"1.0.0"},"servers":[{"url":"https://api2.onairos.uk","description":"Production server"},{"url":"http://localhost:8080","description":"Development server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"InferenceInput":{"type":"object","required":["inputData","accessToken"],"properties":{"inputData":{"type":"array","items":{"type":"object","required":["text","category"],"properties":{"text":{"type":"string","description":"Text content for inference"},"category":{"type":"string","description":"Category of the content"},"img_url":{"type":"string","description":"Optional URL to an image"}}}},"accessToken":{"type":"string","description":"JWT token for authentication"}}},"InferenceResponse":{"type":"object","properties":{"InferenceResult":{"type":"object","properties":{"output":{"type":"object","description":"ML inference results"}}}}},"Error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"details":{"type":"object","description":"Detailed error information"}}}}},"paths":{"/traits":{"post":{"summary":"User traits API","description":"Generate only user personality traits","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceInput"}}}},"responses":{"200":{"description":"Successful traits inference","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://onairos.gitbook.io/docs/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
