> ## Documentation Index
> Fetch the complete documentation index at: https://medlogprotocol.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a new internal model artifact



## OpenAPI

````yaml /api-reference/openapi.yaml post /event/internal-artifact
openapi: 3.0.4
info:
  title: MedLog API Specification
  description: >
    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:

    - [MedLog repository](https://github.com/mims-harvard/medlog)
  contact:
    email: anoori@college.harvard.edu
  license:
    name: MIT
    url: https://mit-license.org/
  version: 0.0.1
servers:
  - description: SwaggerHub API Auto Mocking
    url: https://virtserver.swaggerhub.com/harvard-647/MedLog/0.0.1
  - url: https://medlog.swagger.io/api/v3
security:
  - ApiKeyAuth: []
tags:
  - name: Events
    description: Write-once event logging endpoints
paths:
  /event/internal-artifact:
    post:
      tags:
        - Events
      summary: Record a new internal model artifact
      operationId: postInternalArtifact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InternalArtifactEvent'
      responses:
        '201':
          description: Event accepted
        '400':
          description: Bad request. Invalid payload or missing fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized. Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden. Insufficient permissions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    InternalArtifactEvent:
      allOf:
        - $ref: '#/components/schemas/BaseEvent'
        - type: object
          required:
            - artifact
          properties:
            artifact:
              $ref: '#/components/schemas/Artifact'
    Error:
      type: object
      required:
        - message
      properties:
        message:
          type: string
        code:
          type: string
        details:
          type: object
    BaseEvent:
      type: object
      required:
        - event_id
        - timestamp
        - medlog_version
        - system_metadata
      properties:
        event_id:
          type: string
          format: uuid
          description: Unique ID for this event
        run_id:
          type: string
          format: uuid
          description: Constant across all events in the same inference run
        parent_event_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the event this one expands on (if any)
        timestamp:
          type: string
          format: date-time
        medlog_version:
          type: string
          example: '1.0'
        system_metadata:
          $ref: '#/components/schemas/SystemMetadata'
    Artifact:
      type: object
      required:
        - artifact_type
        - artifact_uri
      properties:
        artifact_type:
          type: string
          enum:
            - text_chunk
            - reasoning_trace
            - tool_call
            - explanation
            - other
        artifact_uri:
          type: string
          format: uri
        mime_type:
          type: string
        description:
          type: string
    SystemMetadata:
      type: object
      properties:
        hostname:
          type: string
        app_name:
          type: string
        proc_id:
          type: string
        latency_ms:
          type: integer
          format: int32
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Provide a valid API key via the X-API-Key header.

````