---
updatedAt: 2026-09-04T01:56:54.000Z
agentTools:
  projectIndex: https://developer.tiliter.com/llms.txt
---

# Run Inference (v1 - Latest)

Extract printed and handwritten prescriptions into a pharmacist-reviewable record. Submit an image to analyze using the Prescription Extractor agent.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Vision Agent Platform API",
    "description": "Backend API for Vision Agent Platform with multi-provider LLM integration",
    "version": "1.0.0"
  },
  "paths": {
    "/api/v2/agents/prescription-extractor/v1/inference": {
      "post": {
        "tags": [
          "Prescription Extractor"
        ],
        "summary": "Run Inference (v1 - Latest)",
        "operationId": "inner_api_v2_agents_prescription_extractor_v1_inference_post",
        "parameters": [
          {
            "name": "X-API-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "X-API-Key",
              "description": "Your API key for authentication"
            },
            "description": "Your API key for authentication"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InferenceRequestModel_prescription-extractor-v1"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InferenceResponse_PrescriptionExtractorOutputSchema_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "description": "Extract printed and handwritten prescriptions into a pharmacist-reviewable record. Submit an image to analyze using the Prescription Extractor agent."
      }
    }
  },
  "components": {
    "schemas": {
      "MetaData": {
        "properties": {
          "agent_id": {
            "type": "string",
            "title": "Agent Id",
            "description": "Id of the agent that produced this response."
          },
          "request_id": {
            "type": "string",
            "title": "Request Id",
            "description": "Unique per-request id for tracing/logging."
          },
          "reference_files_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference Files Count",
            "description": "Number of reference files supplied (if any)"
          }
        },
        "type": "object",
        "required": [
          "agent_id",
          "request_id"
        ],
        "title": "MetaData"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "InferenceRequestModel_prescription-extractor-v1": {
        "properties": {
          "input_file_b64": {
            "type": "string",
            "maxLength": 1468006,
            "format": "base64",
            "contentMediaType": "application/octet-stream",
            "title": "Input File B64",
            "description": "Base 64 encoded input file data. Must be one of the following types: ['Image', 'PDF']."
          }
        },
        "type": "object",
        "required": [
          "input_file_b64"
        ],
        "title": "InferenceRequestModel_prescription-extractor-v1"
      },
      "InferenceResponse_PrescriptionExtractorOutputSchema_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "description": "True when the agent completed successfully, false otherwise."
          },
          "metadata": {
            "$ref": "#/components/schemas/MetaData",
            "description": "Tracing metadata about the request."
          },
          "result": {
            "$ref": "#/components/schemas/PrescriptionExtractorOutputSchema",
            "description": "Agent-specific structured output. Always present on success; failures raise HTTPException rather than returning success=false."
          },
          "processed_image_b64": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Processed Image B64",
            "description": "Base64-encoded processed image (e.g., with faces blurred) when privacy features are enabled"
          }
        },
        "type": "object",
        "required": [
          "success",
          "metadata",
          "result"
        ],
        "title": "InferenceResponse[PrescriptionExtractorOutputSchema]"
      },
      "PrescriptionExtractorOutputSchema": {
        "properties": {
          "verbatim_transcription": {
            "$ref": "#/components/schemas/VerbatimTranscriptionStr",
            "description": "Complete visible prescription text transcribed as written, including printed and handwritten text."
          },
          "patient_name": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PatientNameStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Patient name exactly as visible, or null."
          },
          "patient_date_of_birth": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PatientDOBStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Patient date of birth exactly as visible; do not normalize uncertain dates."
          },
          "prescriber_name": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrescriberNameStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prescriber name exactly as visible, or null."
          },
          "prescriber_identifier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PrescriberIdentifierStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prescriber registration, provider, or clinic identifier exactly as visible, or null."
          },
          "issue_date": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IssueDateStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prescription issue date exactly as visible, or null."
          },
          "expiry_date": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExpiryDateStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Prescription expiry date exactly as visible, or null."
          },
          "medications": {
            "items": {
              "$ref": "#/components/schemas/PrescriptionMedication"
            },
            "type": "array",
            "title": "Medications",
            "description": "Medication orders found on the prescription, kept separate.",
            "default": []
          },
          "ambiguities": {
            "items": {
              "$ref": "#/components/schemas/PrescriptionAmbiguity"
            },
            "type": "array",
            "title": "Ambiguities",
            "description": "Material visual ambiguities requiring pharmacist review.",
            "default": []
          },
          "review_required": {
            "type": "boolean",
            "title": "Review Required",
            "description": "Whether a pharmacist must review before relying on this extraction."
          },
          "summary": {
            "type": "string",
            "title": "Summary",
            "description": "Concise extraction summary, including the review requirement."
          }
        },
        "type": "object",
        "required": [
          "verbatim_transcription",
          "patient_name",
          "patient_date_of_birth",
          "prescriber_name",
          "prescriber_identifier",
          "issue_date",
          "expiry_date",
          "review_required",
          "summary"
        ],
        "title": "PrescriptionExtractorOutputSchema"
      },
      "VerbatimTranscriptionStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Complete visible prescription text transcribed as written, including printed and handwritten text."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for VerbatimTranscriptionStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "VerbatimTranscriptionStr"
      },
      "PatientNameStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Patient name exactly as visible, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for PatientNameStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "PatientNameStr"
      },
      "PatientDOBStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Patient date of birth exactly as visible; do not normalize uncertain dates."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for PatientDOBStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "PatientDOBStr"
      },
      "PrescriberNameStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Prescriber name exactly as visible, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for PrescriberNameStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "PrescriberNameStr"
      },
      "PrescriberIdentifierStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Prescriber registration, provider, or clinic identifier exactly as visible, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for PrescriberIdentifierStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "PrescriberIdentifierStr"
      },
      "IssueDateStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Prescription issue date exactly as visible, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for IssueDateStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "IssueDateStr"
      },
      "ExpiryDateStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Prescription expiry date exactly as visible, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for ExpiryDateStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "ExpiryDateStr"
      },
      "PrescriptionMedication": {
        "properties": {
          "medication_name": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MedicationNameStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Medication name exactly as visible. Null if any material character is ambiguous."
          },
          "medication_name_normalized": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MedicationNameNormalizedStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "The canonical or standard form of the medication in medication_name."
          },
          "normalization_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Normalization Reason",
            "description": "Rationale for choice of the chosen normalized medication name, or null if no normalized name was found."
          },
          "strength": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/StrengthStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Strength exactly as written, or null."
          },
          "dosage_form": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DosageFormStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Dosage form exactly as written, or null."
          },
          "quantity": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QuantityStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Quantity exactly as written, or null."
          },
          "directions": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DirectionsStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Directions/Sig exactly as written, or null."
          },
          "route": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RouteStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Route exactly as written, or null."
          },
          "frequency": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FrequencyStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Frequency exactly as written, or null."
          },
          "duration": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DurationStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Duration exactly as written, or null."
          },
          "num_refills": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/NumRefillsStr"
              },
              {
                "type": "null"
              }
            ],
            "description": "Refill instruction/count exactly as written, or null."
          },
          "requires_review": {
            "type": "boolean",
            "title": "Requires Review",
            "description": "True if any non null field has low confidence, or if critical fields are absent or null."
          }
        },
        "type": "object",
        "required": [
          "medication_name",
          "medication_name_normalized",
          "normalization_reason",
          "strength",
          "dosage_form",
          "quantity",
          "directions",
          "route",
          "frequency",
          "duration",
          "num_refills",
          "requires_review"
        ],
        "title": "PrescriptionMedication"
      },
      "MedicationNameStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Medication name exactly as visible. Null if any material character is ambiguous."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for MedicationNameStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "MedicationNameStr"
      },
      "MedicationNameNormalizedStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The canonical or standard form of the medication in medication_name."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for MedicationNameNormalizedStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "MedicationNameNormalizedStr"
      },
      "StrengthStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Strength exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for StrengthStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "StrengthStr"
      },
      "DosageFormStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Dosage form exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for DosageFormStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "DosageFormStr"
      },
      "QuantityStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Quantity exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for QuantityStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "QuantityStr"
      },
      "DirectionsStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Directions/Sig exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for DirectionsStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "DirectionsStr"
      },
      "RouteStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Route exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for RouteStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "RouteStr"
      },
      "FrequencyStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Frequency exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for FrequencyStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "FrequencyStr"
      },
      "DurationStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Duration exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for DurationStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "DurationStr"
      },
      "NumRefillsStr": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text",
            "description": "Refill instruction/count exactly as written, or null."
          },
          "confidence": {
            "type": "number",
            "maximum": 1,
            "minimum": 0,
            "title": "Confidence",
            "description": "Visual transcription confidence (0–1) for NumRefillsStr"
          }
        },
        "type": "object",
        "required": [
          "text",
          "confidence"
        ],
        "title": "NumRefillsStr"
      },
      "PrescriptionAmbiguity": {
        "properties": {
          "field": {
            "type": "string",
            "title": "Field",
            "description": "Affected structured field path."
          },
          "observed_text": {
            "type": "string",
            "title": "Observed Text",
            "description": "Exact ambiguous mark or text as it appears."
          },
          "alternatives": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Alternatives",
            "description": "Plausible visual readings only; do not use clinical inference."
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Why the transcription failed"
          }
        },
        "type": "object",
        "required": [
          "field",
          "observed_text",
          "alternatives",
          "reason"
        ],
        "title": "PrescriptionAmbiguity"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.ai.vision.tiliter.com",
      "description": "Production API"
    }
  ],
  "tags": [
    {
      "name": "Prescription Extractor",
      "description": "Extract printed and handwritten prescriptions into a pharmacist-reviewable record."
    }
  ]
}
```