> ## Documentation Index
> Fetch the complete documentation index at: https://api-doc.vncps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 令牌用量查询

> 查询API令牌使用情况

## 查询用量

使用此端点查询您的API令牌使用情况。

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.xxx.com/api/usage/token/ \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer sk-xxx"
  ```
</CodeGroup>

## 注意事项

<Warning>
  定期查询令牌用量可以帮助您更好地管理API使用成本。
</Warning>

<Info>
  不同的操作消耗的token数量不同：

  * 图片生成：根据分辨率和数量计算
  * 视频生成：根据时长、分辨率和帧率计算
</Info>

## 相关信息

### Token 消耗参考

根据返回的 `usage` 字段，您可以了解每次API调用消耗的token数量：

* **图片生成**: `output_tokens` 表示生成图片消耗的token
* **视频生成**: `completion_tokens` 表示生成视频消耗的token

### 最佳实践

<CardGroup cols={2}>
  <Card title="定期检查" icon="clock">
    建议定期查询用量，避免超出预算
  </Card>

  <Card title="优化参数" icon="sliders">
    根据需求选择合适的分辨率和时长，避免不必要的消耗
  </Card>

  <Card title="批量处理" icon="layer-group">
    合理规划批量任务，提高效率
  </Card>

  <Card title="监控异常" icon="chart-line">
    关注用量变化，及时发现异常消耗
  </Card>
</CardGroup>
