POST/v1/files

Upload a file

Uploads batch input. purpose must be batch. The file must be UTF-8 JSONL: one JSON object per non-blank line, at most 50,000 lines. It is checked on upload and errors name the line.

Each line is {"custom_id": "...", "method": "POST", "url": "/v1/chat/completions", "body": {...}} with a unique custom_id (1 to 256 characters) and body.model set to a -batch slug. There is no file list or delete route.

認証: AuthorizationヘッダーにBearer形式のAPIキー

リクエストボディ

  • purposestring必須

    Must be batch.

  • filestring必須

    The JSONL file.

レスポンス

  • 200

    The stored file.

    レスポンス
    • idstring
    • objectstring
    • bytesinteger
    • created_atinteger
    • filenamestring
    • purposeenum
      "batch""batch_output"
  • 400

    The upload or batch was rejected; the message names the line or field.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"
  • 401

    The key is missing, malformed, expired or revoked.

    レスポンス
    • errorobject
      error
      • messagestring

        What went wrong and how to fix it.

      • typestring

        For example invalid_request_error, authentication_error, permission_error, rate_limit_error, insufficient_quota, api_error.

      • codestring

        The stable error code.

      • paramstring | null

        The request field at fault, when there is one.

      • refusal_reasonenum

        Present only on code: refusal.

        "cyber_policy""cbrn""content_policy""recitation""data_inspection""unspecified"

リクエスト

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