Create a model
POST
/v1/modelsCreate 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,
}
请求参数
A URL for the model's cover image. This should be an image file.
A description of the model.
A URL for the model's source code on GitHub.
The SKU for the hardware used to run the model. Possible values can be retrieved from the hardware.list
endpoint.
A URL for the model's license.
The name of the model. This must be unique among all models owned by the user or organization.
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.
A URL for the model's paper.
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.
{
"cover_image_url": "string",
"description": "string",
"github_url": "string",
"hardware": "string",
"license_url": "string",
"name": "string",
"owner": "string",
"paper_url": "string",
"visibility": "public"
}
示例代码
Responses
{}