Skip to content

Commit dc33cb9

Browse files
authored
Update readme with image information (openai#135)
1 parent 5f60aca commit dc33cb9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ openai api engines.list
119119

120120
# create a completion
121121
openai api completions.create -e ada -p "Hello world"
122+
123+
# generate images via DALL·E API
124+
openai api image.create -p "two dogs playing chess, cartoon" -n 1
122125
```
123126

124127
## Example code
@@ -190,6 +193,18 @@ openai wandb sync
190193

191194
For more information on fine tuning, read the [fine-tuning guide](https://beta.openai.com/docs/guides/fine-tuning) in the OpenAI documentation.
192195

196+
## Image generation (DALL·E)
197+
198+
```python
199+
import openai
200+
openai.api_key = "sk-..." # supply your API key however you choose
201+
202+
image_resp = openai.Image.create(prompt="two dogs playing chess, oil painting", n=4, size="512x512")
203+
204+
```
205+
206+
See the [usage guide](https://beta.openai.com/docs/guides/images) for more details.
207+
193208
## Requirements
194209

195210
- Python 3.7.1+

0 commit comments

Comments
 (0)