POST
/
v1
/
processors
/
{processor_id}
/
submit
from uiform import UiForm, MIMEData

uiclient = UiForm()

# Load document as MIMEData
with open("invoice.pdf", "rb") as f:
    document = MIMEData.from_bytes(f.read(), filename="invoice.pdf")

completion = uiclient.processors.submit(
    id="prc_01G34H8J2K",
    document=document
)

# Access extracted data
extracted_data = completion.choices[0].message.parsed
print(extracted_data)
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1744316542,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "{\"invoice_number\": \"INV-42\", \"total_amount\": 123.45}",
        "parsed": {
          "invoice_number": "INV-42", 
          "total_amount": 123.45
        }
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 35,
    "total_tokens": 1285
  },
  "likelihoods": {
    "invoice_number": 0.95,
    "total_amount": 0.87
  },
  "extraction_id": "ext_1234567890"
}
from uiform import UiForm, MIMEData

uiclient = UiForm()

# Load document as MIMEData
with open("invoice.pdf", "rb") as f:
    document = MIMEData.from_bytes(f.read(), filename="invoice.pdf")

completion = uiclient.processors.submit(
    id="prc_01G34H8J2K",
    document=document
)

# Access extracted data
extracted_data = completion.choices[0].message.parsed
print(extracted_data)
{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "created": 1744316542,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "{\"invoice_number\": \"INV-42\", \"total_amount\": 123.45}",
        "parsed": {
          "invoice_number": "INV-42", 
          "total_amount": 123.45
        }
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1250,
    "completion_tokens": 35,
    "total_tokens": 1285
  },
  "likelihoods": {
    "invoice_number": 0.95,
    "total_amount": 0.87
  },
  "extraction_id": "ext_1234567890"
}

Authorizations

Api-Key
string
header
required

Headers

Idempotency-Key
string | null
Idempotency-ForceRefresh
boolean
default:false
OpenAI-Api-Key
string | null
Anthropic-Api-Key
string | null
Gemini-Api-Key
string | null
XAI-Api-Key
string | null

Path Parameters

processor_id
string
required

Body

multipart/form-data

Response

200
application/json

Successful Response

The response is of type object.