> ## 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 调用 Responses API。

**方法**：`generateResponse()`、`createResponse()`

### 示例

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

require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$apiKey = getenv('PHASEO_API_KEY');
$client = new Phaseo(apiKey: $apiKey);

$response = $client->createResponse([
    'model' => 'openai/gpt-4.1',
    'input' => [
        [
            'role' => 'user',
            'content' => [
                [
                    'type' => 'output_text',
                    'text' => 'Summarise this text'
                ]
            ]
        ]
    ],
    'temperature' => 0.7,
    'stream' => false
]);
echo $response['output'][0]['content'][0]['text'];
```

### 关键参数

* `model`（必填）：目标模型 ID。
* `input`（必填）：按顺序排列的输入项数组（消息、工具调用等）。
* `temperature`（0–2）：值越高，结果越随机。
* `top_p`（0–1）：核采样控制项。
* `max_output_tokens`（整数）：每个响应生成的 token 数上限。
* 工具：`tools`（定义）、`tool_choice`（auto/none/指定工具）、`max_tool_calls`（整数）、`parallel_tool_calls`（布尔值）。
* Logprobs：`top_logprobs`（0–20），用于返回每个 token 的 logprobs。
* 输出：`service_tier`、`store`（布尔值）、`stream`（布尔值）。
* 元数据：`metadata`（透传对象）、`reasoning`（用于提示推理强度的对象）。
* 网关扩展项：`usage`（用于请求用量的布尔值）、`meta`（用于包含 meta 块的布尔值）。

### 返回值

`ResponsesResponse` JSON 对象。


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