diff --git a/htdocs/api/restler.php b/htdocs/api/restler.php
new file mode 100644
index 0000000000000000000000000000000000000000..ae891386b31d39c60b20483309eab88ff517a511
--- /dev/null
+++ b/htdocs/api/restler.php
@@ -0,0 +1,8 @@
+<?php
+// use the restler auto loader
+require_once DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/AutoLoader.php';
+return call_user_func(function () {
+    $loader = Luracast\Restler\AutoLoader::instance();
+    spl_autoload_register($loader);
+    return $loader;
+});
\ No newline at end of file
diff --git a/htdocs/public/api/index.php b/htdocs/public/api/index.php
index 24bd371572601183dbac647be6a47c8f47014d9b..ae8e977bf74483647db5aef7d7f5dd78472c3e04 100644
--- a/htdocs/public/api/index.php
+++ b/htdocs/public/api/index.php
@@ -31,7 +31,7 @@ $res=0;
 if (! $res && file_exists("../../main.inc.php")) $res=include '../../main.inc.php';
 if (! $res) die("Include of main fails");
 
-require_once DOL_DOCUMENT_ROOT.'/includes/autoload.php';
+require_once DOL_DOCUMENT_ROOT.'/api/restler.php';
 require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php';
 require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';