跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://docs.lemondata.cc/llms.txt

Use this file to discover all available pages before exploring further.

概述

此端點是LemonData的與OpenAI兼容的批次API的一部分。批次作業使用上傳的JSONL檔案,異步運行,並可以在稍後返回輸出/錯誤檔案。

注意事項

  • 批次輸入檔案必須使用 purpose=batch
  • completion_window 目前為 24h
  • 輸出順序不保證;始終通過 custom_id 進行匹配。
  • 批次項目內不支持串流。

範例

curl -X POST "https://api.lemondata.cc/v1/batches" \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "input_file_id": "file_abc123",
    "endpoint": "/v1/chat/completions",
    "completion_window": "24h"
  }'

請求 / 回應

使用上方的互動式OpenAPI面板以獲取確切的架構。

操作提示

  • 使用 custom_id 進行冪等的下游對帳。
  • 只有在工作者完成批次後,才會期望 output_file_iderror_file_id
  • 批次定價可能與同步定價不同,因為適用 isBatchRequest=true 的折扣規則。