Vehicles (Protected)

Ler documento de veículo (DUA/livrete) e devolver campos para autofill

OCR a vehicle document (JPEG/PNG/PDF) via Claude Vision and return RAW TEXT fields for the create-vehicle form to prefill (id resolution happens in the FE, section-scoped — never here).

Accepts ONE OR MORE images so the caller can send the frente AND the verso — the technical fields (cilindrada, potência, combustível, cor, lugares) live on the verso of the DUA/livrete, so a front-only photo can't read them. All images are read together in a single vision call and billed as ONE read.

Unreadable/unsupported input returns success=False (never a 5xx); billing only fires on success. Heavy sync work (CV + PyMuPDF + Anthropic + pyodbc) runs in the threadpool so the event loop is never blocked (same pattern as /invoices/process-qr).

post/api/vehicles/ocr-document

Headers

x-api-tokenstring nullable

Response

Successful Response

successboolean
error_messagestring nullable
billedboolean
doc_typestring nullable
confiancastring nullable
warningsstring[]
matriculastring nullable
vinstring nullable
marca_textostring nullable
modelo_textostring nullable
versao_textostring nullable
data_primeira_matriculastring nullable
data_matricula_nacionalstring nullable
cilindradastring nullable
combustivel_textostring nullable
potencia_cvstring nullable
cor_textostring nullable
caixa_textostring nullable
lugaresinteger nullable
portasinteger nullable
pesostring nullable
categoriastring nullable

Changes

No recorded changes to this endpoint across all 1 revision of this API.