MedLog API Specification (0.0.1)

Download OpenAPI specification:

MedLog is a protocol for event-level logging of clinical AI. Any time an AI model is invoked to interact with a human, interface with another algorithm, or act independently, a MedLog record is created. This record consists of nine core fields: model, user, target, inputs, artifacts, outputs, outcomes, metadata, and feedback, providing a structured and consistent record of model activity. The MedLog protocol can catalyze the development of new databases and software to store and analyze MedLog records. Realizing this vision would enable continuous surveillance, auditing, and iterative improvement of medical AI – including, when needed, detailed traces for complex, agentic, or multi-stage workflows – laying the foundation for a new form of AI-centric digital epidemiology.

Some useful links:

Events

Write-once event logging endpoints

Record the beginning of an inference run

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
event_id
required
string <uuid>

Unique ID for this event

run_id
string <uuid>

Constant across all events in the same inference run

parent_event_id
string or null <uuid>

ID of the event this one expands on (if any)

timestamp
required
string <date-time>
medlog_version
required
string
required
object (SystemMetadata)
required
object (ModelInstance)
required
object (UserIdentity)
required
object (TargetIdentity)
required
object (Inputs)

Responses

Request samples

Content type
application/json
{
  • "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
  • "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
  • "parent_event_id": "244d15ba-4793-4516-8d39-3fb250c8abf5",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "medlog_version": "1.0",
  • "system_metadata": {
    },
  • "model_instance": {},
  • "user_identity": {
    },
  • "target_identity": {
    },
  • "inputs": {}
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": "string",
  • "details": { }
}

Record a new internal model artifact

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
event_id
required
string <uuid>

Unique ID for this event

run_id
string <uuid>

Constant across all events in the same inference run

parent_event_id
string or null <uuid>

ID of the event this one expands on (if any)

timestamp
required
string <date-time>
medlog_version
required
string
required
object (SystemMetadata)
required
object (Artifact)

Responses

Request samples

Content type
application/json
{
  • "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
  • "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
  • "parent_event_id": "244d15ba-4793-4516-8d39-3fb250c8abf5",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "medlog_version": "1.0",
  • "system_metadata": {
    },
  • "artifact": {
    }
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": "string",
  • "details": { }
}

Record content shown to a human user

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
event_id
required
string <uuid>

Unique ID for this event

run_id
string <uuid>

Constant across all events in the same inference run

parent_event_id
string or null <uuid>

ID of the event this one expands on (if any)

timestamp
required
string <date-time>
medlog_version
required
string
required
object (SystemMetadata)
required
object (HumanOutput)

Responses

Request samples

Content type
application/json
{
  • "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
  • "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
  • "parent_event_id": "244d15ba-4793-4516-8d39-3fb250c8abf5",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "medlog_version": "1.0",
  • "system_metadata": {
    },
  • "output": {}
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": "string",
  • "details": { }
}

Attribute a downstream patient or system outcome to a prior inference

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
event_id
required
string <uuid>

Unique ID for this event

run_id
string <uuid>

Constant across all events in the same inference run

parent_event_id
string or null <uuid>

ID of the event this one expands on (if any)

timestamp
required
string <date-time>
medlog_version
required
string
required
object (SystemMetadata)
required
object (Outcome)

Responses

Request samples

Content type
application/json
{
  • "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
  • "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
  • "parent_event_id": "244d15ba-4793-4516-8d39-3fb250c8abf5",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "medlog_version": "1.0",
  • "system_metadata": {
    },
  • "outcome": {
    }
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": "string",
  • "details": { }
}

Record explicit user feedback

Authorizations:
ApiKeyAuth
Request Body schema: application/json
required
event_id
required
string <uuid>

Unique ID for this event

run_id
string <uuid>

Constant across all events in the same inference run

parent_event_id
string or null <uuid>

ID of the event this one expands on (if any)

timestamp
required
string <date-time>
medlog_version
required
string
required
object (SystemMetadata)
required
object (Feedback)

Responses

Request samples

Content type
application/json
{
  • "event_id": "a7a26ff2-e851-45b6-9634-d595f45458b7",
  • "run_id": "dded282c-8ebd-44cf-8ba5-9a234973d1ec",
  • "parent_event_id": "244d15ba-4793-4516-8d39-3fb250c8abf5",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "medlog_version": "1.0",
  • "system_metadata": {
    },
  • "feedback": {
    }
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "code": "string",
  • "details": { }
}