This question gets asked with the roof already built, which is why the answer needs to come before the workarounds.
There are two separate hazards here and they have different thresholds. One of them is invisible and it is the one that hurts people.
Hazard one: carbon monoxide, and it comes first
Every fire pit, on every fuel, produces carbon monoxide. Wood, propane, natural gas, gel: all of them. Outdoors, it disperses. Under a roof, it does not disperse the same way, and the more enclosed the space, the less it disperses.
The US Consumer Product Safety Commission's guidance on fuel-burning appliances is consistent and blunt about the class of situations that kills people: burning fuel in enclosed or partially enclosed spaces. Garages with the door open, tents, screened porches, and covered areas are named repeatedly in that guidance precisely because people believe partially enclosed is the same as outdoors. It is not.
Carbon monoxide is colorless and odorless. With a wood fire, smoke gives you a warning and sends you away. With a clean-burning gas or smokeless appliance, that warning is absent while the carbon monoxide is not. That is worth sitting with, because it means the appliances that feel safest under a roof are the ones that remove the signal.
So the first question is not about heat or clearances. It is: how enclosed is this space, really?
The spectrum, from clearly no to conditionally maybe
A solid-roofed structure with walls, or a screened porch. No. This is an enclosed space with a fuel-burning appliance in it, whatever the fuel and whatever the ventilation feels like. Screens do not ventilate; they keep insects out.
A solid-roofed patio, open on three sides. Substantially better ventilated and still a trapped-heat ceiling directly above a fire. Most fire pit manuals prohibit use under any overhead structure, and that prohibition is doing two jobs at once. This is the case where people most often assume it is fine, and it is the case where the manual most often says otherwise.
A pergola with open slats. Better again for airflow, and still a combustible structure directly overhead, usually made of wood, usually within a few feet of the flame. Slats do not remove the ignition problem, and many pergolas have fabric or vinyl canopies fitted at some point in their life, which reintroduce everything.
A gazebo with a solid roof. Treat as a small enclosed structure with a ceiling. The roof material is usually combustible or, if it is a soft-top, both combustible and directly above the heat plume.
A retractable awning. Fabric, over a fire. No.
Fully open sky, nothing overhead. This is what a fire pit is designed for.
Hazard two: the roof itself, and the plume
Independent of carbon monoxide, a fire pit sends a column of hot gas straight up. Whatever is above it receives that column continuously for as long as the fire burns.
The materials people build patio covers from are wood, vinyl, polycarbonate, fabric and metal on a wooden frame. Most of them are combustible. Vinyl and polycarbonate deform at temperatures well below combustion, so the first sign is usually sagging or warping rather than fire, and by then it has been too hot for too long.
Vertical clearance is a separate requirement from horizontal clearance, it is stated in every fire pit manual, and it is the number that this question turns on. A pit that satisfies its distance from the house can be well inside its overhead requirement.
What the manufacturers and the code say
Your fire pit's manual. Almost every one specifies a minimum vertical clearance and many prohibit use under any overhead structure. That sentence, if it is in your manual, ends the question for your appliance.
Your local fire authority. Codes commonly restrict fires under overhangs and on covered decks, and the rule may differ by fuel. The non-emergency fire department line answers this.
Your insurer. Worth a thought. A loss caused by an installation the appliance's own manual prohibits is a conversation nobody wants to have.
The versions that do exist
Some outdoor heating appliances are designed and listed for use under a covered structure, with a specified vertical clearance and specified ventilation conditions. Certain gas appliances fall into this category, as do some patio heaters.
The distinguishing feature is that the manufacturer says so, in the manual, for that model, with the conditions attached. That is the entire test. An appliance that is approved for covered use will tell you; one that is not will also tell you, in the clearance section.
Do not generalize from one product to another, and do not generalize from a patio heater to a fire pit. They are different appliances with different plumes and different listings.
If the roof is already there and you still want a fire
Site the pit outside the covered footprint. Not at its edge. Outside it, with the manual's vertical clearance satisfied by open sky. The seating can stay under the cover; the fire does not have to be where the chairs are.
Reconsider what you actually want. If the goal was warmth under a cover on a cold evening, a fire pit is a poor heater and the appliance category that solves that is a patio heater, some of which are listed for covered use with specified clearance. That is a different purchase and a better fit for the problem.
If it must be under cover, that is a conversation with a professional, not with a web page. A permanently installed gas appliance in a covered outdoor space involves gas fitting, which is licensed work, and clearance and ventilation requirements that are set by code rather than preference.
The thing nobody selling a pergola will write
Pergolas, gazebos and patio covers are sold with photographs of a fire pit underneath them. That imagery is why this question exists in the volume it does.
Nobody in that supply chain has any reason to publish the sentence "do not put a fire under this". So it falls to somebody who sells neither, which is the position this site is in.
A roof over a fire is a different appliance category, and if your manual does not name your situation, the answer is no.
Frequently asked questions
Can you use a fire pit under a covered patio? If your appliance's manual does not name your situation, the answer is no. Most fire pit manuals prohibit use under any overhead structure, a solid roof is a trapped-heat ceiling directly above a fire, and carbon monoxide does not disperse under a roof the way it does under open sky.
Is a pergola with open slats different? Better for airflow, and still a combustible structure directly overhead, usually wood, usually within a few feet of the flame. Slats do not remove the ignition problem, and a fabric or vinyl canopy fitted later reintroduces everything.
Are any appliances approved for use under cover? Some are designed and listed for it, with a specified vertical clearance and specified ventilation conditions, including certain gas appliances and some patio heaters. The entire test is that the manufacturer says so, in the manual, for that model, with the conditions attached. Do not generalize from one product to another.
Is a gas or smokeless fire pit safer under a roof than a wood one? No. Every fuel produces carbon monoxide, and with a clean-burning appliance the smoke warning is absent while the carbon monoxide is not. The appliances that feel safest under a roof are the ones that remove the signal.
What are the signs of carbon monoxide exposure? Headache, dizziness, nausea or confusion during or after use. Treat it as a possible carbon monoxide exposure, get everyone into fresh air, and seek medical advice.
Yard Insight has not used a fire pit under a covered patio, pergola or gazebo, and this article makes no claim otherwise. No clearance figure, ventilation rate or carbon monoxide concentration is stated above; those come from your appliance's manual and your local fire authority. If anyone in the space develops headache, dizziness, nausea or confusion during or after use, treat it as a possible carbon monoxide exposure, get into fresh air, and seek medical advice.