> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 画像生成

> PHP SDKで/images/generationsを呼び出します。

**メソッド**: `$client->generateImage(...)`

### 例

```php theme={null}
<?php

require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo(getenv('PHASEO_API_KEY'));
$response = $client->generateImage([
    'model' => 'openai/gpt-image-1',
    'prompt' => 'A lighthouse at golden hour',
    'size' => '1024x1024',
    'n' => 1,
    'response_format' => 'url'
]);
echo $response['data'][0]['url'] ?? '';
```

### 主なパラメーター

* `model`（必須）：画像対応モデルのID（例：`openai/gpt-image-1`）。
* `prompt`（必須）：指示文。
* `n`（1～10）：生成する画像の数。
* `size`：例：`1024x1024`、`1024x1792`、`1792x1024`。
* `quality`：`standard`または`hd`（モデルに依存）。
* `style`：例：`vivid`または`natural`（モデルに依存）。
* `response_format`：`url`または`b64_json`。
* `user`：安全性や不正利用の追跡に使う任意のエンドユーザータグ。

### 戻り値

ImageGenerationResponse


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.