NEW YORK — Beto O’Rourke crept to the edge of announcing a presidential bid here during an interview with Oprah Winfrey on Tuesday afternoon, saying that he was leaning toward a run and would make a final decision by the end of the month.

In a theater in Times Square — and sandwiched in a program that started with actor Michael B. Jordan and ended with actor-director Bradley Cooper — the former Texas congressman outlined the case for a Democratic candidate who could knit together a divided country and dropped hint after hint that he believes that candidate should be him.

“I have been thinking about running for president,” he said, to a large round of applause.

“And what’s your conclusion?” Winfrey asked as leaning forward, urging him to get into the race. “Are you running?”

“That’s a big question for us to think through,” he said. “I’ve got to tell you. You can tell. I’m so excited at the prospect of being able to play that role.”

“What’s it going to take?” she asked loudly. “What’s it going to take for you to say ‘yes?’ ”

He playfully said that his 12-year-old son, Ulysses, was among those most against him running for president, after O’Rourke was away for long stretches during last year’s failed U.S. Senate campaign.

“The good thing for those who want us to run is our oldest, Ulysses, who was most desperate that we never run for office ever again because of how long I have been gone, is about ready for me to leave the house,” O’Rourke said.

O’Rourke would be entering a presidential field that is growing more crowded by the week. Since he stepped offstage after his November loss, Sens. Elizabeth Warren (Mass.), Kirsten Gillibrand (N.Y.) and Kamala D. Harris (Calif.), among others, have joined the Democratic field.

Still, O’Rourke in his Senate campaign demonstrated a raw ability to attract enthusiasm, raise record amounts of money online and harness social media in a way that few other candidates have been able to replicate.

In a field that already has launched into discussions of health-care policy and tax proposals, however, he would be under pressure to deliver more specifics about his campaign as well as his extended public ambivalence about seeking the presidency.

The interview with Winfrey was his first major public appearance in weeks.

The taping — which also included others, such as philanthropist Melinda Gates — took place inside the PlayStation Theater in Times Square. The interviews will air Feb. 16, on Winfrey’s television channel, OWN. Tickets were being sold for $225.

Winfrey provided a key 2008 endorsement for Barack Obama in his first presidential run and has triggered buzz of her own around calls for her to seek office. At one point, O’Rourke gamely turned toward her.

“Many of the questions that you have been asking me, I’m sure many people here would like to know the answer from you,” he said. “Is this something you would consider?”

“The reason I respect your process is because I do firmly believe it’s something you’ve got to feel inside of yourself,” Winfrey responded. “Not what everybody else says, that I believe that I can answer this call for this particular moment in our time, in our culture, in our society.”

The 50-minute interview began with O’Rourke reflecting on his Senate loss, and what he could have done differently. He ran a unique campaign, he said, and would do the same if he were to run in 2020. He didn’t have a pollster or a speechwriter, and he prided himself on going to Republican-dominated areas that Democrats often overlooked.

“I learned a hell of a lot during that campaign,” he said. “And I think at a time that our politics is so heavily scripted and tested and safe, there was something that was new and maybe even dangerous or different about the way that we ran this campaign.”

After the campaign, he said, he felt a “profound disappointment” and he set off on a solo journey, one that was well-documented — and often mocked by critics — in Medium posts that he put online saying that he was “in and out of a funk.” It went from his on-the-road meals (“Pepperoni and cheese pizza. Ice cream for dessert.”) to questions of national unity (“How do we stop seeing each other as outsiders?”). At one point, he live-streamed part of a dental appointment.

He has said he is considering both running for president and teaching in a classroom. Yet he has done little of the preparation seen from other candidates, favoring a psychological journey more than one that is practically focused on hiring staff or raising money.

“I had to be moving; I had to be meeting people,” O’Rourke said. “It’s just how I think, how I find the next step. I just truly emerged out of this by being with people.”

“That journey totally took me out of not just a funk but out of myself, and into what we are all connected to, which is this amazing place and idea, which is America,” he said. “We want to play a great a role as possible in making sure this country lives up to the expectations.”

The interview with Winfrey at times had the feel of O’Rourke openly wondering whether he was the one for the moment — as the crowd egged him on, hoping he would just go ahead and announce.

“I’m increasingly excited about doing something — again to the best of my ability, fulfilling my purpose to its greatest level,” he said at one point.

“Can I be part of bringing people together in a deeply divided country around things we agree are common — can we have a common conception on what it is to be American?” he said at another point. “I think about our politics, the way that we run campaigns, the way that we connect with each other. . . . If I can play some role in helping the country to do that, by God I’m going to do it.”

“By God, when are you going to know the answer?” Winfrey said.

“Really soon,” O’Rourke responded. “Before the end of this month.”

Winfrey brought up the meeting that he had last year with Obama, asking for details about whether refreshments were served (coffee, in a porcelain cup) and whether the former president urged O’Rourke to run (he didn’t, but they did discuss a presidential campaign).

“At about minute six or seven, I realized: I am so tense and tight, and I’m sure I just have the weirdest look on my face. This loop is going through my head, ‘I am listening to President Obama, I am sitting with President Obama,’ ” O’Rourke said. “I kind of mind-controlled my body and my expressions and I tried to look relaxed.”

A few minutes later, he stopped himself, as if stunned.

“Even saying these words, it’s hard to believe that I’m saying I met with Barack Obama,” he said. “And I’m saying it to Oprah Winfrey.”

At the end of the interview, Winfrey looked over and said, “You seem like you’re getting ready to run.”