Image Information Extraction
Upload an image and a prompt, and get the structured extraction result.
Authorization
- Security Scheme Type: http
- HTTP Authorization Scheme: Bearer API_key,Used to verify account information, can be viewed in Project Management > API Key .
Request Header
Request body is form data. Usemultipart/form-datato upload fields and file.
Available options:multipart/form-data
Request Bodymultipart/form-data
model string Required
Model ID. Current available value:u1-ocr-extract
sceneenum<string>
- general:General scene (invoice/receipt/reimbursement/cost list extraction and reconciliation).
- medical:Medical scene (medical records/test reports/prescriptions/cost statements/charge lists and detailed expense document-card verification).
image file Required
Image file to be extracted.
- Supported formats: JPG, JPEG, PNG, BMP
- Size limit: ≤ 10MB
prompt string Required
Prompt used to guide the model to extract specific information.
Example:Please extract the information from the image using the following schema: {"invoice_no":"Invoice Number","date":"Invoice Date","items":[{"name":"Item Name","total":"Amount"}]}
Response Body Structure
contentstring
usageobject
usage.prompt_tokensinteger
usage.completion_tokensinteger
usage.total_tokensinteger
base_respobject
base_resp.status_codeinteger
- 0, Success
- 100001, Missing required
- 261001, Invalid image format. Only JPG, JPEG, PNG, BMP are supported
- 261002, Image size exceeds 10MB limit
- 261003, Image corrupted or cannot be parsed
- 261101, Upstream model timeout
- 261999, Internal system error
base_resp.status_msgstring