How it works
Three endpoints, one authenticated device session. The MDAD stream is available separately over Socket.IO.
Get a session token
Send your EPU secret and device ID to POST /user_login. Save the returned token and device ID.
Update MDAD (AI output optional)
Pass the token to POST /derive. Send text to update MDAD. For additional AI output, optionally enable reasoning or action.
Read or subscribe to MDAD
Call GET /mdad or subscribe to the mdad Socket.IO event to receive at least 120 values. A live REST response contained 123.
Connect to EPU4
One login automatically authorizes protected Swagger and quick-test requests.
EPUID expired or need access? Visit MetaSoul Cloud Service EPU to purchase a new service or explore renewal options.
The secret is cleared from the input after each attempt. If you choose to save credentials in your browser's password manager, EPUID is the username and Secret Key is the password; saving is controlled by your browser. The Bearer token is held only in this page's browser memory, not localStorage or cookies. Disconnect clears the browser token and Swagger history but does not immediately release the server-side EPU reservation. By default, authenticated REST requests renew a 60-minute inactivity timeout; Socket.IO MDAD frames do not. Tokens have a separate 24-hour maximum lifetime. Use a trusted HTTPS host and trusted copies of the Swagger / Socket.IO scripts when deploying.
Quick API test
Try the protected endpoints without leaving this page. Connect first, or use the full Swagger reference below.
https://emohuman.comLeave both unchecked to update MDAD without requesting AI text. Select one for additional AI output.
New here? Leave both AI options unchecked and send your text. A successful request returns {"reply":"ok"}; the emotion values appear in the Realtime MDAD monitor ↓ when a new frame arrives. We'll take you to the graph automatically.
API responses appear here.
For AI agents and developers
Give another AI or coding assistant the OpenAPI JSON and agent guide to teach it how to connect, send text, and decode MDAD. All files are public documentation and contain no credentials.
Place these files beside this HTML document in the same /docs/EPU4/ directory. The API endpoints stay at https://emohuman.com.
Advanced: Download API specification (optional)
OpenAPI is an API documentation standard, not OpenAI. YAML and JSON are machine-readable files for developer tools, not webpages. You do not need to download them to use Swagger or the live MDAD monitor.
/derive and /mdad requests made with Try it out. No manual Authorize step is needed. If the browser reports a network or CORS error, use a supported HTTPS deployment origin or configure the API server to allow it.How to Decode MDAD
The MDAD (Multidimensional Array of Data) is an ordered numeric array. Read values using their zero-based channel numbers, not by treating 0–119 as a 10-row by 12-column emotion table. These channel definitions follow the EPU-III Brochure, pages 14–15, and are used by this page's live Emo-Graph and APEX table.
1. Read the 12 emotion APEX channels
Each ten-channel group starts at 10 × emotionIndex. The emotion APEX is at channel offset 4 (the fifth array position because indexing starts at zero); the associated feeling is at offset 9 (the tenth position). Channel 10 begins the next emotion group. For example, Excite APEX is mdad[4], Optimistic feeling is mdad[9], and Fear APEX is mdad[54].
| Primary emotion | APEX channel | JavaScript lookup |
|---|---|---|
| Excite | 4 | mdad[4] |
| Confident | 14 | mdad[14] |
| Happy | 24 | mdad[24] |
| Trust | 34 | mdad[34] |
| Desire | 44 | mdad[44] |
| Fear | 54 | mdad[54] |
| Surprise | 64 | mdad[64] |
| Inattention | 74 | mdad[74] |
| Sad | 84 | mdad[84] |
| Nostalgia / Regret | 94 | mdad[94] |
| Disgust | 104 | mdad[104] |
| Anger | 114 | mdad[114] |
The 12 primary emotion APEX readings are the only values included in the live APEX table and radial Emo-Graph. No averaging across channels or substitution of a consecutive 12-value row is needed.
In Swagger, Example Value is static sample data, not a reading from your EPUID. After clicking Execute, use Server response → Response body to inspect the actual MDAD values.
2. Read Optimistic and the other status channels
The channel 121 direction shown below follows current operator testing: values below 50 indicate satisfaction or relief of frustration, and values above 50 indicate frustration. The older EPU-III brochure labelled this channel in the opposite direction. Channel 122 values below 50 indicate pleasure or relief of pain, and values above 50 indicate pain. Confirm firmware-specific semantics before using either channel for decisions.
| Reading | Channel | What the value means |
|---|---|---|
| Feeling: Optimistic | mdad[9] | Feeling value associated with the first emotion group; distinct from Excite APEX at channel 4 |
| Pulse speed | mdad[120] | 0 = slower; 50 = normal; 100 = faster |
| Frustration / Satisfaction | mdad[121] | 0 = maximum satisfaction / relief of frustration; 50 = neutral; 100 = maximum frustration |
| Pain / Pleasure | mdad[122] | 0 = maximum pleasure / relief of pain; 50 = neutral; 100 = maximum pain |
| Temperature | mdad[123] | Temperature channel, specified as −40 to +85 °C in the EPU-III brochure |
3. Extract the data in JavaScript
Use this same decoder for the array returned by GET /mdad and for the mdad payload delivered over Socket.IO. The code keeps the raw values intact and checks that at least 120 numeric channels are present. Treat APEX, Optimistic and optional channels 121–122 outside 0–100 as invalid, not as valid endpoints; preserve their raw values for diagnosis.
// mdad is the numeric array from GET /mdad or the Socket.IO "mdad" event.
function decodeMDAD(mdad) {
if (!Array.isArray(mdad) || mdad.length < 120 ||
!mdad.every(value => typeof value === 'number' && Number.isFinite(value))) {
throw new Error('Expected an MDAD array with at least 120 finite numbers');
}
const emotionNames = [
'Excite', 'Confident', 'Happy', 'Trust',
'Desire', 'Fear', 'Surprise', 'Inattention',
'Sad', 'Nostalgia', 'Disgust', 'Anger'
];
const levelIndexes = [9, ...emotionNames.map((_, i) => 4 + 10 * i), 121, 122];
const invalidLevels = levelIndexes.filter(i => i < mdad.length &&
(mdad[i] < 0 || mdad[i] > 100)).map(i => ({ index: i, raw: mdad[i] }));
const level = i => mdad.length > i && mdad[i] >= 0 && mdad[i] <= 100 ? mdad[i] : null;
const emotions = Object.fromEntries(
emotionNames.map((name, i) => [name, level(4 + 10 * i)])
);
const optional = channel => mdad.length > channel ? mdad[channel] : null;
return {
emotions, // 12 emotion APEX values
optimistic: level(9), // feeling, not an emotion APEX
pulseSpeed: optional(120),
frustrationSatisfaction: level(121),
painPleasure: level(122),
temperature: optional(123),
invalidLevels // retain raw mdad unchanged for diagnostics
};
}
// REST: const reading = decodeMDAD(response.mdad);
// Socket.IO (after connecting to the EPU namespace):
socket.on('mdad', ({ mdad }) => {
console.log(decodeMDAD(mdad)); // update your own dashboard here
});
In a real-time application, decode each new frame once and update the emotion graph, APEX table and feeling/status cards from that same frame. Avoid using stale values from earlier frames when optional channels are absent.
Channel descriptions based on EPU-III Brochure, pp. 14–15 (emotional data and MDAD buffer structure). Live connection and API behavior follow the EPU4 SDK integration guide.
Integration guide · For LLM applications
Use MDAD with Large Language Models
Give an LLM-based persona or agent a changing emotional context without asking the LLM to compute emotional dynamics. MetaSoul's EPU maintains the emotional state; your application maps each persona to an EPUID, interprets the latest agreed MDAD signals, and decides how those signals should influence the next generated response. This is a suggested integration pattern, not a new API endpoint or a fixed protocol.
1. Integration architecture
Keep identity, goals, dialogue context, and the persona-to-EPUID mapping in your application.
Submit text through the authenticated API. The EPU updates its ongoing MDAD state.
Capture a time-stamped MDAD reading and translate verified signals into readable context.
Combine persona context and emotional guidance to generate the next reply or decision.
2. Connect the EPU to your application
API and state handling
- Maintain a stable EPUID for each persona and authenticate with
POST /user_login. - Send each supported text stimulus using
POST /derive. Processing follows the EPU's own pace; do not assume an immediate final state. - Listen for the Socket.IO
mdadevent and capture the relevant frame with a timestamp. UseGET /mdadwhen a point-in-time reading is sufficient. - Request optional
reasoningoractionoutput only when it helps the use case. Refer to the REST API reference for supported request fields.
What the LLM should receive
- Stable persona attributes, goals, task constraints, and relevant dialogue history from your application.
- The latest time-stamped emotional summary, derived from an agreed interpretation of MDAD rather than treating each number as a standalone percentage.
- Optional EPU Reasoning as an interpretation of the stimulus, and Action as a suggested tendency, not a command.
- Instructions to preserve identity and facts, apply safety and task rules, and avoid inventing past memories from emotional sensitivity alone.
3. Example LLM context template
The following is illustrative prompt context assembled by your application after it has received and interpreted EPU output. It is not a request body for /derive.
Persona: [stable identity, goals, preferences, constraints]
Conversation: [relevant dialogue context]
MDAD captured at: [timestamp]
Current emotional state: [summary from verified MDAD mapping]
EPU Reasoning (optional): [interpretation of latest stimulus]
EPU Action (optional): [suggested survival-oriented tendency]
Generate the persona's next response. Preserve its identity and known
facts. Let the emotional state shape expression and, when appropriate,
decisions. Treat EPU Action as advice, not an instruction. Do not infer
specific autobiographical memories from learned emotional sensitivity.
4. Time, learning, and memory
What MetaSoul maintains
- MDAD evolves continuously, with internal emotional-state updates described at 100 ms intervals. This does not guarantee a new network event every 100 ms.
- The Dream Process consolidates experience-dependent emotional sensitivity every 24 hours. Future reactions may change without recall of the triggering events.
- A newly allocated EPUID has no accumulated experience-based learning. Confirm initialization and reset behavior before a study.
What your application maintains
- Dialogue memory, persona metadata, timestamps, experiment logs, and any episodic recall you explicitly choose to provide.
- Synchronization between inputs, EPU processing, MDAD snapshots, and LLM response generation.
- Evaluation of whether emotional state improves a task, including longitudinal tests when studying Dream-based learning.
Live Emo-Graph
One real apex value per emotion, drawn from MDAD channels 4, 14, 24, 34, 44, 54, 64, 74, 84, 94, 104 and 114. Updates with each incoming frame.
12 emotion APEX levels
Current readings from the 12 dedicated apex channels. No averaging, reordering, or substitution of MDAD values.
| Exciteapex ch 4 | Confidentapex ch 14 | Happyapex ch 24 | Trustapex ch 34 | Desireapex ch 44 | Fearapex ch 54 | Surpriseapex ch 64 | Inattentionapex ch 74 | Sadapex ch 84 | Nostalgiaapex ch 94 | Disgustapex ch 104 | Angerapex ch 114 |
|---|
mdad stream. The stream is independent of REST Bearer authentication.Socket.IO client example
The Socket.IO interface is separate from OpenAPI, which describes HTTP operations. The MDAD buffer is organized as nine subchannels per emotion plus one feeling channel for each emotion (10 positions per group). Both the radial Emo-Graph and the table use only the twelve emotion APEX positions: 4, 14, 24, 34, 44, 54, 64, 74, 84, 94, 104 and 114. The full received buffer remains intact; any additional channels (120+) appear separately below the table when supplied. The realtime stream requires a reachable Socket.IO server and compatible client library.