Ten-year-old Oliver Bakh and his mom, Annie, move into a cramped seventh-floor walk-up in Manhattan, left to them by Oliver's recently deceased great-aunt Barb. The apartment brims with framed butterfly specimens and a taxidermied cat named Raymond. Oliver and Annie have spent the past year bouncing between relatives' homes after Oliver's father died, never welcome for long. Annie insists this time is different: The apartment is theirs. Oliver, wary of attachment, focuses on unpacking his most prized possession, his dad's handwritten recipe notebook labeled "The Plan," containing the menu for a restaurant called Three Plums that his father dreamed of opening. Oliver intends to open it himself someday.
While exploring, Oliver notices a brass mail slot set into the interior kitchen wall with nothing behind it but plaster. Their neighbor, Eliza Appleblood, a tall, ring-laden older woman in a green robe, introduces herself with aggressive friendliness. Oliver starts at Whittle Academy, an elite private school where Annie works as a custodian to discount his tuition. His cobbled-together uniform and cheap sneakers make him conspicuous among wealthy classmates. He clashes with Lucas Morgan, an aggressive, wealthy seventh grader repeating fifth-grade science. A fierce fourth grader named Colette Leung approaches Oliver at lunch, fascinated that he cooks his own food, but their budding friendship is tested when Lucas mocks Oliver's clothes and throws his food away.
Frustrated with their poverty, Oliver scribbles a wish for pizza and shoves it through the mail slot. A peppermint-scented typed reply appears with instructions that change each time he looks away. Following the steps triggers a building-wide power outage and a chain reaction that deposits a confused pizza delivery man at their door. Oliver learns the slot grants wishes through step-by-step instructions. He wishes not to be beaten up by Lucas; the letter guides him to plug every water fountain at school with gum except one near the gym. A sick student contaminates the unblocked fountain, and Lucas drinks from it. When the anticipated fight happens, a sluggish Lucas vomits on his own sneakers after Oliver's single defensive punch.
Colette grows suspicious after Lucas's humiliation and follows Oliver home, arriving with Jimmy, her live-in bodyguard and caretaker. Oliver confides in her and demonstrates the mail slot. When Colette tries to insert her own wish, the paper will not go through; the slot works only for the apartment's owner. Their partnership forms: Oliver makes the wishes, and Colette helps carry out the instructions. He wishes for designer sneakers, and the letter's chain of events leaves a pair of unreleased high-tops on the sidewalk. Visiting Colette's enormous, sterile penthouse, Oliver discovers that despite her wealth, she is profoundly lonely, with absent parents and Jimmy as her closest relationship. Colette suggests Oliver could wish for his dad to come back, sparking a powerful hope.
Back home, Oliver catches Eliza crouched before the mail slot, trying to insert her own wish. She asks Oliver to mail it: She wants to be "supreme omnipotent overlord of the entire planet Earth." Oliver tears it up. Investigating Aunt Barb's belongings in the basement, he finds scrapbooks linking Barb's wishes to newspaper clippings about wars, extinctions, and disasters. He acknowledges the possible consequences but rationalizes that his small wishes are harmless.
His wishes escalate. He obtains perfect grades, gadgets, and experiences, sharing acquisitions at school to build social capital. He stops cooking from his dad's recipe book. When Lucas returns from a luxury hospital stay, Oliver's envy intensifies, recalling how his own father died because he could not afford medical care. His remaining guilt evaporates. Tensions mount at home: Annie refuses a wished-for job offer, wants to turn a wished-for diamond necklace in to the police, and tells Oliver he is acting different. He shuts her out.
Oliver wishes for a stealth fighter jet and flies it over Manhattan with Colette, but the thrill curdles when he wants to buzz the school to impress Lucas. He cruelly tells Colette she is only his friend because no one else will talk to her. They crash-land and part bitterly. Determined to bring his father back, Oliver writes a carefully worded wish and mails it. Before he can act on the instructions, Annie comes home in a panic: Child Protective Services has received a report alleging she neglects Oliver. Eliza admits she fabricated the reports, leveraging her social services position to force Annie into selling the apartment. Annie agrees to sign the contract, but Oliver snatches it, locks himself inside, and scrawls "HELP ME RIGHT NOW" on the back, shoving it through the slot. Eliza smashes through the fire escape window. The slot replies: "STICK YOUR HAND IN THE SLOT." Oliver plunges his hand in and is sucked through the wall. Eliza grabs his ankle and is pulled along.
They land in the Benevolence Bureau, an interdimensional facility that processes human wishes. A mail clerk named Frank, a small dinosaur-like creature with an enormous head, explains that the Bureau's workers calculate the precise chain of real-world events needed to fulfill each wish. The green glowing substance powering the facility, which Oliver mentally dubs "glorp," is refined energy of human desire. Oliver's assigned Agent, Patrick, confirms that every wish produces equal and opposite consequences. The Bureau feeds on human wanting; if everyone were content, it would starve. Oliver realizes the organization is essentially a parasite on human desire.
Patrick recounts that a disgraced Agent once stole a wish-granting ring and caused an explosion. Oliver deduces that Eliza is the rogue Agent, having used the ring to wish herself into human form and lived next door to the mail slot for decades. When a massive eyeless snake arrives to execute Eliza, she pickpockets Frank's ration of glorp, recharges the stolen ring, and wishes the snake dead. The consequences inside the Bureau are immediate: Boulders crush Patrick and crack the glorp tank. Oliver and Eliza battle using ancient wish-granting artifacts, trading escalating wishes that destroy the facility. She turns him into a mouse; he becomes a ten-foot mouse. She transforms into a fire-breathing dragon as the Bureau collapses into floating islands over a void. During the chaos, Eliza renders Oliver invisible.
Oliver discovers a talking wish-granting duck carrying two green eggs, each good for one wish. He cracks the first and wishes for Eliza to be "a human being who is perfectly content with what she has." She transforms back, genuinely peaceful, her bottomless hunger gone. He cracks the second to restore his visibility. Eliza writes "RETURN TO SENDER" on his original letter; holding her hand and the duck, Oliver pushes it through the slot. They return home, where only minutes have passed.
Eliza, now sincerely content, agrees to call CPS and tell the truth. Oliver tells his mom everything. He admits he suppressed his grief to take care of her, shouldering adult responsibilities at nine years old. Annie acknowledges she never asked what he wanted. Oliver realizes the restaurant was his dad's dream, not his own. Before leaving the Bureau, he finds the letter with instructions for bringing his dad back; he leaves it in the wastebasket.
Months later, Oliver attends a public school. Annie has quit Whittle and is finishing business classes. Eliza brings daily inedible baked goods to their door. Colette and Jimmy visit for a dumpling-making gathering, and Oliver has written new recipes in the blank pages of his dad's notebook, building on his father's legacy rather than replicating it. The mail slot is permanently inactive. When Oliver asks for a cat, his mom tells him to wish for one on his birthday "like everybody else." He accepts, reflecting that he already has everything he needs.