StackMoreLayersДокументация
APIReference

Опубликовать версию модели

POST
/models/{model_id}/versions/{model_version_id}/publish/

Accepts the publication and answers at once with its operation, in status publishing; the platform then copies and verifies the version's immutable files, registers it and flips the catalogue in the background. Poll GET /models/{model_id}/ (or the version list): its publication says publishing until every step is done, then published -- only then does the model's own status say published -- or failed with a safe error_code (retryable when the same request may simply be made again). Repeating the request while it runs returns the same operation; different parameters while it runs are a 409.

АвторизацияBearer <token>

StackMoreLayers API token. Send as Authorization: Bearer sml_pat_live_<prefix>.<secret>.

In: header

Параметры пути

model_id*string

Stable model identifier.

Length1 <= length <= 255
model_version_id*string

Immutable model version identifier.

Length1 <= length <= 255

Заголовки

Idempotency-Key?string

Opaque client-generated key. A retry with the same key and body returns the original result instead of repeating the effect.

Match^[!-~]+$
Length8 <= length <= 128

Тело запроса

application/json

Типы TypeScript

Use the request body type in TypeScript.

Ответ

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/models/string/versions/string/publish/" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "string",  "model_id": "string",  "model_version_id": "string",  "status": "publishing",  "error_code": "string",  "retryable": true,  "visibility": "private",  "model_alias": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "finished_at": "2019-08-24T14:15:22Z"}