Setup AIME JavaScript API Client Interface
The JavaScript client interface is contained in a single file: model_api.js
Node.js Usage
To use the AIME API with Node.js, you’ll need:
Node.js (v14 or later recommended)
To use the AIME API include the model_api.js in your JS file:
const { doAPIRequest } = require('../model_api');
Browser Usage
For browser usage, include the model_api.js file in your HTML:
<script src="path/to/model_api.js"></script>
<script>
// Your code using the ModelAPI class
</script>
Note
When using in a browser, you’ll need to handle CORS (Cross-Origin Resource Sharing) appropriately on your server.
Running Examples
Examples can be found in the examples directory. To run an example:
node examples/synchronous_example.js
Note
Make sure to update the API credentials in each example file before running them.