olark('api.box.shrink');

Notes

Minimizes the chatbox. Opposite of api.box.expand.

Screenshot of API call

Click-to-minimize button

If you have your own click to chat button, you might also want to make click to minimize button:

<a href="javascript:void(0);" onclick="olark('api.box.shrink')">
    Minimize chat
</a>