You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate stunning images from text prompts using AI-powered models. Prism provides a clean, consistent API for image generation across different providers, starting with comprehensive OpenAI support.
4
+
5
+
## Getting Started
6
+
7
+
Creating images with Prism is as simple as describing what you want:
8
+
9
+
```php
10
+
use Prism\Prism\Prism;
11
+
12
+
$response = Prism::image()
13
+
->using('openai', 'dall-e-3')
14
+
->withPrompt('A cute baby sea otter floating on its back in calm blue water')
Copy file name to clipboardExpand all lines: docs/providers/openai.md
+124Lines changed: 124 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,3 +97,127 @@ Prism::text()
97
97
])
98
98
->asText()
99
99
```
100
+
101
+
## Image Generation
102
+
103
+
OpenAI provides powerful image generation capabilities through multiple models. Prism supports all of OpenAI's image generation models with their full feature sets.
104
+
105
+
### Supported Models
106
+
107
+
| Model | Description |
108
+
|-------|-------------|
109
+
|`dall-e-3`| Latest DALL-E model |
110
+
|`dall-e-2`| Previous generation |
111
+
|`gpt-image-1`| GPT-based image model |
112
+
113
+
### Basic Usage
114
+
115
+
```php
116
+
$response = Prism::image()
117
+
->using('openai', 'dall-e-3')
118
+
->withPrompt('A serene mountain landscape at sunset')
119
+
->generate();
120
+
121
+
$image = $response->firstImage();
122
+
echo $image->url; // Generated image URL
123
+
```
124
+
125
+
### DALL-E 3 Options
126
+
127
+
DALL-E 3 is the most advanced model with the highest quality output:
128
+
129
+
```php
130
+
$response = Prism::image()
131
+
->using('openai', 'dall-e-3')
132
+
->withPrompt('A futuristic cityscape with flying cars')
0 commit comments