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
| Method | Description |
|---|---|
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| page_num | int | No | 1 | Page number, starting from 1 |
| page_size | int | No | 10 | Items per page |
| model_name | str | No | None | Model name (fuzzy search) |
| provider | str | No | None | Provider identifier |
| series_provider | str | No | None | Series provider identifier |
| model_type | str | No | None | Model type |
| view_all_flag | int | No | None | View all flag (1=view all) |
| usage_type | str | No | None | Usage type: "inference" or "train" |
| training_method | str | No | None | Training method: "sft" or "dpo" |
| tags | list[str] | No | None | Tag filter list |
| capability | str | No | None | Capability filter, e.g. "text_to_text" |
| model_type_list | list[str] | No | None | Model type list (multi-select) |
| origin_providers | list[str] | No | None | Origin provider list (multi-select) |
| inputs | list[str] | No | None | Input type list, e.g. ["text"] |
| outputs | list[str] | No | None | Output type list, e.g. ["image"] |
Response
Returns BaseResponse[PageInfo[ModelInfoVO]].
ModelInfoVO fields: see
client.secrets.model_list()above.
Errors
| Code | Exception | When |
|---|---|---|
2000 / 2002 | AuthenticationError | API Key invalid |
2007 | PermissionError | Permission denied |
3001 | AuthenticationError | Token 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:
| Field | Type | Description |
|---|---|---|
| id | str | Provider identifier |
| name | str | Provider display name |
Errors
| Code | Exception | When |
|---|---|---|
2000 / 2002 | AuthenticationError | API Key invalid |
2007 | PermissionError | Permission denied |
3001 | AuthenticationError | Token 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| model_name | str | Yes | -- | Model name |
Response
Returns BaseResponse[PartnerApiPriceResponse].
PartnerApiPriceResponse fields:
| Field | Type | Description |
|---|---|---|
| id | int | Record ID |
| partnerId | int | Tenant ID |
| modelName | str | Model name |
| modelType | str | Model type |
| type | str | Resale type (model / BYOK) |
| originProvider | str | Origin provider |
| seriesProvider | str | Series provider |
| capabilities | str | Model capabilities |
| inputs | set[str] | Input type set |
| outputs | set[str] | Output type set |
| priceExtend | PartnerApiPriceExtendDetail | Price details |
| gmtCreate | datetime | Creation time |
| gmtModified | datetime | Modification time |
PartnerApiPriceExtendDetail fields:
| Field | Type | Description |
|---|---|---|
| llmInput | str | LLM input price (per 1K tokens) |
| llmOutput | str | LLM output price (per 1K tokens) |
| vlmInput | str | VLM input price (per 1K tokens) |
| vlmOutput | str | VLM output price (per 1K tokens) |
| image | str | Image generation price |
| imageEa | str | Image unit price |
| imageStep | str | Image step price |
| video | str | Video generation price |
| audio | str | Audio price |
| tieredPricing | list[TieredPricing] | Tiered pricing list |
| videoPricing | list[VideoPricing] | Video pricing list |
| imagePricing | list[ImagePricing] | Image pricing list |
Errors
| Code | Exception | When |
|---|---|---|
1001 | ValidationError | Invalid request parameters |
1002 | NotFoundError | Model not found |
2000 / 2002 | AuthenticationError | API Key invalid |
2007 | PermissionError | Permission denied |
3000 | APIError | Invalid request (observed with non-numeric id) |
3001 | AuthenticationError | Token expired and refresh failed |