Let $O$ and $I$ be the circumcenter and incenter of triangle $ABC$. The perpendicular from $I$ to $OI$ meets $AB$ and the external bisector of angle $C$ at points $X$ and $Y$ respectively. In what ratio does $I$ divide the segment $XY$?
1. **Define the problem and setup:**
   - Let \( O \) be the circumcenter and \( I \) be the incenter of triangle \( ABC \).
   - The perpendicular from \( I \) to \( OI \) meets \( AB \) at \( X \) and the external bisector of angle \( C \) at \( Y \).
   - We need to find the ratio in which \( I \) divides the segment \( XY \).

2. **Claim and initial approach:**
   - We claim that the ratio is \( 1:2 \).
   - Let \( \ell \) be the line through \( I \) perpendicular to \( OI \).

3. **Consider the excentral triangle:**
   - Let \( I_A, I_B, I_C \) be the excenters of triangle \( ABC \).
   - Dilate points \( A, B, X \) to \( A', B', X' \) about \( I \) with a ratio of \( 2 \).

4. **Application of Butterfly Theorem:**
   - We need to show that \( IX' = IY \).
   - By the Butterfly Theorem, in the cyclic quadrilateral \( A', B', I_B, I_A \), \( I \) bisects the intercepts of the line \( \ell \) with the circle \( (I_A I_B I_C) \).

5. **Conclusion from Butterfly Theorem:**
   - Since \( I \) bisects the intercepts, it follows that \( I \) divides \( XY \) in the ratio \( 1:2 \).

6. **Verification using complex numbers and inversion:**
   - Let \( DEF \) be the intouch triangle of \( ABC \).
   - Let \( C' \) be a point on the ray \( CI \) such that \( CI = 2C'I \).
   - Prove that line \( OI \) is tangent to the circumcircle of triangle \( IFC' \).

7. **Inversion about point \( I \):**
   - Consider an inversion about point \( I \) which fixes the incircle.
   - This inversion sends \( C \) to the midpoint \( F_1 \) of \( DE \) and fixes \( F \).
   - Point \( C' \) is mapped to a point \( T \) on the ray \( F_1I \) beyond \( I \) so that \( IT = 2IF_1 \).

8. **Using complex numbers:**
   - Let \( I = 0 \), \( D = d \), \( E = e \), \( F = f \) with modulus \( 1 \).
   - Let \( O' \) be the orthocenter of triangle \( DEF \).
   - Points \( I, O, O' \) are collinear.
   - Notice that \( T = -(e + d) \).

9. **Direction of lines:**
   - The direction of \( FT \) is \( f - (-(e + d)) = d + e + f \).
   - The direction of \( IO' \) is also \( d + e + f \).

10. **Conclusion from direction:**
    - Since \( FT \) and \( IO' \) have the same direction, the claim holds.
    - Let \( (IFC') \) meet \( AB \) again at \( X' \).
    - We see that \( \angle X'FI = \angle OIX' = 90^\circ \).
    - Therefore, \( X' = X \).

11. **Final ratio:**
    - Since \( I \) divides \( XY \) in the ratio \( 1:2 \), the final answer is confirmed.

The final answer is \( \boxed{ 1:2 } \).