The Accusativus cum Infinitivo (AcI) construction is often regarded in linguistics as a kind of Exceptional Case Marking (ECM) structure, i.e., one where the case and the semantic function of the subject of the AcI are assigned by different elements/heads. For example, in Video te venire the accusative case of te is said to be assigned by the main verb video, but the semantic function of this pronoun is assigned by the subordinate predicate (venire). This "exceptional" case marking can be compared to the "non-exceptional" one involved in examples like Te amo, where te receives both case and semantic function from the same element/head (i.e., the verb amo).
However, the existence of examples like Te beatum esse mihi est gratum, necesse est me abire, etc. make this connection between AcI constructions and ECM structures problematic. Crucially, in these examples one cannot assume that the accusative case of the subject of the infinitival clause is assigned by the main verb. In light of these examples (which are not rare at all!), I was wondering if one should conclude that the accusative case marking of the subject of infinitival clauses in Latin is quite different from what one finds, say, in English Exceptional Case Marking constructions and we should then get rid of the alleged parallelism with English and to assume that the accusative case of the subject of infinitival clauses is licensed in a different way: unlike in English, it is not assigned by the main verb (i.e., externally) but rather its licensing is internal to the infinitival subordinate clause.
Perhaps some of you consider it natural to say that the accusative case of te in Video te venire is assigned by video (after all one can also say Video te) but what about Dico te venire? Why should we assume that in this example the acc. case of te is assigned by the transitive verb dico? My intuition is that the licensing of the acc. case of te in Dico te venire is not so different from that of Necesse est te abire.
So Draconis's claim that mē in cupiunt me esse regem is accusative because it is the object of cupiunt is not obvious to me (cf. Draconis's comment: "I've always viewed the AcI as getting its case from the main verb, but that other answer brings up some very good counterexamples"). Once we avoid the connection between English ECM structures and Latin AcI constructions, my impression is that those examples (Te beatum esse mihi est gratum, Necesse est me abire, etc.) should not be seen as "counterexamples". Unlike in English, the licensing of the accusative case of the subject of the AcI construction in Latin is internal to the subordinate clause.
Let me conclude with a speculation. A plausible (?) diachronic account could be that the AcI construction was born as an ECM construction in cases like Video te (venire), then it was extended to transitive cases like Dico te *(venire) and finally it was extended to non-transitive ones like Necesse est me abire or Dicitur te venire. Any thoughts and/or useful references on this issue?