Replicate API
    Replicate API
    • List collections of models
      GET
    • Get a collection of models
      GET
    • List available hardware for models
      GET
    • List public models
      GET
    • Create a model
      POST
    • Get a model
      GET
    • List model versions
      GET
    • Delete a model version
      DELETE
    • Get a model version
      GET
    • Create a training
      POST
    • List predictions
      GET
    • Create a prediction
      POST
    • Get a prediction
      GET
    • Cancel a prediction
      POST
    • List trainings
      GET
    • Get a training
      GET
    • Cancel a training
      POST

      Get a training

      GET
      /v1/trainings/{training_id}
      Get the current state of a training.
      Example cURL request:
      curl -s \
        -H "Authorization: Token <paste-your-token-here>" \
        https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga
      The response will be the training object:
      {
        "completed_at": "2023-09-08T16:41:19.826523Z",
        "created_at": "2023-09-08T16:32:57.018467Z",
        "error": null,
        "id": "zz4ibbonubfz7carwiefibzgga",
        "input": {
          "input_images": "https://example.com/my-input-images.zip"
        },
        "logs": "...",
        "metrics": {
          "predict_time": 502.713876
        },
        "output": {
          "version": "...",
          "weights": "..."
        },
        "started_at": "2023-09-08T16:32:57.112647Z",
        "status": "succeeded",
        "urls": {
          "get": "https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga",
          "cancel": "https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga/cancel"
        },
        "model": "stability-ai/sdxl",
        "version": "da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf",
      }
      status will be one of:
      starting: the training is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the training.
      processing: the train() method of the model is currently running.
      succeeded: the training completed successfully.
      failed: the training encountered an error during processing.
      canceled: the training was canceled by its creator.
      In the case of success, output will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the Authorization header to request them.
      In the case of failure, error will contain the error encountered during the training.
      Terminated trainings (with a status of succeeded, failed, or canceled) will include a metrics object with a predict_time property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start.
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request GET 'https://api.replicate.com/v1/trainings/'
      Response Response Example
      {}

      Request

      Authorization
      Provide your bearer token in the
      Authorization
      header when making requests to protected resources.
      Example:
      Authorization: Bearer ********************
      Path Params
      training_id
      string 
      required
      The ID of the training to get.

      Responses

      🟢200Success
      application/json
      Body
      object {0}
      Modified at 2023-12-22 03:33:22
      Previous
      List trainings
      Next
      Cancel a training
      Built with