API operations

Updated at:
Copy as MD

The Lindorm AI engine provides a RESTful API for model management, model inference, and parameter adjustment. This topic describes the endpoints, authentication mechanism, response format, and API operations for the Lindorm AI RESTful API.

Prerequisites

The AI engine must be activated. For instructions, see the Activation Guide.

Authentication mechanism

When you send an HTTP request, add the following keys to the request header:

  • x-ld-ak: The username for accessing the AI engine.

  • x-ld-sk: The password for accessing the AI engine.

To obtain your credentials, see Obtaining connection information.

Common URL parameters

The RESTful API supports the following URL parameters:

Parameter

Type

Description

pretty

BOOLEAN

Specifies whether to pretty-print the JSON response.

Response format

The RESTful API returns standard HTTP status codes and uses a JSON object in the response body to detail the request's execution.

Status codes

HTTP status code

Description

200 OK

The request was successful.

400 Bad Request

The requested URI or input parameters are invalid.

401 Unauthorized

Authentication failed.

404 Not Found

The requested URI does not exist.

405 Method Not Allowed

The HTTP method is not allowed for the requested resource.

413 Request Entity Too Large

The request entity is too large.

500 Internal Server Error

An internal error occurred. This can indicate a server-side exception.

Response body format

{
  "code": 0,
  "msg": "",
  "data": "",
  "success": true
}

Response field

Description

code

The status code for the operation. Valid values:

  • 0: The operation was successful.

  • Other values: The operation failed. This value matches the HTTP status code in the header.

msg

  • The value is always SUCCESS when the operation is successful.

  • If the operation fails, this field contains a specific error message.

data

The request result. The format varies by API. For details, see the specific API definition.

success

Indicates whether the operation was successful. Valid values:

  • true: The operation was successful.

  • false: The operation failed.

API operations

image

Type

Description

References

Model management

Allows you to deploy, list, and delete models, as well as view details and upload model files.

Model management

Model inference

Allows you to perform inference for features such as feature extraction, Q&A, and semantic similarity.

Model inference

Parameter adjustment

Allows you to adjust the parameters of deployed models.

Parameter adjustment