It’s the Bhagavato-upasampadāpañha in the Milindapañha and/or its possible Chinese parallel in the Nāgasena Bhiksu Sūtra. I say “possible parallel” because I’m not sure whether the phrase used in the Chinese actually means the same as upasampadā.
Rājā āha—“bhante nāgasena, upasampadā sundarā”ti?
“Āma, mahārāja, upasampadā sundarā”ti.
“Atthi pana, bhante, buddhassa upasampadā, udāhu natthī”ti?
“Upasampanno kho, mahārāja, bhagavā bodhirukkhamūle saha sabbaññutañāṇena, natthi bhagavato upasampadā aññehi dinnā, yathā sāvakānaṁ, mahārāja, bhagavā sikkhāpadaṁ paññapeti yāvajīvaṁ anatikkamanīyan”ti.
“Kallosi, bhante nāgasenā”ti.
The king said: ‘Is ordination a good thing?’
‘Yes, a good thing and a beautiful.’
‘But did the Buddha obtain it, or not?’
‘Great king, when the Blessed One attained omniscience at the foot of the tree of Knowledge, that was to him an ordination. There was no conferring of ordination upon him at the hands of others—in the way that the Blessed One laid down regulations for his disciples, never to be transgressed by them their lives long!’
‘Very true, Nāgasena!’
王復問那先。佛寧悉學知奉行 經戒不。那先言佛悉學知奉行經戒。王言佛 從誰師受經戒。那先言佛無師。佛得道時便 悉自知諸經道。佛不如諸弟子學知佛所教。 諸弟子皆當奉行至老。王言善哉。
The king asked Nāgasena again, “Did the Buddha learn, know and practise the dharma and precepts?”
Nāgasena replied, “The Buddha did learn, know and practise the dharma and precepts.”
“Then from what teacher did the Buddha receive the dharma and precepts?”
“The Buddha had no teacher. When the Buddha attained enlightenment, he knew by himself the dharma, the path, unlike the disciples who had to learn and know the teaching from the Buddha. They needed to practise it till old age.”
“Excellent, Nāgasena.”
The BDK translation adds an endnote which states that another version of the dialogue can be found at T.1912.46:143c2, but I don’t know what text this is.