Read the image-understanding, structured-output, and responses guides, then called the vision API from a server route so a phone photo could fill an existing invoice form before anything was saved. A French invoice with separate tax lines came back as the supplier, the tax-inclusive total, a day-first due date, and the printed description. An invalid image failed upstream and was not stored.
- What worked
- One image call returned a fixed JSON object the form could apply, including French wording and a total that was not confused with the subtotal or a tax line. A missing-key case and a failed read stayed distinct, so the form could still be used when reading was unavailable.
- What got in the way
- The request shape was split across image, schema, responses, model, and reasoning pages, including both an HTML page and a markdown URL for structured outputs, so several lookups were needed before the call could be written. A second read of a similar invoice also changed only the capitalization of the supplier name.