This feature is in alpha testing and released for a small number of initial testers. If you're interested in this type of feature, please contact us at sales@silicoai.com.
Silico Executor API
Silico exposes model execution capabilities for public and private projects via an HTTP API. This allows for a project to be run on our servers, and a result returned. Inputs can also be configured for the project, allowing the caller to provide external data for the execution of a project.
In order to use the Execution API, you will first require an API key. Contact us at sales@silicoai.com to get your API key.
Authentication
Requests to the Execution API are authenticated with an API key corresponding to an individual account. The API key should be passed to the API as a bearer token in the Authorization
header, e.g:
curl https://silico.app/api/v1/executor/run \
-H "Authorization: Bearer API_KEY"
Executing a Project
An authenticated request can execute any project to which the corresponding user account has access. Currently only the most recent saved version of a project may be executed via this API.
POST /api/v1/executor/run
Content-Type (required): application/json
Request Body (required):
The request body has required and optional fields:
username
(required)- String corresponding to the username under which the target project was created
projectSlug
(required)- String corresponding to the slug for the target project
outputs
(required)- Array of strings corresponding to the element names whose outputs should be included in the response
inputs
(optional)- Object which maps element names to input values. This can be used to override the parameterisations of the saved model. Input values must be an array of tuples of numbers, where each tuple describes a timestep-value pair (i.e. the value of the input at a particular timestep). Values of the input inbetween specified points are linearly interpolated. The last specified value of the input is held until the end of the simulation.
scenario
(optional)- String corresponding to the name of the scenario whose outputs should be calculated. If not specified, the base scenario is calculated.
Example:
{ "username": "elias", "projectSlug": "myproject", "inputs": { "Variable 1": [[0, 10], [10, 20], [30, 0]], },
"scenario": "My Scenario", "outputs": ["Stock 1"] }
The input tuples specified for "Variable 1" above describe a timeseries that has value 10 at timestep 0, increasing by 1 at each timestep until it has value 20 at timestep 10, then decreasing by 1 each timestep again until reaching value 0 at timestep 30. The value will remain at 0 until the end of the simulation.
Response Body:
The response body has the following fields:
outputs
- Object which maps element names to an array of numbers, corresponding to the simulated values for that element. Only those elements specified in the
outputs
field of the request body are included in this object.
- Object which maps element names to an array of numbers, corresponding to the simulated values for that element. Only those elements specified in the
Example:
{ "outputs": { "Stock 1": [100, 200, 300, 400, 500, 550] } }
Comments
0 comments
Please sign in to leave a comment.