Skip to main content

Model Gallery — Python SDK

Browse the catalogue of models and their pricing.

Overview​

The Model Gallery resource is the catalogue side of the gateway: paginated model browsing with rich filters, the provider list, and per-model price lookup for the current tenant.

Accessed via client.model_gallery.

Available Operations​

MethodDescription
page()Query model list with pagination
providers()Get the list of model providers
getPrice()Get model API price for the current tenant

page​

Query model list with pagination.

Example Usage​

from wlt import WltClient

client = WltClient(api_key="your-api-key", base_url="https://console.example.com")

# Browse all models
result = client.model_gallery.page(page_num=1, page_size=10)
print(f"Total models: {result.data.total}")
for model in result.data.list:
print(model.modelName, model.provider)

# Filter by criteria
result = client.model_gallery.page(
usage_type="inference",
provider="dashscope",
tags=["New"],
inputs=["text"],
outputs=["text"],
)

Parameters​

ParameterTypeRequiredDefaultDescription
page_numintNo1Page number, starting from 1
page_sizeintNo10Items per page
model_namestrNoNoneModel name (fuzzy search)
providerstrNoNoneProvider identifier
series_providerstrNoNoneSeries provider identifier
model_typestrNoNoneModel type
view_all_flagintNoNoneView all flag (1=view all)
usage_typestrNoNoneUsage type: "inference" or "train"
training_methodstrNoNoneTraining method: "sft" or "dpo"
tagslist[str]NoNoneTag filter list
capabilitystrNoNoneCapability filter, e.g. "text_to_text"
model_type_listlist[str]NoNoneModel type list (multi-select)
origin_providerslist[str]NoNoneOrigin provider list (multi-select)
inputslist[str]NoNoneInput type list, e.g. ["text"]
outputslist[str]NoNoneOutput type list, e.g. ["image"]

Response​

Returns BaseResponse[PageInfo[ModelInfoVO]].

ModelInfoVO fields: see client.secrets.model_list() above.

Errors​

CodeExceptionWhen
2000 / 2002AuthenticationErrorAPI Key invalid
2007PermissionErrorPermission denied
3001AuthenticationErrorToken expired and refresh failed

providers​

Get the list of model providers.

Example Usage​

from wlt import WltClient

client = WltClient(api_key="your-api-key", base_url="https://console.example.com")

providers = client.model_gallery.providers()
for p in providers.data:
print(p.id, p.name)

Parameters​

None.

Response​

Returns BaseResponse[list[ProviderVO]].

ProviderVO fields:

FieldTypeDescription
idstrProvider identifier
namestrProvider display name

Errors​

CodeExceptionWhen
2000 / 2002AuthenticationErrorAPI Key invalid
2007PermissionErrorPermission denied
3001AuthenticationErrorToken expired and refresh failed

getPrice​

Get model API price for the current tenant.

Passing a non-numeric id to the Model Gallery detail lookup has been observed to return code=3000 (APIError, "Invalid request") in production. Use the exact model_name returned by page().

Example Usage​

from wlt import WltClient

client = WltClient(api_key="your-api-key", base_url="https://console.example.com")

price = client.model_gallery.get_price(model_name="Qwen2.5-72B-Instruct")
print(f"Input price: {price.data.priceExtend.llmInput}")
print(f"Output price: {price.data.priceExtend.llmOutput}")

Parameters​

ParameterTypeRequiredDefaultDescription
model_namestrYes--Model name

Response​

Returns BaseResponse[PartnerApiPriceResponse].

PartnerApiPriceResponse fields:

FieldTypeDescription
idintRecord ID
partnerIdintTenant ID
modelNamestrModel name
modelTypestrModel type
typestrResale type (model / BYOK)
originProviderstrOrigin provider
seriesProviderstrSeries provider
capabilitiesstrModel capabilities
inputsset[str]Input type set
outputsset[str]Output type set
priceExtendPartnerApiPriceExtendDetailPrice details
gmtCreatedatetimeCreation time
gmtModifieddatetimeModification time

PartnerApiPriceExtendDetail fields:

FieldTypeDescription
llmInputstrLLM input price (per 1K tokens)
llmOutputstrLLM output price (per 1K tokens)
vlmInputstrVLM input price (per 1K tokens)
vlmOutputstrVLM output price (per 1K tokens)
imagestrImage generation price
imageEastrImage unit price
imageStepstrImage step price
videostrVideo generation price
audiostrAudio price
tieredPricinglist[TieredPricing]Tiered pricing list
videoPricinglist[VideoPricing]Video pricing list
imagePricinglist[ImagePricing]Image pricing list

Errors​

CodeExceptionWhen
1001ValidationErrorInvalid request parameters
1002NotFoundErrorModel not found
2000 / 2002AuthenticationErrorAPI Key invalid
2007PermissionErrorPermission denied
3000APIErrorInvalid request (observed with non-numeric id)
3001AuthenticationErrorToken expired and refresh failed