Cốt lõi
Lấy thông tin Model
Lấy các khả năng, giá cả và định dạng API của một model
Tham số đường dẫn (Path Parameter)
modelstringpathbắt buộc
ID của model, ví dụ như gpt-5.6-terra hoặc claude-sonnet-4-6.
Phản hồi (Response)
idstring
ID của model.
objectstring
Luôn là
model.owned_bystring
Nhà sản xuất model.
tokenlabobject
Thông tin model của TokenLab, bao gồm các khả năng, giá cả, đơn vị tính phí, giới hạn ngữ cảnh, các định dạng API được chấp nhận, các thao tác và trạng thái vòng đời.
Các trường tokenlab phổ biến bao gồm:
capabilities: văn bản, hình ảnh, video, âm thanh và các khả năng khác.pricing: giá đã xác minh (Verified price). Các trường giá sẽ lànullkhideliveryAvailability.verifiedlàfalse; model như vậy sẽ được tính phí theo giá chính thức (Official price).official_pricing: giá chính thức (Official price). Các yêu cầu do Official phân phối sẽ được tính phí theo mức giá này.max_input_tokensvàmax_output_tokens: giới hạn ngữ cảnh và đầu ra.accepted_request_formats: các định dạng API được hỗ trợ.supported_operations: các thao tác như chuyển đổi văn bản thành hình ảnh hoặc hình ảnh thành video.request_format_summary: đối với mỗi thao tác, bao gồm endpoint yêu cầu, các tham số được hỗ trợ, các giá trị và phạm vi được chấp nhận, cùng các giới hạn. Hãy đọc kỹ phần này trước khi bạn xây dựng một yêu cầu không phải dạng chat.lifecycle: tình trạng sẵn có, ngày phát hành, ngày ngừng hỗ trợ hoặc model thay thế.
Một số model đa phương tiện cũng bao gồm trạng thái đề xuất và thời gian cập nhật. Các đề xuất có thể thay đổi theo tình trạng sẵn có và hiệu suất, vì vậy đừng mã hóa cứng (hard-code) thứ tự của chúng.
Ví dụ
curl "https://api.tokenlab.sh/v1/models/gpt-5.6-terra"{
"id": "gpt-5.6-terra",
"object": "model",
"owned_by": "openai",
"tokenlab": {
"category": "chat",
"capabilities": ["coding", "json-mode", "prompt-cache", "reasoning", "tool-use", "vision"],
"accepted_request_formats": ["openai_chat_completions", "openai_responses"]
}
}Không cần API key. Một model không xác định hoặc không khả dụng sẽ trả về lỗi 404 model_not_found. Để chỉ đọc giá của một model, hãy sử dụng Lấy giá Model.
curl -X GET "https://example.com/v1/models/string"{ "id": "string", "object": "model", "created": 0, "owned_by": "string", "tokenlab": { "aliases": [ "string" ], "deliveryAvailability": { "verified": true, "official": true, "operations": { "property1": { "verified": true, "official": true }, "property2": { "verified": true, "official": true } } }, "pricing": { "input_per_1m": "string", "output_per_1m": "string", "per_request": "string", "is_lock_price": true, "currency": "USD" }, "official_pricing": { "input_per_1m": "string", "output_per_1m": "string", "per_request": "string", "is_lock_price": true, "currency": "USD" }, "capabilities": [ "string" ], "providers": [ "string" ], "max_input_tokens": 0, "max_output_tokens": 0, "category": "string", "pricing_unit": "string", "cache_pricing": {}, "official_cache_pricing": {}, "has_complex_pricing": true, "supported_operations": [ "string" ], "pricing_summary": {}, "pricing_provenance": {}, "lifecycle": { "stage": "active", "reason": "string", "replacement_model": "string", "released_at": "2019-08-24T14:15:22Z", "deprecated_at": "2019-08-24T14:15:22Z", "retired_at": "2019-08-24T14:15:22Z", "sunset_at": "2019-08-24T14:15:22Z", "latest": true, "latest_source": "auto", "latest_window_days": 0 }, "commercial": { "user_charge_policy": "paid", "free_reason": "platform", "free_until": "2019-08-24T14:15:22Z" }, "badges": [ { "key": "free", "tone": "green", "priority": 0, "tooltip": { "key": "string", "values": { "property1": "string", "property2": "string" } } } ], "request_format_summary": { "public_operations": [ "string" ], "supported_parameters": [ "string" ], "feature_flags": { "property1": true, "property2": true }, "output_formats": [ "string" ], "service_limits": { "online_rpm": 0, "concurrency": 0, "offline_inference": true, "offline_tpd": "string", "prompt_max_characters": 0 }, "required_selectors": [ "string" ], "optional_selectors": [ "string" ], "resolutions": [ "string" ], "resolutions_label": "string", "durations": [ "string" ], "durations_label": "string", "aspect_ratios": [ "string" ], "aspect_ratios_label": "string", "request_endpoint": "string", "status_mode": "string", "request_shape_mode": "string", "recommended_request_summary": {}, "request_endpoint_by_operation": { "property1": "string", "property2": "string" }, "operation_constraints": [ { "operation": "string", "request_endpoint": "string", "request_shape_mode": "string", "status_mode": "string", "supported_parameters": [ "string" ], "required_selectors": [ "string" ], "optional_selectors": [ "string" ], "documented_inputs": [ "string" ], "allowed_resolutions": [ "string" ], "allowed_durations": [ "string" ], "allowed_aspect_ratios": [ "string" ], "notes": [ "string" ], "parameter_options": { "property1": [ "string" ], "property2": [ "string" ] }, "parameter_value_constraints": { "property1": { "enum": [ "string" ], "enumCaseInsensitive": true, "maxItems": 0, "maxInteger": 0, "when": { "parameter": "string", "equals": "string" } }, "property2": { "enum": [ "string" ], "enumCaseInsensitive": true, "maxItems": 0, "maxInteger": 0, "when": { "parameter": "string", "equals": "string" } } }, "parameter_ranges": { "property1": { "minimum": 0, "maximum": 0 }, "property2": { "minimum": 0, "maximum": 0 } }, "compatibility_only_parameters": [ "string" ], "parameter_defaults": { "property1": "string", "property2": "string" }, "parameter_notes": { "property1": "string", "property2": "string" }, "input_limits": { "property1": { "minItems": 0, "maxItems": 0 }, "property2": { "minItems": 0, "maxItems": 0 } } } ] }, "request_format_details": { "public_operations": [ "string" ], "supported_parameters": [ "string" ], "feature_flags": { "property1": true, "property2": true }, "output_formats": [ "string" ], "service_limits": { "online_rpm": 0, "concurrency": 0, "offline_inference": true, "offline_tpd": "string", "prompt_max_characters": 0 }, "required_selectors": [ "string" ], "optional_selectors": [ "string" ], "resolutions": [ "string" ], "resolutions_label": "string", "durations": [ "string" ], "durations_label": "string", "aspect_ratios": [ "string" ], "aspect_ratios_label": "string", "request_endpoint": "string", "status_mode": "string", "request_shape_mode": "string", "recommended_request_summary": {}, "request_endpoint_by_operation": { "property1": "string", "property2": "string" }, "operation_constraints": [ { "operation": "string", "request_endpoint": "string", "request_shape_mode": "string", "status_mode": "string", "supported_parameters": [ "string" ], "required_selectors": [ "string" ], "optional_selectors": [ "string" ], "documented_inputs": [ "string" ], "allowed_resolutions": [ "string" ], "allowed_durations": [ "string" ], "allowed_aspect_ratios": [ "string" ], "notes": [ "string" ], "parameter_options": { "property1": [ "string" ], "property2": [ "string" ] }, "parameter_value_constraints": { "property1": { "enum": [ "string" ], "enumCaseInsensitive": true, "maxItems": 0, "maxInteger": 0, "when": { "parameter": "string", "equals": "string" } }, "property2": { "enum": [ "string" ], "enumCaseInsensitive": true, "maxItems": 0, "maxInteger": 0, "when": { "parameter": "string", "equals": "string" } } }, "parameter_ranges": { "property1": { "minimum": 0, "maximum": 0 }, "property2": { "minimum": 0, "maximum": 0 } }, "compatibility_only_parameters": [ "string" ], "parameter_defaults": { "property1": "string", "property2": "string" }, "parameter_notes": { "property1": "string", "property2": "string" }, "input_limits": { "property1": { "minItems": 0, "maxItems": 0 }, "property2": { "minItems": 0, "maxItems": 0 } } } ], "documented_inputs": [ "string" ], "documented_outputs": [ "string" ], "fallback_status_endpoints": [ "string" ], "notes": [ "string" ], "recommended_request": {} }, "accepted_request_formats": [ "openai_chat_completions" ] }}