API Guide

API Endpoint

The API endpoint is located at
http://core.xdeep.io/run_model

Request Method

This API uses the HTTP GET method to retrieve model results.

Request Parameters

  1. model_id (required): This parameter specifies the ID of the model you want to execute. You need to replace “ID” with the actual model ID that you want to use.
  2.  

  3. data (required): This parameter is used to provide the input vector for the model. It should be a list of numerical values enclosed in square brackets. Please note that the data vector should consist of comma (,) separated numerical values with the dot (.) as the decimal separator. There should be no thousands separator used in the values provided.

Example Request

GET http://core.xdeep.io/run_model?model_id=YOUR_MODEL_ID&data=[0.96331,-4.84262, ...]

Response Format

The API returns a JSON response with the following structure:
{
"code": 1,
"message": "Model (ID) was executed successfully",
"model_response": [Model result]
}

Response Fields

  1. code: An integer value indicating the status of the request.
    • 1: indicates a successful execution of the model.
    • 0: indicates an error, and the “message” field will provide information about the error.
  2. message: A string that provides information about the result of the API call. If there is an error, this field will explain the nature of the error.
  3.  

  4. model_response (only in case of success): This field contains the result produced by the model.

Modeling Multiple Outputs

For Xdeep models, the model_response is designed to be a single numerical value, as Xdeep models are primarily single output models. If you have a problem that involves multiple outputs, we recommend modeling each output as a separate model within the Xdeep platform.

This approach allows you to effectively model and retrieve results for each individual output, ensuring clarity and simplicity in the API’s design. You can execute these individual models independently and obtain their respective results.

By modeling each output as a separate model, you can maintain the integrity of the API’s single numerical value response structure while addressing complex problems with multiple outputs.

Error Responses

If an error occurs, the code field in the response will be 0, and the message field will explain the nature of the error. Here are the possible error messages:
 

  1. Error: Model Does Not Exist
    {
    "code": 0,
    "message": "Model (X) does not exist"
    }

    This error occurs when the model with ID X does not exist in the system
  2.  

  3. Error: Model Not Published
    {
    "code": 0,
    "message": "Model (X) is not published"
    }

    This error occurs when the model with ID X exists but is not published, and therefore cannot be executed.
  4.  

  5. Error: Numerical Data Error
    {
    "code": 0,
    "message": "Numerical error in provided data or data object"
    }

    This error occurs when the data parameter does not contain valid numerical values.
  6.  

  7. Error: No Data Provided
    {
    "code": 0,
    "message": "No valid data or data object is provided"

    }
    This error occurs when the data parameter is missing or empty.

Usage Guidelines

  1. Ensure that you have the correct model_id for the model you want to execute.
  2.  

  3. Check that the data parameter is correctly formatted and contains valid numerical values.
  4.  

  5. Handle error responses appropriately by checking the code field and the error message in the message field.
  6.  

  7. Use the model_response field to access the results produced by the model when the API call is successful.
THE FUTURE OF DEEP AI

Contact