Instructions to generate scenarios

Request Body

The request body should be a JSON object containing the following parameters:

  • timestamps: List[float]
    • Description: The timestamps of the historical candle data.
    • Example: [1622548800.0, 1622548860.0, 1622548920.0]
  • samples: List[List[float]]
    • Description: The historical candle data samples.
    • Example: [[1.0, 1.1, 1.2], [1.2, 1.3, 1.4], [1.4, 1.5, 1.6]]
  • n_scenarii: int (optional, default: 64)
    • Description: The number of scenarios to generate.
    • Example: 100
  • max_steps: int (optional, default: 15)
    • Description: The maximum number of steps to simulate.
    • Example: 20

Example Request

{
  "inputs": {
    "timestamps": [1622548800.0, 1622548860.0, 1622548920.0],
    "samples": [[1.0, 1.1, 1.2], [1.2, 1.3, 1.4], [1.4, 1.5, 1.6]]
  },
  "n_scenarii": 100,
  "max_steps": 20
}

Response

The response will be a JSON object containing:

  • scenarii_timestamps: List[float] (the timestamps for the generated scenarios) Example: [1622548980.0, 1622549040.0, 1622549100.0]

  • scenarii_samples: List[List[float]] (the samples for the generated scenarios) Example: [[1.6, 1.7, 1.8], [1.8, 1.9, 2.0], [2.0, 2.1, 2.2]]

  • elapsed_time: float (the time taken for the inference in seconds) Example: 0.023

Example Response

{
  "scenarii_timestamps": [1622548980.0, 1622549040.0, 1622549100.0],
  "scenarii_samples": [[1.6, 1.7, 1.8], [1.8, 1.9, 2.0], [2.0, 2.1, 2.2]],
  "elapsed_time": 0.023
}

Error Handling

The endpoint will return standard HTTP error codes along with a message in case of errors:

  • 400 Bad Request: Invalid input parameters.
  • 401 Unauthorized: Missing or invalid authentication token.
  • 500 Internal Server Error: Server-side error during inference.

Ensure proper handling of these error responses in your implementation.