dots.v2.genAi.custom_models.importEscaped.post()

Generated on 5 Nov 2026 from DoTs version v1.23.0

Usage

client.v2.genAi.custom_models.importEscaped.post(body: ApiImportCustomModelInputPublic, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | ApiImportCustomModelOutputPublic>

Description

To import a custom model, send a POST request to /v2/gen-ai/custom_models/import.

Parameters

acceptHfTokenStorage boolean optional

Example: true

Whether the caller accepts storage of their HuggingFace token for gated model access

acceptTermsAndConditions boolean optional

Example: true

Whether the caller accepts the terms and conditions for importing this model

description string optional

Example: Production model for customer support

Description of the model

name string optional

Example: my-mistral-7b

Name for the imported model

preferredGpuRegion string optional

Example: nyc3

Preferred GPU region for deployment

sourceRef object optional

Reference to the original source of the model

Show child properties
accessType string optional

Access level required for the model repository

One of: ACCESS_TYPE_UNSPECIFIED, ACCESS_TYPE_PUBLIC, ACCESS_TYPE_PRIVATE, ACCESS_TYPE_GATED

Default: ACCESS_TYPE_UNSPECIFIED

bucket string optional

Example: example string

Spaces bucket name

commitSha string optional

Example: example string

Git commit SHA of the model version

hfToken string optional

Example: example string

User-provided HuggingFace token for gated/private models (not persisted in source_ref)

prefix string optional

Example: example string

Object prefix path in the bucket

region string optional

Example: example string

Spaces bucket region

repoId string optional

Example: 123e4567-e89b-12d3-a456-426614174000

Huggingface repository identifier

sourceType string optional

Source from which the model was imported

One of: SOURCE_TYPE_UNSPECIFIED, SOURCE_TYPE_HUGGINGFACE, SOURCE_TYPE_SPACES_BUCKET, SOURCE_TYPE_SDK_UPLOAD, SOURCE_TYPE_FINE_TUNING

Default: SOURCE_TYPE_UNSPECIFIED

tags object optional

User-defined tags for organizing models

Show child properties
tags array of strings optional

Example: ["example string"]

List of tag strings

Request Sample

Show Request Sample
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary";
import {
    createDigitalOceanClient,
    DigitalOceanApiKeyAuthenticationProvider,
} from "@digitalocean/dots";

const authProvider = new DigitalOceanApiKeyAuthenticationProvider(process.env.DIGITALOCEAN_TOKEN!);
const adapter = new FetchRequestAdapter(authProvider);
const client = createDigitalOceanClient(adapter);

const response = await client.v2.genAi.custom_models.importEscaped.post({
    acceptHfTokenStorage: true,
    acceptTermsAndConditions: true,
    description: "Production model for customer support",
    name: "my-mistral-7b",
    preferredGpuRegion: "nyc3",
    sourceRef: {
        accessType: "ACCESS_TYPE_UNSPECIFIED",
        bucket: "example string",
        commitSha: "example string",
        hfToken: "example string",
        prefix: "example string",
        region: "example string",
        repoId: "123e4567-e89b-12d3-a456-426614174000",
    },
    sourceType: "SOURCE_TYPE_UNSPECIFIED",
    tags: {
        tags: [
            "example string",
        ],
    },
});

Response Example

Show Response Example
{
  "error": "example string",
  "import_job": {
    "bytes_done": "12345",
    "bytes_total": "12345",
    "completed_at": "2023-01-01T00:00:00Z",
    "created_at": "2023-01-01T00:00:00Z",
    "error_message": "example string",
    "error_step": "example string",
    "files_done": 123,
    "files_total": 123,
    "started_at": "2023-01-01T00:00:00Z",
    "status": "example string",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "model": {
    "active_deployments": [],
    "architecture": "example string",
    "context_length": 123,
    "cost_estimate_per_month": 123,
    "created_at": "2023-01-01T00:00:00Z",
    "description": "example string",
    "error_message": "example string",
    "file_count": 123,
    "input_modalities": [
      "example string"
    ],
    "license": "example string",
    "name": "example name",
    "output_modalities": [
      "example string"
    ],
    "parameters": "12345",
    "source_ref": {
      "access_type": "ACCESS_TYPE_UNSPECIFIED",
      "bucket": "example string",
      "commit_sha": "example string",
      "hf_token": "example string",
      "prefix": "example string",
      "region": "example string",
      "repo_id": "123e4567-e89b-12d3-a456-426614174000"
    },
    "source_type": "SOURCE_TYPE_UNSPECIFIED",
    "status": "STATUS_UNSPECIFIED",
    "storage_region": "example string",
    "tags": {
      "tags": [
        "example string"
      ]
    },
    "team_id": "12345",
    "total_size_bytes": "12345",
    "updated_at": "2023-01-01T00:00:00Z",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  },
  "validation_steps": [
    {
      "error": "example string",
      "name": "example name",
      "passed": true
    }
  ]
}

More Information

See /v2/gen-ai/custom_models/import in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.