mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Improve async client readme, Fix print styling, Add image api example
This commit is contained in:
parent
5115cf0e23
commit
77a1f500a8
3 changed files with 51 additions and 4 deletions
9
etc/examples/image_api.py
Normal file
9
etc/examples/image_api.py
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue