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 model

      POST
      /v1/models
      Create a model.
      Example cURL request:
      curl -s -X POST \
        -H "Authorization: Token <paste-your-token-here>" \
        -d '{"owner": "alice" "name": "my-model", "description": "An example model", "visibility": "public", "hardware": "cpu"}' \
        https://api.replicate.com/v1/models
      The response will be a model object in the following format:
      {
        "url": "https://replicate.com/alice/my-model",
        "owner": "alice",
        "name": "my-model",
        "description": "An example model",
        "visibility": "public",
        "github_url": null,
        "paper_url": null,
        "license_url": null,
        "run_count": 0,
        "cover_image_url": null,
        "default_example": null,
        "latest_version": null,
      }
      Request Request Example
      Shell
      JavaScript
      Java
      Swift
      curl --location --request POST 'https://api.replicate.com/v1/models' \
      --header 'Content-Type: application/json' \
      --data-raw '{
          "cover_image_url": "string",
          "description": "string",
          "github_url": "string",
          "hardware": "string",
          "license_url": "string",
          "name": "string",
          "owner": "string",
          "paper_url": "string",
          "visibility": "public"
      }'
      Response Response Example
      {}

      Request

      Authorization
      Provide your bearer token in the
      Authorization
      header when making requests to protected resources.
      Example:
      Authorization: Bearer ********************
      Body Params application/json
      cover_image_url
      string 
      optional
      A URL for the model's cover image. This should be an image file.
      description
      string 
      optional
      A description of the model.
      github_url
      string 
      optional
      A URL for the model's source code on GitHub.
      hardware
      string 
      required
      The SKU for the hardware used to run the model. Possible values can be retrieved from the hardware.list endpoint.
      license_url
      string 
      optional
      A URL for the model's license.
      name
      string 
      required
      The name of the model. This must be unique among all models owned by the user or organization.
      owner
      string 
      required
      The name of the user or organization that will own the model. This must be the same as the user or organization that is making the API request. In other words, the API token used in the request must belong to this user or organization.
      paper_url
      string 
      optional
      A URL for the model's paper.
      visibility
      enum<string> 
      required
      Whether the model should be public or private. A public model can be viewed and run by anyone, whereas a private model can be viewed and run only by the user or organization members that own the model.
      Allowed values:
      publicprivate
      Examples

      Responses

      🟢201Success
      application/json
      Body
      object {0}
      Modified at 2023-12-22 03:33:22
      Previous
      List public models
      Next
      Get a model
      Built with