diff --git a/pyontutils/scigraph_codegen.py b/pyontutils/scigraph_codegen.py
index <HASH>..<HASH> 100755
--- a/pyontutils/scigraph_codegen.py
+++ b/pyontutils/scigraph_codegen.py
@@ -887,8 +887,16 @@ class State2(State):
         return None, ''
 
 
-def moduleDirect(api_url, basepath, module_name):
+def moduleDirect(basepath, module_name, *, version=2):
     """ Avoid the need for dynamics altogether """
+    if version < 2:
+        state = State
+        docs_path = 'api-docs'
+    else:
+        state = State2
+        docs_path = 'swagger.json'
+
+    api_url = f'{basepath}/{docs_path}'
     s = state(api_url, basepath)
     code = s.code()
     return importDirect(code, module_name)
scigraph codegen fix bugs in moduleDirect

now only need to provide basepath, api_uri is generated from that