summaryrefslogtreecommitdiffstats
path: root/etc/examples/image_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'etc/examples/image_api.py')
-rw-r--r--etc/examples/image_api.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/etc/examples/image_api.py b/etc/examples/image_api.py
new file mode 100644
index 00000000..dbae22ed
--- /dev/null
+++ b/etc/examples/image_api.py
@@ -0,0 +1,9 @@
+import requests
+url = "http://localhost:1337/v1/images/generations"
+body = {
+ "prompt": "heaven for dogs",
+ "provider": "OpenaiAccount",
+ "response_format": "b64_json",
+}
+data = requests.post(url, json=body, stream=True).json()
+print(data) \ No newline at end of file