This paper presents a case study on the first in-line application of AI-based image analysis for real-time pharmaceutical particle size measurement in a continuous milling process. An AI-based imaging system, which utilises a rigid endoscope, was tested for the real-time particle size measurement of solid NaCl powder used as a model API in the range of 200–1000 µm. After creating a dataset containing annotated images of NaCl particles, it was used to train an AI model for detecting particles and measuring their size. The developed system could analyse overlapping particles without dispersing air, thus broadening its applicability. The performance of the system was evaluated by measuring pre-sifted NaCl samples with the imaging tool, after which it was installed into a continuous mill for in-line particle size measurement of a milling process. By analysing ∼100 particles/s, the system was able to accurately measure the particle size of sifted NaCl samples and detect particle size reduction when applied in the milling process. The Dv50 values and PSDs measured real-time with the AI-based system correlated well with the reference laser diffraction measurements (<6% mean absolute difference over the measured samples). The AI-based imaging system shows great potential for in-line particle size analysis, which, in line with the latest pharmaceutical QC trends, can provide valuable information for process development and control.