A 15-year-old boy charged with conspiring to commit an act in preparation of a terrorist act has been refused bail.

The teenager, who cannot be named for legal reasons, was among five people charged after counter-terrorism raids across Sydney's south-west on Thursday.

Police alleged the group was preparing to attack government buildings, including the Australian Federal Police building in Sydney's CBD.

In Parramatta Children's Court, Magistrate Elizabeth Ryan refused the boy bail, saying he posed an unacceptable risk to the safety of the community.

Magistrate Ryan said the boy was strongly motivated by religious ideology.

The court heard police intercepted hundreds of phone calls between the boy and one of his co-accused, including a coded text message in which the boy stated: "I want to get to paradise through bananas."

Bananas were a reference to guns, the court was told.

Photographs, which were downloaded from his mobile phone and tendered in court, show the boy dressed in black and holding a shotgun.

Other photographs depict an Islamic State beheading and Islamic State insurgents.

The boy will now remain in juvenile detention.

His barrister, Charles Waterstreet, said the family would seek his release from custody as soon as possible.

He said his client was not well.

"It's a very cruel situation he finds himself in," Mr Waterstreet said outside the court.

"It's a very difficult situation. Very difficult for the courts to deal with, very difficult for the police to deal with, but I think we shouldn't be jailing... boys."

The boy's family wept and his father held his head in his hands as the decision to refuse him bail was handed down.

His case returns to court in February.