Dynamic shipping rates for fedex

I want to assign dynamic shipping rates getting from API.
for example like fedex, UPS etc