Skip to content

Response Schema

All successful responses from POST /api/v1/biom/process and GET /api/v1/biom/retrieve return a StandardAPIResponse object with four top-level fields.

For annotated examples, see the Swagger UI at /apidocs.


StandardAPIResponse
├── data: BiometryReport (always present)
├── extra_data: ExtraReport | null (present for PK-capable devices)
├── metadata: ResponseMetadata (always present)
└── biompin: BiomPINInfo | null (present when BiomPIN was requested)

Core biometry data. Always present.

FieldTypeRequiredValues
device_nameenumYesSee Device names
manufacturerenumYesSee Manufacturers

All patient fields are optional — they may be null if not present in the source file.

FieldTypeDescription
namestring | nullAutomatically converted to all-caps initials for privacy (e.g., "John Douglas Doe""JDD")
idstring | nullPatient ID or medical record number
date_of_birthdate (ISO 8601) | nulle.g., "1965-03-15"
genderenum | null"Male" or "Female"

data.right_eye / data.left_eye — BiometricData

Section titled “data.right_eye / data.left_eye — BiometricData”

All measurement fields are optional (null if not measurable or not present in the source).

FieldUnitValid rangeDescription
ALmm14 – 40Axial length
ACDmm1 – 6Anterior chamber depth
K1_magnitudeD20 – 99Flat keratometry power
K1_axis°0 – 180K1 axis
K2_magnitudeD20 – 99Steep keratometry power
K2_axis°0 – 180K2 axis
WTWmm7 – 15White-to-white corneal diameter
LTmm0.1 – 7Crystalline lens thickness
CCTµm200 – 900Central corneal thickness
lens_statusenum | nullSee Lens status
post_refractiveenum | nullSee Post-refractive
keratometric_index1.330 – 1.338Index of refraction used for keratometry conversion (typically 1.3375)

Optional additional data. null for devices that don’t support posterior keratometry extraction.

FieldTypeDescription
notesstring | nullClinical notes or free-text annotations
posterior_keratometryPosteriorKeratometry | nullPK measurements (device-dependent)

Present only for devices that support PK extraction: Anterion, EyestarES900, IOLMaster700, MS39, PentacamAXL.

FieldTypeDescription
pk_device_nameenum | nullSource device for PK measurement — see PK devices
right_eyePosteriorKeratometryDataRight eye PK measurements
left_eyePosteriorKeratometryDataLeft eye PK measurements
FieldUnitValid rangeDescription
PK1_magnitudeD2 – 8Posterior flat keratometry power
PK1_axis°0 – 180PK1 axis
PK2_magnitudeD2 – 8Posterior steep keratometry power
PK2_axis°0 – 180PK2 axis

Provenance and version information. Always present.

FieldTypeDescription
schema_versionstringBiometryReport schema version (e.g., "1.0.0")
app_versionstringBiomAPI server version (e.g., "0.9.8.1")
extractionBiomAIMetadata | BiomDIRECTMetadataDiscriminated union — see below

metadata.extraction — discriminated union

Section titled “metadata.extraction — discriminated union”

The type is determined by method:

method valueTypeWhen
"BiomAI"BiomAIMetadataExtracted from PDF or image by Gemini LLM
"BiomDIRECT"BiomDIRECTMetadataManual entry, script, EHR export, or any non-LLM JSON
FieldTypeDescription
method"BiomAI" | "BiomDIRECT"Discriminator
timestampdatetime (ISO 8601)When the extraction was performed
filenamestring | nullOriginal filename of the uploaded file
FieldTypeDescription
byokbooltrue if the user supplied their own Gemini key
llmstringGemini model used (e.g., "gemini-flash-latest")
llm_api_metricsLLMApiUsageMetrics | nullToken usage from the Gemini API
llm_performanceLLMPerformanceMetricsTiming and retry counts
input_schema_versionstring | nullSchema version of the uploaded JSON on round-trip re-upload; null for fresh PDF/image extractions
FieldTypeDescription
prompt_token_countint | nullTotal input tokens (includes cached)
cached_content_token_countint | nullTokens served from cache
candidates_token_countint | nullOutput tokens generated
thoughts_token_countint | nullInternal thinking tokens (if thinking enabled)
total_token_countint | nullSum of all tokens
cache_hit_ratiofloat (0–1) | nullCached / total prompt tokens
FieldTypeDescription
llm_response_time_secondsfloatTime for the Gemini API call (seconds)
retry_attemptsintNumber of retries due to 429/503
total_retry_delay_secondsfloatTotal wait time spent on retries
FieldTypeDescription
input_schema_versionstringSchema version of the input payload (always populated)

Present when a BiomPIN was generated (biompin=true in the request). null otherwise.

FieldTypeDescription
pinstringFull PIN code: word-word-123456
expires_atstring (ISO 8601)When the PIN expires (default: 31 days from creation)
db_idstringDatabase instance identifier — use to detect stale history entries

ValueDeviceManufacturer
"Aladdin"AladdinTopcon
"Anterion"AnterionHeidelberg
"Argos"ArgosAlcon
"IOLMaster700"IOLMaster 700Zeiss
"LenstarLS900"Lenstar LS 900HaagStreit
"EyestarES900"Eyestar ES 900HaagStreit
"MS39"MS-39CSO
"OA-2000"OA-2000Tomey
"PentacamAXL"Pentacam AXLOculus
"Other"Unrecognized device

"Alcon", "CSO", "HaagStreit", "Heidelberg", "Oculus", "Tomey", "Topcon", "Zeiss", "Other"

ValueDescription
"Phakic"Natural crystalline lens present
"Phakic IOL"Natural lens present with an additional phakic IOL
"Pseudophakic"Natural lens replaced with IOL
"Aphakic"No lens present
ValueDescription
"None"No prior refractive surgery
"Myopic LVC"Myopic laser vision correction (LASIK, PRK, LASEK)
"Hyperopic LVC"Hyperopic laser vision correction
"Radial Keratotomy"Radial keratotomy

"Anterion", "EyestarES900", "Galilei", "IOLMaster700", "MS39", "Pentacam", "Other"