its free. its called unlocking. you have to jailbreak your iphone then unlock it. there's loads of videos on youtube on how to unlock it. it also depends on what firmware you have. theres loads of programs to unlock it like ultrasnow. jailbreaking and unlocking an iphone 3g is very easy.
here is a tutorial on how to jailbreak any iphone or ipod touch on any firmware.
[ame=
https://www.youtube.com/watch?v=E9eNX9eUcw4]YouTube - JailbreakMe: Jailbreak iPhone 4 & All iDevices on 4.0 and 4.0.1[/ame]
steps.
1.go to jailbreakme.com on your iphone.
2.slide to start.
3. wait and enjoy jailbreak.
here is a tutorial on how to unlock an iphone.
[ame=
https://www.youtube.com/watch?v=EdWYW0sECpQ]YouTube - How to Unlock iPhone 3GS[/ame]
please rep+ if i helped you.