This is a pretty neat creature you have found....maybe in your yard or while hiking? We might be able to figure out what it was feeding on before you found it.
Let's get the scientific name out of the way-----
Order Lepidoptera, Family Sphingidae, Eumorpha vitis, the 'vine caterpillar.'
You are probably familiar with the tomato hornworm---that really large green caterpillar with the horn on its rear end? It's the one that eats your tomato vines about this time of year---overnight. That's probably the most familiar caterpillar in this particular moth family.
The genus Eumorpha is unique in that the caterpillar hatches from the egg with the usual 'spine' on its rear end. It feeds, grows and molts on its plant host until about midway to maturity when it loses that horn; it's replaced by a black 'button' where the horn used to be. The most common (but not an everyday discovery) species of Eumorpha that I have seen is the one that feeds on grape and Va. creeper foliage, Eumorpha achemon. These are rather colorful caterpillars when they're mature---with muted shades of green, pink and purple.
A second Eumorpha has been found in Silver City in the last few years feeding on Virginia creeper (in the County Agent's yard, no less). That's Eumorpha typhon. While specimens that I have seen from AZ are patterned, they have muted colors compared to the Silver City beauty---rose pink, black and almost white.
Then we have your caterpillar in muted olive green. This one could be Eumorpha vitis, the 'vine caterpillar' and that's just based on color and pattern. To really nail down the ID, it would be necessary to rear the adult. Even with the best of care and careful attention to what a caterpillar was eating before capture, the little critter may not live for a variety of reasons---injury, inadequate food, wrong food source, disease and parasitism (by other insects, especially parasitoid flies and wasps).
Assuming, again, that this is E. vitis, the adult moth would look like the attached---3rd picture. See the size of the hand and the size of the moth---very large. Very similar to the adult tomato hornworm, also, in size, shape and general colors and patterns. The adult moths can be easily mistaken for hummingbirds due to size and their ability to hover near flowers. If you get a chance to watch one of these moths, do it---they are nectar feeders as adults---and potential pollinators for some plants. Their mothparts are like long, flexible straws that they can unroll and poke into flowers, reaching deeply on some for the nectaries.
Your second picture shows one of the 'defensive moves' that seems to be common among these caterpillars. It can pull its head back into a fleshy 'cowl neckline'---maybe making it look like a snake? Some will even shake their rear ends---also like a snake---when threatened. All of this is bluff--they neither bite nor sting or strike at you either.
Eumorpha vitis has been collected across the southern states, mostly from FL to AZ. They may have larger populations in Mexico and farther south---where they may have more plant hosts than what we have to offer. In the tropics, they may feed on orchids (how exotic is that?). In the States, Jimsonweed (Datura stramonium and possibly other Datura), and Periwinkle (Vinca spp., a landscape plant) have fed these moths. Also, in the States, the caterpillars have been collected feeding on foliage of Vitis (grapes), Cissus (grape ivy), Parthenocissus (Virginia creeper), Ludwigia (currently included in the evening primrose family), and Magnolia (a flowering tree much more common in the southeastern states).
So---I believe, to this point, that I have counted 29 species of sphingids in New Mexico. If this ID is correct---and I think it has merit, this will make 30 species for the state. Pretty neat. Thanks for sharing.....