A more entertaining phrasing of the question would be "what would a marine ecologist put into a perfect aquarium?"

I was reading about Prochlorococcus, among other photoautotrophs, and found that they seem to get their nitrogen from ammonia, which must be produced by some other organism. This set me off wondering what different species I would need in a hypothetical aquarium (how big that would have to be is another question, I guess), such that a sustainable ecological equilibrium occurs (one different from everybody dead, I guess), only requiring sunlight and air from the outside.

I realize that I'll have to put other components like iron etc in the water, but let's say I only put some fixed amount in during setup. What exactly that would have to be is probably another can of worms, so let's keep that out of this question as much as possible.

Has there been research towards such model ecosystems, and are there known minimum configurations?

It's hard to give an authorative "no" to this answer. But maybe there's research that looked for such a system and failed, or maybe marine ecologists use model cultures in their labs that show instabilities (meaning the culture dies, you have to replace the water, or keep adding fertilizer, or keep removing some waste) which allow some generalizations.

Of course, it needs sunlight, but all the elements are recycled. Its really closed and has reasonable endurance.

The basic commercial version of his closed world -- sold under the label of "Ecosphere" -- is a glass globe about the size of a large grapefruit. My world #58262 was one of these. Completely sealed inside the transparent ball were four tiny brine shrimp, a feathery mass of meadowgreen algae draped on a twig of coral, and microbes in the invisible millions. A bit of sand sat on the bottom. No air, water, or any other material entered or exited the globe. The thing ate only sunlight.

The oldest living Hanson-world so far is ten years old; that's as long as they have been manufactured. That's surprising since the average life-span of the shrimp swimming inside was thought to be about five years. Getting them to reproduce in their closed world has been problematic, although researchers know of no reason why they could not go on replicating forever. Individual shrimp and algae cells die, of course. What "lives forever" is the collective life, the aggregate life of a community.

All of this is a real subject of research for those interested in creating entirely useful ecosystems.

It turns out that ecospheres scale up well. A huge commercial Ecosphere can weigh in at 200 liters. That's about the volume of a large garbage can -- so big you can't reach your arms around it. Inside a stunning 30-inch-diameter glass globe, shrimp paddle between fronds of algae. But instead of the usual three or four spore-eating shrimp, the giant Ecosphere holds 3,000. It's a tiny moon with its own inhabitants. Here, the law of large numbers takes hold; more is different. More individual lives make the ecosystem more resilient. The larger an Ecosphere is, the longer it takes to stabilize, and the harder it is to kill it. But once in gear, the collective give and take of a vivisystem takes root and persists.

Unfortunately larger systems that can support people have not been made yet.

Algae and man lasted a whole day. For about 24 hours, man breathed into algae and algae breathed into man. Then the staleness of the air drove Shepelev out. The oxygen content initially produced by the algae plummeted rapidly by the close of the first day. In the final hour when Shepelev cracked open the sealed door to clamber out, his colleagues were bowled over by the revolting stench in his cabin. Carbon dioxide and oxygen had traded harmoniously, but other gases, such as methane, hydrogen sulfide, and ammonia, given off by algae and Shepelev himself, had gradually fouled the air. Like the mythological happy frog in slowly boiling water, Shepelev had not noticed the stink.