POST/v2/gen-ai/custom_models/import

Import Custom Model

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

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

8 body fields
accept_hf_token_storagebooleanoptional
Whether the caller accepts storage of their HuggingFace token for gated model access
accept_terms_and_conditionsbooleanoptional
Whether the caller accepts the terms and conditions for importing this model
descriptionstringoptional
Description of the model
namestringoptional
Name for the imported model
preferred_gpu_regionstringoptional
Preferred GPU region for deployment
source_refobjectoptional
Reference to the original source of the model
source_typestringoptional
Source from which the model was imported
Allowed:SOURCE_TYPE_UNSPECIFIEDSOURCE_TYPE_HUGGINGFACESOURCE_TYPE_SPACES_BUCKETSOURCE_TYPE_SDK_UPLOADSOURCE_TYPE_FINE_TUNINGDefault:SOURCE_TYPE_UNSPECIFIED
tagsobjectoptional
User-defined tags for organizing models

6 status codes
200A successful response.
errorstringoptional
import_jobobjectoptional
Import job tracking for a custom model
modelobjectoptional
Custom model - user-imported model from HuggingFace, Spaces, etc.
validation_stepsarray<object>optional
Validation steps performed during import
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
404The resource was not found.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.

Error handling

A 401 is returned: Authentication failed due to invalid credentials. A 404 is returned: The resource was not found. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.