Access Element API JSON in another environment
Brandon answered this in a github issue https://github.com/pixelandtonic/ElementAPI/issues/4

You can do that by setting your endpoint config to an anonymous function:

'my/endpoint/pattern' =&gt; function() {
    HeaderHelper::setHeader([
        'Access-Control-Allow-Origin' =&gt; 'http://example.com'
    ]);

    return [
        // ...
    ];
}