Function that enables fields based on checkbox state
It's difficult to answer accurately without seeing your markup, but maybe you can use a multiple selector to alleviate code redundancy. You can also use prop() to enable or disable your elements more easily:

$(function() {
    var $elements = $("#amount, #period, #key");
    $elements.prop("disabled", true);
    $("#api").change(function() {
        $elements.prop("disabled", !$("#apiEnabled").is(":checked"));
    });
});