> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenlab.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Lấy Bảng Giá

> Lấy thông tin giá của các model

## Tổng Quan

Sử dụng endpoint này để liệt kê bề mặt giá công khai hiện tại cho các model đang hoạt động.

Với thông tin giá đầy đủ của một model, bao gồm cấu trúc giá và nguồn gốc, hãy ưu tiên [Lấy Giá Model](/vi/api-reference/models/get-model).

## Tham số Query

<ParamField query="provider" type="string">
  Bộ lọc nhà cung cấp tùy chọn, ví dụ `openai`, `anthropic`, hoặc `google`.
</ParamField>

<ParamField query="tag" type="string">
  Bộ lọc nhãn model tùy chọn, ví dụ `chat`, `image`, `video`, `embedding`, hoặc `translation`.
</ParamField>

## Phản hồi

<ResponseField name="object" type="string">
  Luôn là `pricing`.
</ResponseField>

<ResponseField name="updated_at" type="string">
  Dấu thời gian ISO cho mục giá mới nhất có trong phản hồi.
</ResponseField>

<ResponseField name="currency" type="string">
  Luôn là `USD`.
</ResponseField>

<ResponseField name="data" type="array">
  Mảng các mục giá. Mỗi mục bao gồm `model`, `provider`, `is_lock_price`, `capabilities`, `aliases`, và các trường tóm tắt giá công khai dạng scalar hoặc có cấu trúc được trả về bởi lược đồ tương tác ở trên.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat" \
    -H "Authorization: Bearer sk-your-api-key"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.tokenlab.sh/v1/pricing",
      headers={"Authorization": "Bearer sk-your-api-key"},
      params={"provider": "openai", "tag": "chat"}
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat',
    {
      headers: { 'Authorization': 'Bearer sk-your-api-key' }
    }
  );

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      req, _ := http.NewRequest("GET", "https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat", nil)
      req.Header.Set("Authorization", "Bearer sk-your-api-key")

      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Println(result)
  }
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://api.tokenlab.sh/v1/pricing?provider=openai&tag=chat');

  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer sk-your-api-key'
      ]
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  $data = json_decode($response, true);
  print_r($data);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "object": "pricing",
    "updated_at": "2026-04-20T00:00:00.000Z",
    "currency": "USD",
    "data": [
      {
        "model": "gpt-4o",
        "provider": "openai",
        "is_lock_price": false,
        "input_per_1m_tokens": "2.50",
        "output_per_1m_tokens": "10.00",
        "capabilities": ["chat"],
        "aliases": ["gpt-4o-latest"]
      }
    ]
  }
  ```
</ResponseExample>

<Note>
  Sử dụng bảng OpenAPI tương tác ở trên để xem lược đồ phản hồi chính xác. Các mục giá công khai cũng có thể hiển thị `lock_price_per_request`, `has_complex_pricing`, `supported_operations`, `pricing_summary`, và `pricing_provenance`.
</Note>
