TokenLab

Cốt lõi

Liệt kê các Model

Liệt kê các model hiện có trên TokenLab

GET
/v1/models

Danh mục model là công khai và không yêu cầu API key. Mỗi mục bao gồm tóm tắt về các khả năng hiện tại, giá cả và định dạng API. Hãy truy xuất thông tin một model cụ thể khi bạn cần chi tiết đầy đủ.

Khi bạn cung cấp API key, TokenLab sẽ xác thực và lọc danh mục dựa trên quyền truy cập model và chính sách phân phối hiệu dụng của key đó. Một key được đặt là verified sẽ liệt kê các model có nguồn cung TokenLab Verified; official sẽ liệt kê các model có nguồn cung Official. Hãy làm mới bộ chọn model của bạn khi key hoặc chính sách phân phối thay đổi. Ghi đè phân phối được hỗ trợ trong yêu cầu sẽ được ưu tiên hơn các thiết lập mặc định của key và workspace.

Query Parameters

categorystringquery

Lọc theo chat, image, video, audio, tts, stt, music, 3d, embedding, rerank, decision, hoặc translation.

recommended_forstringquery

Trả về các đề xuất hiện tại cho một tác vụ như image, video, music, 3d, tts, stt, embedding, rerank, decision, hoặc translation.

providerstringquery

Lọc theo nhà sản xuất model, ví dụ như openai, anthropic, google, hoặc deepseek.

tagstringquery

Lọc theo thẻ khả năng như reasoning, tool-use, vision, hoặc text-to-image. Các giá trị trong tokenlab.capabilities của một model là các thẻ hợp lệ. Để lọc theo loại model, hãy sử dụng category.

viewstringquerymặc định: full

full trả về danh sách đầy đủ các hình thái được mô tả bên dưới. compact trả về danh sách rút gọn để chọn model, gồm id, provider, category, capabilities, giới hạn token, tóm tắt giá, status, deliveryAvailability, supported_operations, và request_endpoint, cùng với view và count ở cấp độ cao nhất.

Phản hồi

objectstring
Luôn là list.
dataarray
Các model với id, owned_by, và tóm tắt tokenlab.

Các trường danh sách phổ biến trong tokenlab bao gồm:

  • tokenlab.aliases
  • tokenlab.capabilities
  • tokenlab.deliveryAvailability: hỗ trợ verified và official đã cấu hình, nếu được cung cấp. Trường bị thiếu nghĩa là không xác định; việc hỗ trợ không đảm bảo tính khả dụng theo thời gian thực.
  • tokenlab.pricing: giá Verified. Các trường giá của nó sẽ là null khi tokenlab.deliveryAvailability.verified là false; model như vậy sẽ được tính phí theo giá Official.
  • tokenlab.official_pricing: giá Official. Các yêu cầu mà Official phân phối sẽ được tính phí theo mức giá này.
  • tokenlab.pricing_unit
  • tokenlab.max_input_tokens và tokenlab.max_output_tokens
  • tokenlab.category
  • tokenlab.lifecycle, tokenlab.commercial, và tokenlab.badges
  • tokenlab.request_format_summary
  • tokenlab.agent_preferences khi sử dụng recommended_for

Khi sử dụng recommended_for, kết quả có thể bao gồm trạng thái đề xuất và thời gian cập nhật. Hãy đọc phản hồi hiện tại thay vì cố định thứ tự.

Errors

StatusCodeCause
400invalid_view, invalid_provider, invalid_category, invalid_recommended_forMột giá trị truy vấn không được chấp nhận. Thông báo sẽ liệt kê các giá trị hợp lệ. category và recommended_for phải khớp nhau khi cả hai đều được thiết lập
401invalid_api_keyBạn đã gửi một API key không hợp lệ. Hãy xóa header để đọc danh sách công khai
429rate_limit_exceededQuá nhiều yêu cầu gửi đến danh mục công khai. Hãy lưu cache phản hồi và thử lại sau Retry-After

Example

curl "https://api.tokenlab.sh/v1/models?category=video"
{
  "object": "list",
  "data": [
    {
      "id": "veo3.1",
      "object": "model",
      "owned_by": "google",
      "tokenlab": {
        "category": "video",
        "capabilities": ["text-to-video", "image-to-video"]
      }
    }
  ]
}

Xem Lấy thông tin Model để biết chi tiết đầy đủ.

curl -X GET "https://example.com/v1/models"
{  "object": "list",  "data": [    {      "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,        "pricing_summary": {},        "agent_preferences": {},        "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"          ],          "request_endpoint": "string",          "request_endpoint_by_operation": {            "property1": "string",            "property2": "string"          }        }      }    }  ]}

Xác thực

BearerAuth
AuthorizationBearer <token>

Xác thực bằng Khóa API. Tạo hoặc quản lý khóa API trong Dashboard > API > API Keys.

Vị trí: header

Tham số truy vấn

provider?string

Lọc theo nhà cung cấp model công khai, ví dụ openai, anthropic, google, hoặc minimax.

tag?string

Lọc theo thẻ khả năng như reasoning, tool-use, vision hoặc text-to-image. Các giá trị trong tokenlab.capabilities của model là các thẻ hợp lệ. Để lọc theo loại model, hãy sử dụng category.

category?string

Lọc theo danh mục model.

Giá trị hợp lệ

  • "chat"
  • "embedding"
  • "translation"
  • "image"
  • "video"
  • "audio"
  • "tts"
  • "stt"
  • "rerank"
  • "3d"
  • "music"
  • "decision"
recommended_for?string

Sắp xếp các model không phải chat được hỗ trợ cho một danh mục tác vụ và bao gồm bằng chứng đề xuất.

Giá trị hợp lệ

  • "image"
  • "video"
  • "music"
  • "3d"
  • "tts"
  • "stt"
  • "embedding"
  • "rerank"
  • "translation"
  • "decision"
view?string

Chọn các trường chọn model rút gọn hoặc cấu trúc danh sách tương thích với OpenAI đầy đủ.

mặc định"full"

Giá trị hợp lệ

  • "compact"
  • "full"

Phản hồi

application/json

application/json

application/json

application/json

application/json