Dissident Chinese artist Ai Weiwei has called Beijing a "nightmare" and said China's justice system cannot be trusted, in his first article for a foreign magazine since his release from detention in June.

The outspoken critic of the Communist Party disappeared for nearly three months earlier this year before Chinese authorities, facing a global outcry, announced he had been detained for tax evasion and freed him.

"The worst thing about Beijing is that you can never trust the judicial system. Without trust, you cannot identify anything; it?s like a sandstorm," Ai wrote in an essay on his native city in the current issue of Newsweek magazine.

"This city is not about other people or buildings or streets but about your mental structure... Beijing is a nightmare. A constant nightmare."

Ai, 54, whose art works have been displayed around the world, said his ordeal in police custody made him realise he was only a number in an anonymous system where "they deny us basic rights".

"Only your family is crying out that you?re missing. But you can?t get answers from the street communities or officials, or even at the highest levels, the court or the police or the head of the nation," he wrote.

"My wife has been writing these kinds of petitions every day, making phone calls to the police station every day. Where is my husband? Just tell me where my husband is. There is no paper, no information."

Ai further painted Beijing as a city of "power and money" where "those who belong to the government, the coal bosses, the heads of big enterprises" entice foreign investors with their smart suits and business acumen.

"The other city is one of desperation. I see people on public buses, and I see their eyes, and I see they hold no hope," he said of the millions of migrant workers known as "Beijing's slaves".

The essay, which risks further displeasing the authorities, follows a series of anti-government comments posted by Ai on Twitter, where he hit out at the treatment of colleagues and fellow dissidents in an apparent violation of the terms of his bail.

Ai has been barred from leaving Beijing for a year following his detention on charges of tax evasion, which rights groups say was part of a wider crackdown on government critics amid official concern that unrest in the Arab world would spread to China.