Skip to main content

Caila Predict API

To access a specific service, you will need:

  1. The service identifier, for example: just-ai/openai-proxy. The identifier always consists of two parts: <author>/<service>. You can view the service identifier on the Catalogue page or you can copy the last two elements from the URL of the service page: https://caila.io/catalog/just-ai/openai-proxy
  2. The API key Keys are created in the Workspace: https://caila.io/workspace/api-tokens
  3. The type of request and response data, as well as examples of request. This information is usually provided on the service page in the Catalogue.

There are two main methods for accessing services via HTTP:

  • predict
  • predict-with-config

Structure of the predict request

curl --request POST 'https://caila.io/api/mlpgate/account/{author}/model/{service}/predict' \
--header 'MLP-API-KEY: {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{predict-request-json}'

Structure of the predict-with-config request

curl --request POST 'https://caila.io/api/mlpgate/account/{author}/model/{service}/predict-with-config' \
--header 'MLP-API-KEY: {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"data": {predict-request-json},
"config": {predict-config-json}
}'

Parameter description

  • author is the first part of the service identifier which indicates the account of the service owner
  • service is the second part of the service identifier which indicates the name of the service
  • api_token is access key
  • predict-request-json is a JSON object with the request body. Information about the request format is provided on the service page in the Catalogue.
  • predict-config-json is a JSON object with the settings. Information about the settings format is provided on the service page in the Catalogue.

Other methods

  • predict-with-config-v2 is a copy of predict-with-config introduced because some code generators incorrectly process the “Any” type for data and config fields in the predict-with-config method. To address this issue, we have added the predict-with-config-v2 method, where the data and config fields have the string type
  • You can find the complete up-to-date REST API specification here: https://caila.io/swagger-ui
  • GRPC — services can be accessed via GRPC. The specification is available here: https://caila.io/static/mlpgate/mlp-grpc.proto. The detailed description is in the GRPC API section.