Autotrophs, also known as producers, are organisms that can capture energy from sunlight or chemicals and use it to produce their own food from inorganic compounds through photosynthesis or chemosynthesis. Heterotrophs, also known as consumers, are organisms that obtain energy by consuming other organisms and rely on the food chain and food web for energy transfer. Energy flows in one direction through an ecosystem from the sun or inorganic compounds to producers, then to various consumers in a less efficient trophic level transfer.