---
title: "Create Asset"
method: POST
path: "/v1/assets"
tags: ["assets"]
---

# Create Asset

`POST /v1/assets`

Create an asset on the asset library.

## Request body

- CreateAssetRequest — Create asset request. It is used to represent the request of create asset API.
  - `asset_type` 'file' | 'checkpoint' | 'lora' | 'textual_inversion' | 'vae' | 'latent', required — Asset type. It is used to distinguish between different supported assets.
  - `data` union, required — Asset data. It shows the type of data for an asset.
    - FileData — Data class for `file` asset type.
      - `asset_type` 'file' — Asset type. It is used to distinguish between different supported assets.
      - `file_format` 'unknown' | 'png' | 'jpg' | 'jpeg' | 'txt' | 'mp3' | 'wav' | 'jsonl' — File extension supported for the asset.
      - `preview_url` string, nullable — Preview URL for this asset.
      - `version` string — Asset version. Default value is empty.
    - CheckpointData — Data class for `checkpoint` asset type.
      - `asset_type` 'checkpoint' — Asset type. It is used to distinguish between different supported assets.
      - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
      - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
      - `file_format` 'safetensors' | 'pt' — File format for the asset.
    - LoraData — Data class for `lora` asset type.
      - `asset_type` 'lora' — Asset type. It is used to distinguish between different supported assets.
      - `checkpoint` string, nullable — Base checkpoint used with LoRA.
      - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
      - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
      - `file_format` 'safetensors' | 'pt' — File format for the asset.
      - `trigger_words` string[], nullable — Trigger words used for tuning.
    - TextualInversionData — Data class for `textual_inversion` asset type.
      - `asset_type` 'textual_inversion' — Asset type. It is used to distinguish between different supported assets.
      - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
      - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
      - `file_format` 'safetensors' | 'pt' — File format for the asset.
      - `trigger_words` string[] — Trigger words using for tuning.
    - VAEData — Data class for `vae` asset type.
      - `asset_type` 'vae' — Asset type. It is used to distinguish between different supported assets.
      - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
      - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
      - `file_format` 'safetensors' | 'pt' — File format for the asset.
    - LatentData — Data class for `latent` asset type.
      - `asset_type` 'latent' — Asset type. It is used to distinguish between different supported assets.
      - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
      - `file_format` 'safetensors' | 'pt' — File format for the asset.
  - `description` string, nullable, required — Asset description. It is used to provide more information.
  - `hf_repo` string, nullable — HuggingFace repository.
  - `hf_token_secret` string, nullable — OctoAI secret name for HuggingFace token.
  - `is_public` boolean — True if asset is public.
  - `name` string, required — Asset name. A unique name for the asset.
  - `skip_validation` boolean — Skip asset validation.
  - `transfer_api_type` 'presigned-url' | 'sts' | 'gcp-oauth' | 'any' — Asset transfer API types.
  - `url` string, uri, nullable — Upload the contents of the url as the asset.

## Response `200`

Successful Response

- CreateAssetResponse — Create asset response. It is used to represent the response of create asset API.
  - `asset` Asset, required — Asset model. It is used to represent an asset in asset library.
    - `asset_type` 'file' | 'checkpoint' | 'lora' | 'textual_inversion' | 'vae' | 'latent', required — Asset type. It is used to distinguish between different supported assets.
    - `created_at` string, required — Asset creation time.
    - `data` union, required — Asset data. It shows the type of data for an asset.
      - FileData — Data class for `file` asset type.
        - `asset_type` 'file' — Asset type. It is used to distinguish between different supported assets.
        - `file_format` 'unknown' | 'png' | 'jpg' | 'jpeg' | 'txt' | 'mp3' | 'wav' | 'jsonl' — File extension supported for the asset.
        - `preview_url` string, nullable — Preview URL for this asset.
        - `version` string — Asset version. Default value is empty.
      - CheckpointData — Data class for `checkpoint` asset type.
        - `asset_type` 'checkpoint' — Asset type. It is used to distinguish between different supported assets.
        - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
        - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
        - `file_format` 'safetensors' | 'pt' — File format for the asset.
      - LoraData — Data class for `lora` asset type.
        - `asset_type` 'lora' — Asset type. It is used to distinguish between different supported assets.
        - `checkpoint` string, nullable — Base checkpoint used with LoRA.
        - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
        - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
        - `file_format` 'safetensors' | 'pt' — File format for the asset.
        - `trigger_words` string[], nullable — Trigger words used for tuning.
      - TextualInversionData — Data class for `textual_inversion` asset type.
        - `asset_type` 'textual_inversion' — Asset type. It is used to distinguish between different supported assets.
        - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
        - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
        - `file_format` 'safetensors' | 'pt' — File format for the asset.
        - `trigger_words` string[] — Trigger words using for tuning.
      - VAEData — Data class for `vae` asset type.
        - `asset_type` 'vae' — Asset type. It is used to distinguish between different supported assets.
        - `data_type` 'fp16' | 'fp32' | 'int4' | 'int8' — Data type for the asset.
        - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
        - `file_format` 'safetensors' | 'pt' — File format for the asset.
      - LatentData — Data class for `latent` asset type.
        - `asset_type` 'latent' — Asset type. It is used to distinguish between different supported assets.
        - `engine` 'text/llama-2-7b' | 'text/llama-2-13b' | 'text/llama-2-70b' | 'text/llama-3-8b' | 'text/llama-3-70b' | 'text/codellama-7b' | 'text/codellama-13b' | 'text/codellama-34b' | 'text/codellama-70b' | 'text/mistral-7b' | 'text/mistral-nemo' | 'text/mixtral-8x7b' | 'text/llama-3.1-8b' | 'text/llama-3.1-70b' | 'text/llama-3.1-405b' | 'image/controlnet-sd15' | 'image/controlnet-sdxl' | 'image/stable-diffusion-v1-5' | 'image/stable-diffusion-xl-v1-0' | 'image/stable-diffusion-v3-medium' | 'image/stable-diffusion-ssd' | 'image/flux-dev' | 'image/flux-schnell' | 'audio/tortoise-tts' | 'audio/rvc' | 'video/svd', required — Base Engine names supported by asset library.
        - `file_format` 'safetensors' | 'pt' — File format for the asset.
    - `description` string, required — Asset description. It is used to provide more information.
    - `file_structure` 'unknown' | 'single_file' | 'multiple_files' — File structure for the asset.
    - `hf_repo` string, nullable — Hugging Face repository.
    - `id` string, required — Asset id. A unique identifier for the asset.
    - `is_public` boolean — True if asset is public.
    - `name` string, required — Asset name. A unique name for the asset.
    - `size_bytes` integer, required — Asset size in bytes.
    - `status` 'ready_to_upload' | 'uploaded' | 'ready' | 'deleted' | 'rejected' | 'error' | 'uploading', required — Status of an asset in asset library.
    - `status_details` string, required — Asset status details.
    - `status_info` object — Asset status info. Provides extra information about the asset.
    - `tenant_uuid` string, uuid, required — Asset tenant ID. This is unique for each OctoAI user.
    - `url` string, uri, nullable — A unique URL for the asset.
  - `token` string — Unused. Present for compatibility purposes.
  - `transfer_api` union, required — Asset transfer API type.
    - PresignedUrlTransferApi — Presigned URL asset transfer API.
      - `get_url` string, required — Get asset URL. Used to download the asset.
      - `put_url` string, required — Asset URL to upload.
      - `type` 'presigned-url' — URL type for the asset.
    - StsTransferApi — STS asset transfer API.
      - `aws_access_key_id` string, required — AWS access key. Used for asset transfer.
      - `aws_region` string, required — AWS region. Used for asset transfer.
      - `aws_secret_access_key` string, required — AWS secret access key.
      - `aws_session_token` string, nullable — AWS session token. Used for asset transfer.
      - `s3_bucket` string, required — S3 bucket. Used for asset transfer.
      - `s3_endpoint_url` string, nullable — S3 endpoint URL. Used for asset transfer.
      - `s3_key` string, required — S3 key. Used for asset transfer.
      - `s3_url` string, required — S3 full URL. Used for asset transfer.
      - `type` 'sts' — URL type for the asset.
    - GcsOauthTransferApi — STS asset transfer API.
      - `gcp_region` string, required — GCP region. Used for asset transfer.
      - `gs_bucket` string, required — GS bucket. Used for asset transfer.
      - `gs_key` string, required — GS key. Used for asset transfer.
      - `gs_url` string, required — GS full URL. Used for asset transfer.
      - `token` string, required — GCS oauth token. Used for asset transfer.
      - `type` 'gcp-oauth' — URL type for the asset.
    - NoTransferApi — Type to avoid Optional[TransferApi] so openapi-generator can work. In this class, type is not added to TransferApiType because it is not a valid TransferApiType. It exists only to note that no TransferApi is defined.
      - `type` 'none' — URL type for the asset.

## Other responses

- `422` — Validation Error

## Changes

- **2024-09-09** `b157279528e4` — 1 breaking, 41 warning, 44 info
  - added `#/components/schemas/GcsOauthTransferApi` to the `transfer_api` response property `oneOf` list for the response status `200`
  - added the new `image/flux-dev` enum value to the `asset/allOf[subschema #1: Asset]/data/oneOf[subschema #2: CheckpointData]/engine/allOf[subschema #1: BaseEngine]/` response property for the response status `200`
  - added the new `image/flux-dev` enum value to the `asset/allOf[subschema #1: Asset]/data/oneOf[subschema #3: LoraData]/engine/allOf[subschema #1: BaseEngine]/` response property for the response status `200`
  - added the new `image/flux-dev` enum value to the `asset/allOf[subschema #1: Asset]/data/oneOf[subschema #4: TextualInversionData]/engine/allOf[subschema #1: BaseEngine]/` response property for the response status `200`
  - …82 more
- **2024-06-05** `f62e8bbe2b1d` — 3 breaking, 17 warning, 18 info
  - request property `asset_type` was restricted to a list of enum values
  - the `asset_type` request property type changed from no type to `string`
  - the `asset/allOf[subschema #1: Asset]/asset_type` response's property type changed from no type to `string` for status `200`
  - removed `#/components/schemas/AssetType` from the `asset_type` request property `allOf` list
  - …34 more
- …earlier changes not shown

[Full history](https://skmtc.dev/octoml/apis/asset-library-api/changes/v1/assets/post.md)

---

[API](https://skmtc.dev/octoml/apis/asset-library-api.md) · [All operations](https://skmtc.dev/octoml/apis/asset-library-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/octoml/asset-library-api/revisions/b157279528e4/schema)
