Orangutans from Sumatra and Borneo are among our closest relatives
Orangutans can help each other get food by trading tokens, scientists have discovered - but only if the help goes in both directions.
Researchers from the University of St Andrews found orangutans could learn the value of tokens and trade them, helping each other win bananas.
An article in Biology Letters, claims it is the first evidence of "calculated reciprocity" in non-human primates.
Gorillas and chimpanzees were much less willing to co-operate, they report.
Two orangutans - Bim and Dok - who live in Leipzig Zoo, Germany, were especially good at helping each other.
Initially, they were given several sets of tokens, and learned the value of the different types.
An animal could exchange one type for bananas for itself, another type could be used to gain bananas for a partner, and a third had no value.
Initially, Dok, the female, was especially good at swapping tokens to get bananas for Bim, the male. Sometimes Bim would point at the tokens to encourage her.
But he was less interested in trading tokens that would win bananas for her.
As she became less willing to help him out, Bim responded by trading more and more, until their efforts were more or less equal.
"So we have a calculation behind the giving," explained Valerie Dufour who led the research at the Scottish university.
"If you don't give me enough, then I don't give you either; but if you give me enough, OK, then I buy your co-operation, and I secure it by giving too."
Many animals exchange goods and services with each other; the grooming of primates is an obvious example.
But the researchers say there has been no experimental evidence before of "calculated reciprocity", where animals adapt their own behaviour in response to how another is helping them.
"It's not just humans that calculate about giving, and it's not just humans who expect to be given something in return when they are co-operative," Dr Dufour told BBC News.
"Orangutans do that too."
However, other apes - chimpanzees, gorillas and bonobos - were less able or willing to play the game.