At Apiary, we encourage a contract-first approach to designing your API. Write your API Description first before writing any server or client code.
To make this process possible, Apiary provides tools that allow you to try out your API as you design it. Code examples are one tool provided that can be dropped into your existing code or used for prototyping.
Finding and Using Code Examples