A person can seek asylum in the US in two ways: Affirmative Process and Defensive Process.
The non-US citizens who want to apply for asylum through the affirmative process must be physically present in the US.
When you file a defensive asylum application, you do it to avoid being deported from the United States.
There is no fee to apply for asylum in the US. You only have to file Form I-589, Application for Asylum and Withholding of Removal.
No, the US laws do not permit individuals to apply for asylum from outside the US.