gpt4free/etc/examples/image_api.py
H Lohaus 6ce493d4df
Fix api streaming, fix AsyncClient (#2357)
* Fix api streaming, fix AsyncClient, Improve Client class, Some providers fixes, Update models list, Fix some tests, Update model list in Airforce provid
er, Add OpenAi image generation url to api, Fix reload and debug in api arguments, Fix websearch in gui

* Fix Cloadflare and Pi and AmigoChat provider

* Fix conversation support in DDG provider, Add cloudflare bypass with nodriver

* Fix unittests without curl_cffi
2024-11-16 13:19:51 +01:00

9 lines
240 B
Python

import requests
url = "http://localhost:1337/v1/images/generations"
body = {
"model": "dall-e",
"prompt": "hello world user",
#"response_format": "b64_json",
}
data = requests.post(url, json=body, stream=True).json()
print(data)