If making recipe to preserve, heat a large pot of water or canning pot to boiling. Set 2 pint jars inside pot to sterilize and heat. Set lids and rings aside.
Trim ends from onions. Cut into half or quarter moons, then slice thinly.
In a large pot, combine vinegar, water, sugar, and salt. Bring to a boil.
Once vinegar mixture is boiling, add onions and stir to combine. Reduce heat and simmer briefly.
In a small bowl, combine celery seed, red chile flakes, and peppercorns. Remove jars from hot water bath and divide spice mixture between them.
Pack hot onions into the jars. Pour brine into each jar, leaving 1/2 inch of space at the top of the jar. Using a chopstick, remove any bubbles in the jar by running it around the outside. Add more brine if necessary.
Wipe jar rims clean and apply lids and rings. If canning, lower into boiling water bath. Process for 10 minutes, then remove carefully and let rest for 24 hours before moving. If jars are not sealed, store in the fridge.
Notes
Adapted slightly from Food in Jars.
Makes 2 pints.
You can skip the water bath by just putting the onions into jars and moving to the fridge once cooled. Be sure to rinse the jars with hot water first, since you are putting a hot liquid into them.