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

      Create a training

      POST
      /v1/models/{model_owner}/{model_name}/versions/{version_id}/trainings
      Start a new training of the model version you specify.
      Example request body:
      {
        "destination": "{new_owner}/{new_name}",
        "input": {
          "train_data": "https://example.com/my-input-images.zip",
        },
        "webhook": "https://example.com/my-webhook",
      }
      Example cURL request:
      curl -s -X POST \
        -d '{"destination": "{new_owner}/{new_name}", "input": {"input_images": "https://example.com/my-input-images.zip"}}' \
        -H "Authorization: Token <paste-your-token-here>" \
        -H 'Content-Type: application/json' \
        https://api.replicate.com/v1/models/stability-ai/sdxl/versions/da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf/trainings
      The response will be the training object:
      {
        "id": "zz4ibbonubfz7carwiefibzgga",
        "model": "stability-ai/sdxl",
        "version": "da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf",
        "input": {
          "input_images": "https://example.com/my-input-images.zip"
        },
        "logs": "",
        "error": null,
        "status": "starting",
        "created_at": "2023-09-08T16:32:56.990893084Z",
        "urls": {
          "cancel": "https://api.replicate.com/v1/predictions/zz4ibbonubfz7carwiefibzgga/cancel",
          "get": "https://api.replicate.com/v1/predictions/zz4ibbonubfz7carwiefibzgga"
        }
      }
      As models can take several minutes or more to train, the result will not be available immediately. To get the final result of the training you should either provide a webhook HTTPS URL for us to call when the results are ready, or poll the get a training endpoint until it has finished.
      When a training completes, it creates a new version of the model at the specified destination.
      To find some models to train on, check out the trainable language models collection.
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://api.replicate.com/v1/models///versions//trainings' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "destination": "string",
          "input": {},
          "webhook": "string"
      }'
      Response Response Example
      {}

      Request

      Authorization
      Provide your bearer token in the
      Authorization
      header when making requests to protected resources.
      Example:
      Authorization: Bearer ********************
      Path Params

      Body Params application/json

      Examples

      Responses

      🟢201Success
      application/json
      Body

      Modified at 2023-12-22 03:33:22
      Previous
      Get a model version
      Next
      List predictions
      Built with