快速開始
建立 API 金鑰並送出第一個生成請求。
方法
GET /developer/v1/models方法
GET /developer/v1/models/form-schema方法
POST /developer/v1/generations- 1建立並安全保存 Developer API 金鑰
- 2取得模型目錄識別並提交生成任務
- 3輪詢任務狀態並更新暫時成果網址
驗證
由伺服器傳送 Authorization: Bearer lpk_...。金鑰具備 query 與 generate 權限範圍,只顯示一次,且不可出現在瀏覽器程式碼中。
標頭
Authorization: Bearer $VIDANCE_API_KEY標頭
Idempotency-Key: $IDEMPOTENCY_KEY權限範圍
generate · query模型目錄
從業務模型目錄取得模型 ID、能力與 Schema 版本,不硬編碼供應商假設。
方法
GET /developer/v1/models?limit={limit}&offset={offset}方法
GET /developer/v1/models/form-schema回傳
model_id · capability · schema_version · input_schema生成任務
以穩定的 Idempotency-Key 標頭提交完整目錄識別與符合 Schema 的 input,並需要 generate 權限。
方法
POST /developer/v1/generations本文
model_id · capability · schema_version · input回傳
202 · task_id · status計費方式
Developer API 會從預付 USD 錢包扣款,並以每筆生成任務的預扣與結算方式計費。
方法
POST /developer/v1/billing/estimate回傳
held USD for the selected model1.會先預扣額度
提交生成時,系統會依估計最高費用在 API 錢包中預扣對應金額。
2.任務成功後才收取實際費用
任務成功完成後,會依最終計量結果扣款,並釋放未使用的預扣額度。
3.不會超過預扣金額
若計量結果低於預扣金額,只會收取結果金額,差額會回到可用餘額。
範例:$6.00 預扣、$4.50 結果時,只會收取 $4.50,差額退回可用餘額。
狀態與成果
使用 query 權限輪詢任務狀態、取得穩定成果索引並更新暫時內容網址;不支援取消。
方法
GET /developer/v1/generations?limit={limit}&offset={offset}方法
GET /developer/v1/generations/{task_id}方法
GET /developer/v1/generations/{task_id}/outputs/{output_index}/content回傳
url · url_expires_at錯誤
處理結構化錯誤碼與請求識別碼,並避免公開敏感請求資料。
錯誤格式
{ code, message, request_id }狀態
400 Bad Request · 401 Unauthorized狀態
404 Not Found · 409 Conflict · 410 Gone重試
Idempotency-Key