Making API Requests for GenAI Results
All of the ElevateAI Generative AI API Endpoints use a similar format, leveraging the unique interactionIdentifier returned upon successfully declaring the audioaudio, chatchat, or transcriptiontranscription interaction.
When the desired GET request* successfully executes, an HTTP status is returned to indicate the request was successful, along with a JSON response providing details specific to that endpoint.
All endpoints support a GET method; the Ask ElevateAI Q&A endpointAsk ElevateAI endpoint supports both POST and GET methods.
- Details specific to individual endpoints are covered on the GenAI API endpointsGenerative AI API Endpoint Details page
The general request format to be used for all of the Generative AI API requests is outlined below:
// General Request Format
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.elevateai.com/v1/interactions/{interactionIdentifier}/{endpoint}',
'headers': {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
// Retryable Responses
The following response codes leave the interaction endpoint in a retryable state.
Calling code should handle these responses gracefully and retry appropriately:
Response | Message | Meaning |
|---|---|---|
408 | RequestTimeout | The Generative AI model was not able to respond in an acceptable amount of time. |
429 | TooManyRequests | By default, each account is allowed up to 10 simultaneous Generative AI requests at one time. This response indicates that more than 10 are being attempted. |
Need more help? Contact the ElevateAI Support team.