This varies depending on the STI and the insurer. An STI test is usually covered by basic health insurance. Take into account your standard uninsured risk. If you want to be sure about the cost, contact your doctor or insurer first. An anonymous STI test at an STI clinic run by the municipal health service (GGD) is often free of charge.
If you are uninsured or living in the Netherlands without a residence permit, an HIV test is always available. This has no impact on your residence permit or application for asylum. Even without insurance, you have a right to treatment if you have HIV. Nonetheless, it often difficult to get medical treatment. Hiv Vereniging Nederland can help you, anonymously if necessary.