Skip to content
Get Started

Getting Started

Quickstart

Three steps: connect your data, watch it standardize, put AI on top.

Mirobody in three steps: ① connect data → ② it comes back standardized → ③ use it with AI. Everything is OpenAI-compatible — you’ll need an mb_live_* key and ~10 minutes.

All /v1 endpoints share one base URL — pick the cluster your account uses:

https://api.mirobody.ai/v1 # Global
https://api.mirobody.cn/v1 # China

Japan and EU clusters are in preparation — see Regions. Model providers and pricing can differ by region, so read GET /v1/models from the cluster you call.

Connect your data

Health data arrives in four shapes — each has exactly one door in:

Data shapeTypical sourceHow it goes inEndpoint
Structured readingsDevices / wearables (you own the integration — write daily aggregates), manual entriesStructured recordsPOST /v1/data — pre-aggregate high-frequency samples; episodes (sleep, workouts) carry time + end_time. See the device-data cookbook.
Files / photosLab reports, checkup PDFs, phone photosFile uploadPOST /v1/files — stores the original, extracts its text, and pulls out standardized readings automatically. POST /v1/standardize runs the same extraction synchronously — for example as a dry-run preview.
Narrative with readings“headache all day, temperature was 38.2 °C”, dictated notesNarrative textPOST /v1/standardize — the quantifiable readings are extracted; the narrative around them is dropped.
Purely subjective journal“dizzy and a headache all afternoon”, mood notesSingle-turn agent callPOST /v1/responses with store: true — readings and durable memories are extracted from the entry. See the Journaling recipe.

Mirobody stores source data, standardizes structured readings, and makes both available to AI. You decide how data is collected and prepared before it reaches the API.

Write structured readings with POST /v1/data (retention is required), or upload a lab report — PDF, photo, spreadsheet — with POST /v1/files:

Terminal window
# Structured records
curl https://api.mirobody.ai/v1/data \
-H "Authorization: Bearer $MIROBODY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user": "alice",
"retention": "permanent",
"records": [
{"indicator": "fasting_glucose", "value": 97, "unit": "mg/dL", "time": "2026-06-16T07:30:00Z"},
{"indicator": "FBG", "value": 92, "unit": "mg/dL", "time": "2026-06-17T07:25:00Z"}
]
}'
# Or a document (the original is stored right away; its text is ready a moment later)
curl https://api.mirobody.ai/v1/files \
-H "Authorization: Bearer $MIROBODY_API_KEY" \
-F "user=alice" -F "file=@lab_report.pdf"

user is the tenant-isolation key — pass each end-user’s stable id and their data never mixes.

It comes back standardized

Note the two spellings above — fasting_glucose and FBG. Read the data back and both rows carry the same LOINC code, a canonical name, UCUM-parsed values, and a FHIR mirror id:

Terminal window
curl "https://api.mirobody.ai/v1/data?user=alice&limit=10" \
-H "Authorization: Bearer $MIROBODY_API_KEY"
{
"object": "list",
"data": [
{
"indicator": "FBG",
"value": "92 mg/dL",
"parsed_value": "92",
"parsed_unit": "mg/dL",
"loinc_code": "1558-6",
"canonical_name": "Fasting glucose [Mass/volume] in Serum or Plasma",
"fhir_resource_id": "8f3c9a1e-...",
"time": "2026-06-17T07:25:00+00",
"source": "api",
"comment": ""
}
],
"has_more": false,
"subject": "alice"
}

That’s the standardization pipeline — deterministic name→LOINC (no LLM code-guessing) + UCUM + FHIR, on every structured-record write. To extract and standardize readings from a document, use POST /v1/standardize with the file itself or an uploaded file_key.

Put AI on top

A grounded answer is three lines — the agent reads the standardized series, so “glucose” finds the rows written as “FBG”:

Answers API (3 lines)
from openai import OpenAI
client = OpenAI(api_key="mb_live_...", base_url="https://api.mirobody.ai/v1")
print(client.chat.completions.create(model="mirobody-flash", user="alice",
messages=[{"role": "user", "content": "How is my fasting glucose trending?"}]
).choices[0].message.content)

And a real agent — with your own tool — is ten. The openai-agents SDK talks to the Agent API with only a new base URL:

openai-agents SDK (10 lines)
from agents import Agent, ModelSettings, Runner, function_tool, set_default_openai_client, set_tracing_disabled
from openai import AsyncOpenAI
set_default_openai_client(AsyncOpenAI(
base_url="https://api.mirobody.ai/v1", api_key="mb_live_..."))
set_tracing_disabled(True)
@function_tool
def book_appointment(date: str) -> str:
"""Book a clinic appointment for the end user (ISO date)."""
return f"Booked: {date} 09:30, Dr. Chen"
agent = Agent(name="Health assistant", model="mirobody-flash", tools=[book_appointment],
model_settings=ModelSettings(extra_body={"user": "alice"}))
print(Runner.run_sync(agent, "Check my recent glucose; book a follow-up if it's trending up.").final_output)

Mirobody’s built-in tools read alice’s real data; when the model decides to book, it hands off to your function. See Function calling for the protocol underneath.

The console Playground follows the same flow: ① Ingest data → ② Auto-standardize → ③ Agent or Answers. Upload a file, inspect the extracted text or standardized records, and run either API without writing code.