From 2c62a42dcdb9fd132fa8f265a06468502c9925b8 Mon Sep 17 00:00:00 2001 From: HavenDV Date: Thu, 29 Aug 2024 17:00:20 +0400 Subject: [PATCH] ci: Fixed test workflow name. --- .github/workflows/pull-request.yml | 2 +- Replicate.sln | 2 - docs/openapi.json | 1339 ---------------------------- docs/openapi.nswag | 100 --- 4 files changed, 1 insertion(+), 1442 deletions(-) delete mode 100644 docs/openapi.json delete mode 100755 docs/openapi.nswag diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index edaa463..ae5a1e4 100755 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -6,7 +6,7 @@ on: jobs: test: - name: Build abd test + name: Test uses: HavenDV/workflows/.github/workflows/dotnet_build-test-publish.yml@main with: generate-build-number: false diff --git a/Replicate.sln b/Replicate.sln index 4b81cf1..2794ae0 100755 --- a/Replicate.sln +++ b/Replicate.sln @@ -9,9 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution src\Directory.Build.props = src\Directory.Build.props .github\workflows\dotnet.yml = .github\workflows\dotnet.yml LICENSE = LICENSE - docs\openapi.nswag = docs\openapi.nswag README.md = README.md - docs\openapi.json = docs\openapi.json .github\workflows\pull-request.yml = .github\workflows\pull-request.yml .github\workflows\auto-update.yml = .github\workflows\auto-update.yml .github\workflows\mkdocs.yml = .github\workflows\mkdocs.yml diff --git a/docs/openapi.json b/docs/openapi.json deleted file mode 100644 index afd933b..0000000 --- a/docs/openapi.json +++ /dev/null @@ -1,1339 +0,0 @@ -{ - "components": { - "schemas": { - "prediction_request": { - "additionalProperties": false, - "properties": { - "input": { - "description": "The model's input as a JSON object. The input schema depends on what model you are running. To see the available inputs, click the \"API\" tab on the model you are running or [get the model version](#models.versions.get) and look at its `openapi_schema` property. For example, [stability-ai/sdxl](https://replicate.com/stability-ai/sdxl) takes `prompt` as an input.\n\nFiles should be passed as HTTP URLs or data URLs.\n\nUse an HTTP URL when:\n\n- you have a large file \u003E 256kb\n- you want to be able to use the file multiple times\n- you want your prediction metadata to be associable with your input files\n\nUse a data URL when:\n\n- you have a small file \u003C= 256kb\n- you don't want to upload and host the file somewhere\n- you don't need to use the file again (Replicate will not store it)\n", - "type": "object" - }, - "stream": { - "description": "Request a URL to receive streaming output using [server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).\n\nIf the requested model version supports streaming, the returned prediction will have a `stream` entry in its `urls` property with an HTTPS URL that you can use to construct an [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource).\n", - "type": "boolean" - }, - "webhook": { - "description": "An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.\n", - "type": "string" - }, - "webhook_events_filter": { - "description": "By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:\n\n- `start`: immediately on prediction start\n- `output`: each time a prediction generates an output (note that predictions can generate multiple outputs)\n- `logs`: each time log output is generated by a prediction\n- `completed`: when the prediction reaches a terminal state (succeeded/canceled/failed)\n\nFor example, if you only wanted requests to be sent at the start and end of the prediction, you would provide:\n\n```json\n{\n \"input\": {\n \"text\": \"Alice\"\n },\n \"webhook\": \"https://example.com/my-webhook\",\n \"webhook_events_filter\": [\"start\", \"completed\"]\n}\n```\n\nRequests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.\n", - "items": { - "enum": [ - "start", - "output", - "logs", - "completed" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "input" - ], - "type": "object" - }, - "training_request": { - "properties": { - "destination": { - "description": "A string representing the desired model to push to in the format `{destination_model_owner}/{destination_model_name}`. This should be an existing model owned by the user or organization making the API request. If the destination is invalid, the server will return an appropriate 4XX response.\n", - "type": "string" - }, - "input": { - "description": "An object containing inputs to the Cog model's `train()` function.\n", - "type": "object" - }, - "webhook": { - "description": "An HTTPS URL for receiving a webhook when the training completes. The webhook will be a POST request where the request body is the same as the response body of the [get training](#trainings.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.", - "type": "string" - }, - "webhook_events_filter": { - "description": "By default, we will send requests to your webhook URL whenever there are new outputs or the training has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the training request:\n\n- `start`: immediately on training start\n- `output`: each time a training generates an output (note that trainings can generate multiple outputs)\n- `logs`: each time log output is generated by a training\n- `completed`: when the training reaches a terminal state (succeeded/canceled/failed)\n\nFor example, if you only wanted requests to be sent at the start and end of the training, you would provide:\n\n```json\n{\n \"destination\": \"my-organization/my-model\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"webhook\": \"https://example.com/my-webhook\",\n \"webhook_events_filter\": [\"start\", \"completed\"]\n}\n```\n\nRequests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.\n", - "items": { - "enum": [ - "start", - "output", - "logs", - "completed" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "destination", - "input" - ], - "type": "object" - }, - "version_prediction_request": { - "additionalProperties": false, - "properties": { - "input": { - "description": "The model's input as a JSON object. The input schema depends on what model you are running. To see the available inputs, click the \"API\" tab on the model you are running or [get the model version](#models.versions.get) and look at its `openapi_schema` property. For example, [stability-ai/sdxl](https://replicate.com/stability-ai/sdxl) takes `prompt` as an input.\n\nFiles should be passed as HTTP URLs or data URLs.\n\nUse an HTTP URL when:\n\n- you have a large file \u003E 256kb\n- you want to be able to use the file multiple times\n- you want your prediction metadata to be associable with your input files\n\nUse a data URL when:\n\n- you have a small file \u003C= 256kb\n- you don't want to upload and host the file somewhere\n- you don't need to use the file again (Replicate will not store it)\n", - "type": "object" - }, - "stream": { - "description": "Request a URL to receive streaming output using [server-sent events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events).\n\nIf the requested model version supports streaming, the returned prediction will have a `stream` entry in its `urls` property with an HTTPS URL that you can use to construct an [`EventSource`](https://developer.mozilla.org/en-US/docs/Web/API/EventSource).\n", - "type": "boolean" - }, - "version": { - "description": "The ID of the model version that you want to run.", - "type": "string" - }, - "webhook": { - "description": "An HTTPS URL for receiving a webhook when the prediction has new output. The webhook will be a POST request where the request body is the same as the response body of the [get prediction](#predictions.get) operation. If there are network problems, we will retry the webhook a few times, so make sure it can be safely called more than once. Replicate will not follow redirects when sending webhook requests to your service, so be sure to specify a URL that will resolve without redirecting.\n", - "type": "string" - }, - "webhook_events_filter": { - "description": "By default, we will send requests to your webhook URL whenever there are new outputs or the prediction has finished. You can change which events trigger webhook requests by specifying `webhook_events_filter` in the prediction request:\n\n- `start`: immediately on prediction start\n- `output`: each time a prediction generates an output (note that predictions can generate multiple outputs)\n- `logs`: each time log output is generated by a prediction\n- `completed`: when the prediction reaches a terminal state (succeeded/canceled/failed)\n\nFor example, if you only wanted requests to be sent at the start and end of the prediction, you would provide:\n\n```json\n{\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"webhook\": \"https://example.com/my-webhook\",\n \"webhook_events_filter\": [\"start\", \"completed\"]\n}\n```\n\nRequests for event types `output` and `logs` will be sent at most once every 500ms. If you request `start` and `completed` webhooks, then they'll always be sent regardless of throttling.\n", - "items": { - "enum": [ - "start", - "output", - "logs", - "completed" - ], - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "version", - "input" - ], - "type": "object" - } - }, - "securitySchemes": { - "bearerAuth": { - "bearerFormat": "All API requests must include a valid API token in the `Authorization` request header. The token must be prefixed by \"Bearer\", followed by a space and the token value.\nExample: `Authorization: Bearer r8_Hw***********************************`\nFind your tokens at https://replicate.com/account/api-tokens\n", - "scheme": "bearer", - "type": "http" - } - } - }, - "externalDocs": { - "description": "Replicate HTTP API", - "url": "https://replicate.com/docs/reference/http" - }, - "info": { - "contact": { - "email": "team@replicate.com" - }, - "description": "A web service for running Replicate models", - "termsOfService": "https://replicate.com/terms", - "title": "Replicate HTTP API", - "version": "1.0.0-a1" - }, - "openapi": "3.0.0", - "paths": { - "/account": { - "get": { - "description": "Returns information about the user or organization associated with the provided API token.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/account\n```\n\nThe response will be a JSON object describing the account:\n\n```json\n{\n \"type\": \"organization\",\n \"username\": \"acme\",\n \"name\": \"Acme Corp, Inc.\",\n \"github_url\": \"https://github.com/acme\",\n}\n```\n", - "operationId": "account.get", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "github_url": { - "description": "The GitHub URL of the account.", - "format": "uri", - "type": "string" - }, - "name": { - "description": "The name of the account.", - "type": "string" - }, - "type": { - "description": "The account type. Can be a user or an organization.", - "enum": [ - "organization", - "user" - ], - "type": "string" - }, - "username": { - "description": "The username of the account.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "Get the authenticated account" - } - }, - "/collections": { - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/collections\n```\n\nThe response will be a paginated JSON list of collection objects:\n\n```json\n{\n \"next\": \"null\",\n \"previous\": null,\n \"results\": [\n {\n \"name\": \"Super resolution\",\n \"slug\": \"super-resolution\",\n \"description\": \"Upscaling models that create high-quality images from low-quality images.\"\n }\n ]\n}\n```\n", - "operationId": "collections.list", - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "List collections of models" - } - }, - "/collections/{collection_slug}": { - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/collections/super-resolution\n```\n\nThe response will be a collection object with a nested list of the models in that collection:\n\n```json\n{\n \"name\": \"Super resolution\",\n \"slug\": \"super-resolution\",\n \"description\": \"Upscaling models that create high-quality images from low-quality images.\",\n \"models\": [...]\n}\n```\n", - "operationId": "collections.get", - "parameters": [ - { - "description": "The slug of the collection, like `super-resolution` or `image-restoration`. See [replicate.com/collections](https://replicate.com/collections).\n", - "in": "path", - "name": "collection_slug", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Get a collection of models" - } - }, - "/deployments": { - "get": { - "description": "Get a list of deployments associated with the current account, including the latest release configuration for each deployment.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/deployments\n```\n\nThe response will be a paginated JSON array of deployment objects, sorted with the most recent deployment first:\n\n```json\n{\n \"next\": \"http://api.replicate.com/v1/deployments?cursor=cD0yMDIzLTA2LTA2KzIzJTNBNDAlM0EwOC45NjMwMDAlMkIwMCUzQTAw\",\n \"previous\": null,\n \"results\": [\n {\n \"owner\": \"replicate\",\n \"name\": \"my-app-image-generator\",\n \"current_release\": {\n \"number\": 1,\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"created_at\": \"2024-02-15T16:32:57.018467Z\",\n \"created_by\": {\n \"type\": \"organization\",\n \"username\": \"acme\",\n \"name\": \"Acme Corp, Inc.\",\n \"github_url\": \"https://github.com/acme\",\n },\n \"configuration\": {\n \"hardware\": \"gpu-t4\",\n \"min_instances\": 1,\n \"max_instances\": 5\n }\n }\n }\n ]\n}\n```\n", - "operationId": "deployments.list", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "next": { - "description": "A URL pointing to the next page of deployment objects if any", - "nullable": true, - "type": "string" - }, - "previous": { - "description": "A URL pointing to the previous page of deployment objects if any", - "nullable": true, - "type": "string" - }, - "results": { - "description": "An array containing a page of deployment objects", - "items": { - "properties": { - "current_release": { - "properties": { - "configuration": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "type": "integer" - } - }, - "type": "object" - }, - "created_at": { - "description": "The time the release was created.", - "format": "date-time", - "type": "string" - }, - "created_by": { - "properties": { - "github_url": { - "description": "The GitHub URL of the account that created the release.", - "format": "uri", - "type": "string" - }, - "name": { - "description": "The name of the account that created the release.", - "type": "string" - }, - "type": { - "description": "The account type of the creator. Can be a user or an organization.", - "enum": [ - "organization", - "user" - ], - "type": "string" - }, - "username": { - "description": "The username of the account that created the release.", - "type": "string" - } - }, - "type": "object" - }, - "model": { - "description": "The model identifier string in the format of `{model_owner}/{model_name}`.", - "type": "string" - }, - "number": { - "description": "The release number. This is an auto-incrementing integer that starts at 1, and is set automatically when a deployment is created.", - "type": "integer" - }, - "version": { - "description": "The ID of the model version used in the release.", - "type": "string" - } - }, - "type": "object" - }, - "name": { - "description": "The name of the deployment.", - "type": "string" - }, - "owner": { - "description": "The owner of the deployment.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "List deployments" - }, - "post": { - "description": "Create a new deployment:\n\nExample cURL request:\n\n```console\ncurl -s \\\n -X POST \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"my-app-image-generator\",\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"hardware\": \"gpu-t4\",\n \"min_instances\": 0,\n \"max_instances\": 3\n }' \\\n https://api.replicate.com/v1/deployments\n```\n\nThe response will be a JSON object describing the deployment:\n\n```json\n{\n \"owner\": \"acme\",\n \"name\": \"my-app-image-generator\",\n \"current_release\": {\n \"number\": 1,\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"created_at\": \"2024-02-15T16:32:57.018467Z\",\n \"created_by\": {\n \"type\": \"organization\",\n \"username\": \"acme\",\n \"name\": \"Acme Corp, Inc.\",\n \"github_url\": \"https://github.com/acme\",\n },\n \"configuration\": {\n \"hardware\": \"gpu-t4\",\n \"min_instances\": 1,\n \"max_instances\": 5\n }\n }\n}\n```\n", - "operationId": "deployments.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model. Possible values can be retrieved from the `hardware.list` endpoint.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "maximum": 20, - "minimum": 0, - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "maximum": 5, - "minimum": 0, - "type": "integer" - }, - "model": { - "description": "The full name of the model that you want to deploy e.g. stability-ai/sdxl.", - "type": "string" - }, - "name": { - "description": "The name of the deployment.", - "type": "string" - }, - "version": { - "description": "The 64-character string ID of the model version that you want to deploy.", - "type": "string" - } - }, - "required": [ - "name", - "model", - "version", - "hardware", - "min_instances", - "max_instances" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "current_release": { - "properties": { - "configuration": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "type": "integer" - } - }, - "type": "object" - }, - "created_at": { - "description": "The time the release was created.", - "format": "date-time", - "type": "string" - }, - "created_by": { - "properties": { - "github_url": { - "description": "The GitHub URL of the account that created the release.", - "format": "uri", - "type": "string" - }, - "name": { - "description": "The name of the account that created the release.", - "type": "string" - }, - "type": { - "description": "The account type of the creator. Can be a user or an organization.", - "enum": [ - "organization", - "user" - ], - "type": "string" - }, - "username": { - "description": "The username of the account that created the release.", - "type": "string" - } - }, - "type": "object" - }, - "model": { - "description": "The model identifier string in the format of `{model_owner}/{model_name}`.", - "type": "string" - }, - "number": { - "description": "The release number.", - "type": "integer" - }, - "version": { - "description": "The ID of the model version used in the release.", - "type": "string" - } - }, - "type": "object" - }, - "name": { - "description": "The name of the deployment.", - "type": "string" - }, - "owner": { - "description": "The owner of the deployment.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "Create a deployment" - } - }, - "/deployments/{deployment_owner}/{deployment_name}": { - "delete": { - "description": "Delete a deployment\n\nDeployment deletion has some restrictions:\n\n- You can only delete deployments that have been offline and unused for at least 15 minutes.\n\nExample cURL request:\n\n```command\ncurl -s -X DELETE \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/deployments/acme/my-app-image-generator\n```\n\nThe response will be an empty 204, indicating the deployment has been deleted.\n", - "operationId": "deployments.delete", - "parameters": [ - { - "description": "The name of the user or organization that owns the deployment.\n", - "in": "path", - "name": "deployment_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the deployment.\n", - "in": "path", - "name": "deployment_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - } - }, - "summary": "Delete a deployment" - }, - "get": { - "description": "Get information about a deployment by name including the current release.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/deployments/replicate/my-app-image-generator\n```\n\nThe response will be a JSON object describing the deployment:\n\n```json\n{\n \"owner\": \"acme\",\n \"name\": \"my-app-image-generator\",\n \"current_release\": {\n \"number\": 1,\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"created_at\": \"2024-02-15T16:32:57.018467Z\",\n \"created_by\": {\n \"type\": \"organization\",\n \"username\": \"acme\",\n \"name\": \"Acme Corp, Inc.\",\n \"github_url\": \"https://github.com/acme\",\n },\n \"configuration\": {\n \"hardware\": \"gpu-t4\",\n \"min_instances\": 1,\n \"max_instances\": 5\n }\n }\n}\n```\n", - "operationId": "deployments.get", - "parameters": [ - { - "description": "The name of the user or organization that owns the deployment.\n", - "in": "path", - "name": "deployment_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the deployment.\n", - "in": "path", - "name": "deployment_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "current_release": { - "properties": { - "configuration": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "type": "integer" - } - }, - "type": "object" - }, - "created_at": { - "description": "The time the release was created.", - "format": "date-time", - "type": "string" - }, - "created_by": { - "properties": { - "github_url": { - "description": "The GitHub URL of the account that created the release.", - "format": "uri", - "type": "string" - }, - "name": { - "description": "The name of the account that created the release.", - "type": "string" - }, - "type": { - "description": "The account type of the creator. Can be a user or an organization.", - "enum": [ - "organization", - "user" - ], - "type": "string" - }, - "username": { - "description": "The username of the account that created the release.", - "type": "string" - } - }, - "type": "object" - }, - "model": { - "description": "The model identifier string in the format of `{model_owner}/{model_name}`.", - "type": "string" - }, - "number": { - "description": "The release number.", - "type": "integer" - }, - "version": { - "description": "The ID of the model version used in the release.", - "type": "string" - } - }, - "type": "object" - }, - "name": { - "description": "The name of the deployment.", - "type": "string" - }, - "owner": { - "description": "The owner of the deployment.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "Get a deployment" - }, - "patch": { - "description": "Update properties of an existing deployment, including hardware, min/max instances, and the deployment's underlying model [version](https://replicate.com/docs/how-does-replicate-work#versions).\n\nExample cURL request:\n\n```console\ncurl -s \\\n -X PATCH \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\"min_instances\": 3, \"max_instances\": 10}' \\\n https://api.replicate.com/v1/deployments/acme/my-app-image-generator\n```\n\nThe response will be a JSON object describing the deployment:\n\n```json\n{\n \"owner\": \"acme\",\n \"name\": \"my-app-image-generator\",\n \"current_release\": {\n \"number\": 2,\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"created_at\": \"2024-02-15T16:32:57.018467Z\",\n \"created_by\": {\n \"type\": \"organization\",\n \"username\": \"acme\",\n \"name\": \"Acme Corp, Inc.\",\n \"github_url\": \"https://github.com/acme\",\n },\n \"configuration\": {\n \"hardware\": \"gpu-t4\",\n \"min_instances\": 3,\n \"max_instances\": 10\n }\n }\n}\n```\n\nUpdating any deployment properties will increment the `number` field of the `current_release`.\n", - "operationId": "deployments.update", - "parameters": [ - { - "description": "The name of the user or organization that owns the deployment.\n", - "in": "path", - "name": "deployment_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the deployment.\n", - "in": "path", - "name": "deployment_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model. Possible values can be retrieved from the `hardware.list` endpoint.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "maximum": 20, - "minimum": 0, - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "maximum": 5, - "minimum": 0, - "type": "integer" - }, - "version": { - "description": "The ID of the model version that you want to deploy", - "type": "string" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "current_release": { - "properties": { - "configuration": { - "properties": { - "hardware": { - "description": "The SKU for the hardware used to run the model.", - "type": "string" - }, - "max_instances": { - "description": "The maximum number of instances for scaling.", - "type": "integer" - }, - "min_instances": { - "description": "The minimum number of instances for scaling.", - "type": "integer" - } - }, - "type": "object" - }, - "created_at": { - "description": "The time the release was created.", - "format": "date-time", - "type": "string" - }, - "created_by": { - "properties": { - "github_url": { - "description": "The GitHub URL of the account that created the release.", - "format": "uri", - "type": "string" - }, - "name": { - "description": "The name of the account that created the release.", - "type": "string" - }, - "type": { - "description": "The account type of the creator. Can be a user or an organization.", - "enum": [ - "organization", - "user" - ], - "type": "string" - }, - "username": { - "description": "The username of the account that created the release.", - "type": "string" - } - }, - "type": "object" - }, - "model": { - "description": "The model identifier string in the format of `{model_owner}/{model_name}`.", - "type": "string" - }, - "number": { - "description": "The release number.", - "type": "integer" - }, - "version": { - "description": "The ID of the model version used in the release.", - "type": "string" - } - }, - "type": "object" - }, - "name": { - "description": "The name of the deployment.", - "type": "string" - }, - "owner": { - "description": "The owner of the deployment.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "Update a deployment" - } - }, - "/deployments/{deployment_owner}/{deployment_name}/predictions": { - "post": { - "description": "Start a new prediction for a deployment of a model using inputs you provide.\n\nExample request body:\n\n```json\n{\n \"input\": {\n \"text\": \"Alice\"\n }\n}\n```\n\nExample cURL request:\n\n```console\ncurl -s -X POST \\\n -d '{\"input\": {\"text\": \"Alice\"}}' \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H 'Content-Type: application/json' \\\n \"https://api.replicate.com/v1/deployments/replicate/hello-world/predictions\"\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"86b6trbv99rgp0cf1h886f69ew\",\n \"model\": \"replicate/hello-world\",\n \"version\": \"dp-8e43d61c333b5ddc7a921130bc3ab3ea\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"logs\": \"\",\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2024-04-23T18:55:52.138Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/86b6trbv99rgp0cf1h886f69ew/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/86b6trbv99rgp0cf1h886f69ew\"\n }\n}\n```\n\nAs models can take several seconds or more to run, the output will not be available immediately. To get the final result of the prediction you should either provide a `webhook` HTTPS URL for us to call when the results are ready, or poll the [get a prediction](#predictions.get) endpoint until it has finished.\n\nInput and output (including any files) will be automatically deleted after an hour, so you must save a copy of any files in the output if you'd like to continue using them.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n", - "operationId": "deployments.predictions.create", - "parameters": [ - { - "description": "The name of the user or organization that owns the deployment.\n", - "in": "path", - "name": "deployment_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the deployment.\n", - "in": "path", - "name": "deployment_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/prediction_request" - } - } - } - }, - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Create a prediction using a deployment" - } - }, - "/hardware": { - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/hardware\n```\n\nThe response will be a JSON array of hardware objects:\n\n```json\n[\n {\"name\": \"CPU\", \"sku\": \"cpu\"},\n {\"name\": \"Nvidia T4 GPU\", \"sku\": \"gpu-t4\"},\n {\"name\": \"Nvidia A40 GPU\", \"sku\": \"gpu-a40-small\"},\n {\"name\": \"Nvidia A40 (Large) GPU\", \"sku\": \"gpu-a40-large\"},\n]\n```\n", - "operationId": "hardware.list", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "items": { - "properties": { - "name": { - "description": "The name of the hardware.", - "type": "string" - }, - "sku": { - "description": "The SKU of the hardware.", - "type": "string" - } - }, - "type": "object" - }, - "type": "array" - } - } - }, - "description": "Success" - } - }, - "summary": "List available hardware for models" - } - }, - "/models": { - "get": { - "description": "Get a paginated list of public models.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models\n```\n\nThe response will be a paginated JSON array of model objects:\n\n```json\n{\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"url\": \"https://replicate.com/acme/hello-world\",\n \"owner\": \"acme\",\n \"name\": \"hello-world\",\n \"description\": \"A tiny model that says hello\",\n \"visibility\": \"public\",\n \"github_url\": \"https://github.com/replicate/cog-examples\",\n \"paper_url\": null,\n \"license_url\": null,\n \"run_count\": 5681081,\n \"cover_image_url\": \"...\",\n \"default_example\": {...},\n \"latest_version\": {...}\n }\n ]\n}\n```\n\nThe `cover_image_url` string is an HTTPS URL for an image file. This can be:\n\n- An image uploaded by the model author.\n- The output file of the example prediction, if the model author has not set a cover image.\n- The input file of the example prediction, if the model author has not set a cover image and the example prediction has no output file.\n- A generic fallback image.\n", - "operationId": "models.list", - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "List public models" - }, - "post": { - "description": "Create a model.\n\nExample cURL request:\n\n```console\ncurl -s -X POST \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H 'Content-Type: application/json' \\\n -d '{\"owner\": \"alice\", \"name\": \"my-model\", \"description\": \"An example model\", \"visibility\": \"public\", \"hardware\": \"cpu\"}' \\\n https://api.replicate.com/v1/models\n```\n\nThe response will be a model object in the following format:\n\n```json\n{\n \"url\": \"https://replicate.com/alice/my-model\",\n \"owner\": \"alice\",\n \"name\": \"my-model\",\n \"description\": \"An example model\",\n \"visibility\": \"public\",\n \"github_url\": null,\n \"paper_url\": null,\n \"license_url\": null,\n \"run_count\": 0,\n \"cover_image_url\": null,\n \"default_example\": null,\n \"latest_version\": null,\n}\n```\n", - "operationId": "models.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "cover_image_url": { - "description": "A URL for the model's cover image. This should be an image file.", - "type": "string" - }, - "description": { - "description": "A description of the model.", - "type": "string" - }, - "github_url": { - "description": "A URL for the model's source code on GitHub.", - "type": "string" - }, - "hardware": { - "description": "The SKU for the hardware used to run the model. Possible values can be retrieved from the `hardware.list` endpoint.", - "type": "string" - }, - "license_url": { - "description": "A URL for the model's license.", - "type": "string" - }, - "name": { - "description": "The name of the model. This must be unique among all models owned by the user or organization.", - "type": "string" - }, - "owner": { - "description": "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.", - "type": "string" - }, - "paper_url": { - "description": "A URL for the model's paper.", - "type": "string" - }, - "visibility": { - "description": "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.", - "enum": [ - "public", - "private" - ], - "type": "string" - } - }, - "required": [ - "owner", - "name", - "visibility", - "hardware" - ], - "type": "object" - } - } - }, - "required": true - }, - "responses": { - "201": { - "description": "Success" - } - }, - "summary": "Create a model" - } - }, - "/models/{model_owner}/{model_name}": { - "delete": { - "description": "Delete a model\n\nModel deletion has some restrictions:\n\n- You can only delete models you own.\n- You can only delete private models.\n- You can only delete models that have versions associated with them (currently these will need to be deleted seperately).\n\nExample cURL request:\n\n```command\ncurl -s -X DELETE \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models/replicate/hello-world\n```\n\nThe response will be an empty 204, indicating the model has been deleted.\n", - "operationId": "models.delete", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "Success" - } - }, - "summary": "Delete a model" - }, - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models/replicate/hello-world\n```\n\nThe response will be a model object in the following format:\n\n```json\n{\n \"url\": \"https://replicate.com/replicate/hello-world\",\n \"owner\": \"replicate\",\n \"name\": \"hello-world\",\n \"description\": \"A tiny model that says hello\",\n \"visibility\": \"public\",\n \"github_url\": \"https://github.com/replicate/cog-examples\",\n \"paper_url\": null,\n \"license_url\": null,\n \"run_count\": 5681081,\n \"cover_image_url\": \"...\",\n \"default_example\": {...},\n \"latest_version\": {...},\n}\n```\n\nThe `cover_image_url` string is an HTTPS URL for an image file. This can be:\n\n- An image uploaded by the model author.\n- The output file of the example prediction, if the model author has not set a cover image.\n- The input file of the example prediction, if the model author has not set a cover image and the example prediction has no output file.\n- A generic fallback image.\n\nThe `default_example` object is a [prediction](#predictions.get) created with this model.\n\nThe `latest_version` object is the model's most recently pushed [version](#models.versions.get).\n", - "operationId": "models.get", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Get a model" - } - }, - "/models/{model_owner}/{model_name}/predictions": { - "post": { - "description": "Start a new prediction for an official model using the inputs you provide.\n\nExample request body:\n\n```json\n{\n \"input\": {\n \"prompt\": \"Write a short poem about the weather.\"\n }\n}\n```\n\nExample cURL request:\n\n```console\ncurl -s -X POST \\\n -d '{\"input\": {\"prompt\": \"Write a short poem about the weather.\"}}' \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H 'Content-Type: application/json' \\\n https://api.replicate.com/v1/models/meta/meta-llama-3-70b-instruct/predictions\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"25s2s4n7rdrgg0cf1httb3myk0\",\n \"model\": \"replicate-internal/llama3-70b-chat-vllm-unquantized\",\n \"version\": \"dp-cf04fe09351e25db628e8b6181276547\",\n \"input\": {\n \"prompt\": \"Write a short poem about the weather.\"\n },\n \"logs\": \"\",\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2024-04-23T19:36:28.355Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/25s2s4n7rdrgg0cf1httb3myk0/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/25s2s4n7rdrgg0cf1httb3myk0\"\n }\n}\n```\n\nAs models can take several seconds or more to run, the output will not be available immediately. To get the final result of the prediction you should either provide a `webhook` HTTPS URL for us to call when the results are ready, or poll the [get a prediction](#predictions.get) endpoint until it has finished.\n\nInput and output (including any files) will be automatically deleted after an hour, so you must save a copy of any files in the output if you'd like to continue using them.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n", - "operationId": "models.predictions.create", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/prediction_request" - } - } - } - }, - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Create a prediction using an official model" - } - }, - "/models/{model_owner}/{model_name}/versions": { - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models/replicate/hello-world/versions\n```\n\nThe response will be a JSON array of model version objects, sorted with the most recent version first:\n\n```json\n{\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"id\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"created_at\": \"2022-04-26T19:29:04.418669Z\",\n \"cog_version\": \"0.3.0\",\n \"openapi_schema\": {...}\n }\n ]\n}\n```\n", - "operationId": "models.versions.list", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "List model versions" - } - }, - "/models/{model_owner}/{model_name}/versions/{version_id}": { - "delete": { - "description": "Delete a model version and all associated predictions, including all output files.\n\nModel version deletion has some restrictions:\n\n- You can only delete versions from models you own.\n- You can only delete versions from private models.\n- You cannot delete a version if someone other than you has run predictions with it.\n- You cannot delete a version if it is being used as the base model for a fine tune/training.\n- You cannot delete a version if it has an associated deployment.\n- You cannot delete a version if another model version is overridden to use it.\n\nExample cURL request:\n\n```command\ncurl -s -X DELETE \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models/replicate/hello-world/versions/5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\n```\n\nThe response will be an empty 202, indicating the deletion request has been accepted. It might take a few minutes to be processed.\n", - "operationId": "models.versions.delete", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The ID of the version.\n", - "in": "path", - "name": "version_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "202": { - "description": "Deletion request has been accepted. It might take a few minutes to be processed." - } - }, - "summary": "Delete a model version" - }, - "get": { - "description": "Example cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/models/replicate/hello-world/versions/5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\n```\n\nThe response will be the version object:\n\n```json\n{\n \"id\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"created_at\": \"2022-04-26T19:29:04.418669Z\",\n \"cog_version\": \"0.3.0\",\n \"openapi_schema\": {...}\n}\n```\n\nEvery model describes its inputs and outputs with [OpenAPI Schema Objects](https://spec.openapis.org/oas/latest.html#schemaObject) in the `openapi_schema` property.\n\nThe `openapi_schema.components.schemas.Input` property for the [replicate/hello-world](https://replicate.com/replicate/hello-world) model looks like this:\n\n```json\n{\n \"type\": \"object\",\n \"title\": \"Input\",\n \"required\": [\n \"text\"\n ],\n \"properties\": {\n \"text\": {\n \"x-order\": 0,\n \"type\": \"string\",\n \"title\": \"Text\",\n \"description\": \"Text to prefix with 'hello '\"\n }\n }\n}\n```\n\nThe `openapi_schema.components.schemas.Output` property for the [replicate/hello-world](https://replicate.com/replicate/hello-world) model looks like this:\n\n```json\n{\n \"type\": \"string\",\n \"title\": \"Output\"\n}\n```\n\nFor more details, see the docs on [Cog's supported input and output types](https://github.com/replicate/cog/blob/75b7802219e7cd4cee845e34c4c22139558615d4/docs/python.md#input-and-output-types)\n", - "operationId": "models.versions.get", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The ID of the version.\n", - "in": "path", - "name": "version_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Get a model version" - } - }, - "/models/{model_owner}/{model_name}/versions/{version_id}/trainings": { - "post": { - "description": "Start a new training of the model version you specify.\n\nExample request body:\n\n```json\n{\n \"destination\": \"{new_owner}/{new_name}\",\n \"input\": {\n \"train_data\": \"https://example.com/my-input-images.zip\",\n },\n \"webhook\": \"https://example.com/my-webhook\",\n}\n```\n\nExample cURL request:\n\n```console\ncurl -s -X POST \\\n -d '{\"destination\": \"{new_owner}/{new_name}\", \"input\": {\"input_images\": \"https://example.com/my-input-images.zip\"}}' \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H 'Content-Type: application/json' \\\n https://api.replicate.com/v1/models/stability-ai/sdxl/versions/da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf/trainings\n```\n\nThe response will be the training object:\n\n```json\n{\n \"id\": \"zz4ibbonubfz7carwiefibzgga\",\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n \"input\": {\n \"input_images\": \"https://example.com/my-input-images.zip\"\n },\n \"logs\": \"\",\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2023-09-08T16:32:56.990893084Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/zz4ibbonubfz7carwiefibzgga/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/zz4ibbonubfz7carwiefibzgga\"\n }\n}\n```\n\nAs 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](#trainings.get) endpoint until it has finished.\n\nWhen a training completes, it creates a new [version](https://replicate.com/docs/how-does-replicate-work#terminology) of the model at the specified destination.\n\nTo find some models to train on, check out the [trainable language models collection](https://replicate.com/collections/trainable-language-models).\n", - "operationId": "trainings.create", - "parameters": [ - { - "description": "The name of the user or organization that owns the model.\n", - "in": "path", - "name": "model_owner", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The name of the model.\n", - "in": "path", - "name": "model_name", - "required": true, - "schema": { - "type": "string" - } - }, - { - "description": "The ID of the version.\n", - "in": "path", - "name": "version_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/training_request" - } - } - } - }, - "responses": { - "201": { - "description": "Success" - } - }, - "summary": "Create a training" - } - }, - "/predictions": { - "get": { - "description": "Get a paginated list of predictions that you've created. This will include predictions created from the API and the website. It will return 100 records per page.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/predictions\n```\n\nThe response will be a paginated JSON array of prediction objects, sorted with the most recent prediction first:\n\n```json\n{\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"completed_at\": \"2023-09-08T16:19:34.791859Z\",\n \"created_at\": \"2023-09-08T16:19:34.907244Z\",\n \"error\": null,\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"metrics\": {\n \"predict_time\": 0.012683\n },\n \"output\": \"hello Alice\",\n \"started_at\": \"2023-09-08T16:19:34.779176Z\",\n \"source\": \"api\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\"\n },\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n }\n ]\n}\n```\n\n`id` will be the unique ID of the prediction.\n\n`source` will indicate how the prediction was created. Possible values are `web` or `api`.\n\n`status` will be the status of the prediction. Refer to [get a single prediction](#predictions.get) for possible values.\n\n`urls` will be a convenience object that can be used to construct new API requests for the given prediction.\n\n`model` will be the model identifier string in the format of `{model_owner}/{model_name}`.\n\n`version` will be the unique ID of model version used to create the prediction.\n", - "operationId": "predictions.list", - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "List predictions" - }, - "post": { - "description": "Start a new prediction for the model version and inputs you provide.\n\nExample request body:\n\n```json\n{\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n }\n}\n```\n\nExample cURL request:\n\n```console\ncurl -s -X POST \\\n -d '{\"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\", \"input\": {\"text\": \"Alice\"}}' \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n -H 'Content-Type: application/json' \\\n https://api.replicate.com/v1/predictions\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"logs\": \"\",\n \"error\": null,\n \"status\": \"starting\",\n \"created_at\": \"2023-09-08T16:19:34.765994657Z\",\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\"\n }\n}\n```\n\nAs models can take several seconds or more to run, the output will not be available immediately. To get the final result of the prediction you should either provide a `webhook` HTTPS URL for us to call when the results are ready, or poll the [get a prediction](#predictions.get) endpoint until it has finished.\n\nInput and output (including any files) will be automatically deleted after an hour, so you must save a copy of any files in the output if you'd like to continue using them.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n", - "operationId": "predictions.create", - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/version_prediction_request" - } - } - } - }, - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Create a prediction" - } - }, - "/predictions/{prediction_id}": { - "get": { - "description": "Get the current state of a prediction.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"logs\": \"\",\n \"output\": \"hello Alice\",\n \"error\": null,\n \"status\": \"succeeded\",\n \"created_at\": \"2023-09-08T16:19:34.765994Z\",\n \"started_at\": \"2023-09-08T16:19:34.779176Z\",\n \"completed_at\": \"2023-09-08T16:19:34.791859Z\",\n \"metrics\": {\n \"predict_time\": 0.012683\n },\n \"urls\": {\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\",\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\"\n }\n}\n```\n\n`status` will be one of:\n\n- `starting`: the prediction 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 prediction.\n- `processing`: the `predict()` method of the model is currently running.\n- `succeeded`: the prediction completed successfully.\n- `failed`: the prediction encountered an error during processing.\n- `canceled`: the prediction was canceled by its creator.\n\nIn 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.\n\nIn the case of failure, `error` will contain the error encountered during the prediction.\n\nTerminated predictions (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 prediction used while running. It won't include time waiting for the prediction to start.\n\nInput and output (including any files) are automatically deleted after an hour, so you must save a copy of any files in the output if you'd like to continue using them.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n", - "operationId": "predictions.get", - "parameters": [ - { - "description": "The ID of the prediction to get.\n", - "in": "path", - "name": "prediction_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Get a prediction" - } - }, - "/predictions/{prediction_id}/cancel": { - "post": { - "operationId": "predictions.cancel", - "parameters": [ - { - "description": "The ID of the prediction to cancel.\n", - "in": "path", - "name": "prediction_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Cancel a prediction" - } - }, - "/trainings": { - "get": { - "description": "Get a paginated list of trainings that you've created. This will include trainings created from the API and the website. It will return 100 records per page.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/trainings\n```\n\nThe response will be a paginated JSON array of training objects, sorted with the most recent training first:\n\n```json\n{\n \"next\": null,\n \"previous\": null,\n \"results\": [\n {\n \"completed_at\": \"2023-09-08T16:41:19.826523Z\",\n \"created_at\": \"2023-09-08T16:32:57.018467Z\",\n \"error\": null,\n \"id\": \"zz4ibbonubfz7carwiefibzgga\",\n \"input\": {\n \"input_images\": \"https://example.com/my-input-images.zip\"\n },\n \"metrics\": {\n \"predict_time\": 502.713876\n },\n \"output\": {\n \"version\": \"...\",\n \"weights\": \"...\"\n },\n \"started_at\": \"2023-09-08T16:32:57.112647Z\",\n \"source\": \"api\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"get\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\",\n \"cancel\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga/cancel\"\n },\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n }\n ]\n}\n```\n\n`id` will be the unique ID of the training.\n\n`source` will indicate how the training was created. Possible values are `web` or `api`.\n\n`status` will be the status of the training. Refer to [get a single training](#trainings.get) for possible values.\n\n`urls` will be a convenience object that can be used to construct new API requests for the given training.\n\n`version` will be the unique ID of model version used to create the training.\n", - "operationId": "trainings.list", - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "List trainings" - } - }, - "/trainings/{training_id}": { - "get": { - "description": "Get the current state of a training.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\n```\n\nThe response will be the training object:\n\n```json\n{\n \"completed_at\": \"2023-09-08T16:41:19.826523Z\",\n \"created_at\": \"2023-09-08T16:32:57.018467Z\",\n \"error\": null,\n \"id\": \"zz4ibbonubfz7carwiefibzgga\",\n \"input\": {\n \"input_images\": \"https://example.com/my-input-images.zip\"\n },\n \"logs\": \"...\",\n \"metrics\": {\n \"predict_time\": 502.713876\n },\n \"output\": {\n \"version\": \"...\",\n \"weights\": \"...\"\n },\n \"started_at\": \"2023-09-08T16:32:57.112647Z\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"get\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\",\n \"cancel\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga/cancel\"\n },\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n}\n```\n\n`status` will be one of:\n\n- `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.\n- `processing`: the `train()` method of the model is currently running.\n- `succeeded`: the training completed successfully.\n- `failed`: the training encountered an error during processing.\n- `canceled`: the training was canceled by its creator.\n\nIn 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.\n\nIn the case of failure, `error` will contain the error encountered during the training.\n\nTerminated 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.\n", - "operationId": "trainings.get", - "parameters": [ - { - "description": "The ID of the training to get.\n", - "in": "path", - "name": "training_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Get a training" - } - }, - "/trainings/{training_id}/cancel": { - "post": { - "operationId": "trainings.cancel", - "parameters": [ - { - "description": "The ID of the training you want to cancel.\n", - "in": "path", - "name": "training_id", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Success" - } - }, - "summary": "Cancel a training" - } - }, - "/webhooks/default/secret": { - "get": { - "description": "Get the signing secret for the default webhook endpoint. This is used to verify that webhook requests are coming from Replicate.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer \u003Cpaste-your-token-here\u003E\" \\\n https://api.replicate.com/v1/webhooks/default/secret\n```\n\nThe response will be a JSON object with a `key` property:\n\n```json\n{\n \"key\": \"...\"\n}\n```\n", - "operationId": "webhooks.default.secret.get", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "key": { - "description": "The signing secret.", - "type": "string" - } - }, - "type": "object" - } - } - }, - "description": "Success" - } - }, - "summary": "Get the signing secret for the default webhook" - } - } - }, - "security": [ - { - "bearerAuth": [] - } - ], - "servers": [ - { - "url": "https://api.replicate.com/v1" - } - ] -} \ No newline at end of file diff --git a/docs/openapi.nswag b/docs/openapi.nswag deleted file mode 100755 index 588643b..0000000 --- a/docs/openapi.nswag +++ /dev/null @@ -1,100 +0,0 @@ -{ - "runtime": "Default", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "json": "", - "url": "openapi.json", - "output": null, - "newLineBehavior": "Auto" - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "clientBaseInterface": null, - "injectHttpClient": true, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "ApiException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": true, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "generatePrepareRequestAndProcessResponseAsAsyncMethods": true, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "useRequestAndResponseSerializationSettings": false, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "{controller}ReplicateApi", - "operationGenerationMode": "MultipleClientsFromOperationId", - "additionalNamespaceUsages": [], - "additionalContractNamespaceUsages": [], - "generateOptionalParameters": true, - "generateJsonMethods": false, - "enforceFlagEnums": false, - "parameterArrayType": "System.Collections.Generic.IEnumerable", - "parameterDictionaryType": "System.Collections.Generic.IDictionary", - "responseArrayType": "System.Collections.Generic.ICollection", - "responseDictionaryType": "System.Collections.Generic.IDictionary", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "Replicate", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTimeOffset", - "jsonConverters": null, - "anyType": "object", - "dateTimeType": "System.DateTimeOffset", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.Generic.ICollection", - "arrayInstanceType": "System.Collections.ObjectModel.Collection", - "dictionaryType": "System.Collections.Generic.IDictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "jsonLibrary": "SystemTextJson", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedArrays": false, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "inlineNamedAny": false, - "generateDtoTypes": true, - "generateOptionalPropertiesAsNullable": true, - "generateNullableReferenceTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": null, - "newLineBehavior": "Auto" - } - } -} \ No newline at end of file