diff --git a/xos/api/utility/toscaapi.py b/xos/api/utility/toscaapi.py
new file mode 100644
index 0000000..1375969
--- /dev/null
+++ b/xos/api/utility/toscaapi.py
@@ -0,0 +1,59 @@
+import json
+import os
+import sys
+import traceback
+from django.http import HttpResponse
+from rest_framework.decorators import api_view
+from rest_framework.response import Response
+from rest_framework.reverse import reverse
+from rest_framework import serializers
+from rest_framework import generics
+from rest_framework import status
+from core.models import *
+from xos.apibase import XOSListCreateAPIView, XOSRetrieveUpdateDestroyAPIView, XOSPermissionDenied
+from api.xosapi_helpers import PlusModelSerializer, XOSViewSet, ReadOnlyField
+
+# The Tosca engine expects to be run from /opt/xos/tosca/ or equivalent. It
+# needs some sys.path fixing up.
+import inspect
+currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
+toscadir = os.path.join(currentdir, "../../tosca")
+
+class ToscaViewSet(XOSViewSet):
+    base_name = "tosca"
+    method_name = "tosca"
+    method_kind = "viewset"
+
+    @classmethod
+    def get_urlpatterns(self, api_path="^"):
+        patterns = []
+
+        patterns.append( self.list_url("run/$", {"post": "post_run"}, "tosca_run") )
+
+        return patterns
+
+    def post_run(self, request):
+        result = []
+
+        recipe = request.data.get("recipe", None)
+
+        sys_path_save = sys.path
+        try:
+            sys.path.append(toscadir)
+            from tosca.engine import XOSTosca
+            xt = XOSTosca(recipe, parent_dir=toscadir, log_to_console=False)
+            xt.execute(request.user)
+        except:
+            return Response( {"error_text": traceback.format_exc()}, status=500 )
+        finally:
+            sys.path = sys_path_save
+
+
+        return Response( {"log_msgs": xt.log_msgs} )
+
+
+
+
+
+
+
diff --git a/xos/configurations/common/run_tosca.py b/xos/configurations/common/run_tosca.py
new file mode 100755
index 0000000..35a0fb7
--- /dev/null
+++ b/xos/configurations/common/run_tosca.py
@@ -0,0 +1,44 @@
+#! /usr/bin/env python
+
+import json
+import os
+import requests
+import sys
+import traceback
+
+def main():
+    global opencloud_auth
+
+    if len(sys.argv)!=5:
+        print >> sys.stderr, "syntax: run_tosca.py <port> <username> <password> <fn>"
+        sys.exit(-1)
+
+    port = int(sys.argv[1])
+    username = sys.argv[2]
+    password = sys.argv[3]
+    tosca_fn = sys.argv[4]
+
+    xos_auth=(username, password)
+
+    hostname = "127.0.0.1"
+    url = "http://%s:%d/api/utility/tosca/run/" % (hostname, port)
+
+    recipe = open(tosca_fn).read()
+
+    r = requests.post(url, data={"recipe": recipe}, auth=xos_auth)
+    if (r.status_code != 200):
+        print >> sys.stderr, "ERR: recieved status %d" % r.status_code
+        try:
+            print >> sys.stderr, r.json()["error_text"]
+        except:
+            traceback.print_exc("error while printing the error!")
+            print r.text
+        sys.exit(-1)
+
+    result = r.json()
+    if "log_msgs" in result:
+        print "\n".join(result["log_msgs"])+"\n"
+
+if __name__ == "__main__":
+    main()
+
