/v1/filesファイルをアップロード
バッチの入力をアップロードします。purposeはbatchである必要があります。ファイルはUTF-8のJSONL(空行以外の各行に1つのJSONオブジェクト、最大50,000行)である必要があります。アップロード時に検査され、エラーには行番号が示されます。
各行は{"custom_id": "...", "method": "POST", "url": "/v1/chat/completions", "body": {...}}の形式で、一意のcustom_id(1〜256文字)と、-batchスラッグを指定したbody.modelを含みます。ファイルの一覧や削除のエンドポイントはありません。
認証: AuthorizationヘッダーにBearer形式のAPIキー
リクエストボディ
purposestring必須batchである必要があります。filestring必須JSONLファイル。
レスポンス
200保存されたファイル。
レスポンス
idstringobjectstringbytesintegercreated_atintegerfilenamestringpurposeenum
400アップロードまたはバッチが拒否されました。メッセージに行またはフィールドが示されます。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
401キーがないか、形式が不正か、期限切れか、取り消されています。
レスポンス
errorobjecterror
messagestring問題の内容と解決方法。
typestring例:
invalid_request_error、authentication_error、permission_error、rate_limit_error、insufficient_quota、api_error。codestring安定したエラーコード。
paramstring | null該当する場合、問題のあるリクエストフィールド。
refusal_reasonenumcode: refusalの場合にのみ含まれます。
リクエスト
curl https://api.experientiallabs.ai/v1/files \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-F purpose=batch \
-F file=@requests.jsonl
レスポンス
{
"id": "file_3f9a1c0e7b2d4a6f8e1c2b3d",
"object": "file",
"bytes": 48213,
"created_at": 1795132800,
"filename": "requests.jsonl",
"purpose": "batch"
}https://api.experientiallabs.ai/v1/files