Ad networks that allows to choose ads

I m looking for ad network which allows me to specify the kind of ads which should be served for an ad unit id’s. Something like i send the keywords in ad request and they show the matching ads first and if our of inventory than decide the ad to be shown based on their inventory.

Any ideas what such ad networks are?