summaryrefslogtreecommitdiffstats
path: root/etc/examples/image_api.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-20 16:22:10 +0200
committerGitHub <noreply@github.com>2024-05-20 16:22:10 +0200
commite4b3b2692ed79b598557fa7cdff4983f75348db1 (patch)
tree40ec18570055263fd8e4ed25cc08940146deb615 /etc/examples/image_api.py
parentMerge pull request #1985 from anonymousx97/patch-1 (diff)
parentImprove async client readme, Fix print styling, Add image api example (diff)
downloadgpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar.gz
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar.bz2
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar.lz
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar.xz
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.tar.zst
gpt4free-e4b3b2692ed79b598557fa7cdff4983f75348db1.zip
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