It depends.
In a recent project, I made the web application and the API nearly identical. If you had http://example.com/some/action/here used by the web application as a page or through AJAX, the same request with the same URI would also be used through the API, only served with different MIME types (HTML or JSON type for the web application, JSON or XML for the API).
It works, and has its huge advantage: you write the code once. At least for the most part of the codebase, since there would be discrepancies. For example, it wouldn't make sense to use CAPTCHA in your API; on the other hand, the API would probably have a few additional calls that are not used by the web application.
You may as well designate the API in a very different way, distinct from your web application. This gives you for example the opportunity to have a RESTful API, while the web application would use sessions.