# 以模型為基礎的網路搜尋（OpenAI）。

**API:** Data API

**Endpoint:** `POST /v1/beta/openai-websearch/search`

**Tags:** OpenAI Web Search

使用 OpenAI 模型與網路搜尋產生附引用的回答。以字串或訊息陣列提供 input。模型、工具與搜尋次數上限由服務管理。回應是 Responses 物件，其 output 包含 web_search_call 與附 URL 引用的 message 項目。usage 回報資源消耗，並非 Felo 扣費。

### 定價參考

- 計量方式：依回應元件計量。
- 參考請求預估：USD 0.3。
- 參考客戶乘數：1.0。不得再次套用於已結算的客戶金額。

僅供參考的中繼資料，並非帳戶報價、保證價格或消費上限。資源額度並非 Felo 額度。最終費用依 Felo 計費記錄為準。

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "type": "object",
  "required": [
    "input"
  ],
  "properties": {
    "input": {
      "type": "string",
      "description": "你的問題或指示，格式與 OpenAI Responses API 的 `input` 相同。也接受訊息陣列。",
      "example": "What are the three biggest AI announcements this week? Give one sentence each with sources."
    },
    "max_output_tokens": {
      "type": "integer",
      "description": "選用的答案產生 token 數上限。",
      "example": 1024
    },
    "instructions": {
      "type": "string",
      "description": "選用的高階指示，用於引導答案的語氣或格式。"
    }
  }
}
```

Example:

```json
{
  "input": "What are the three biggest AI announcements this week? Give one sentence each with sources.",
  "max_output_tokens": 1024
}
```

## Responses

### 200 — 標準的 OpenAI Responses 物件。`output[]` 交錯包含 web_search_call 項目與附引用的回答訊息；web_search_call 項目的數量即為計費的搜尋次數。

Headers:
- `X-Request-Id` (string) — 聯絡 Felo 支援時需提供的請求識別碼。

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string",
      "example": "response"
    },
    "status": {
      "type": "string",
      "example": "completed"
    },
    "output": {
      "type": "array",
      "description": "有序項目：web_search_call（執行的搜尋）與 message（附引用的答案）。",
      "items": {
        "type": "object"
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "input_tokens": {
          "type": "integer"
        },
        "output_tokens": {
          "type": "integer"
        },
        "input_tokens_details": {
          "type": "object",
          "properties": {
            "cached_tokens": {
              "type": "integer"
            }
          }
        }
      }
    }
  }
}
```

### 400 — 無法處理該要求。請檢查請求參數。

### 401 — 需要有效的 Felo API 金鑰。

### 402 — 由於未符合計費要求，要求無法繼續。

### 403 — 該帳戶無權執行此操作。

### 429 — 已達到要求或支出上限。

### 502 — 服務無法完成該要求。

### 503 — API 或計費服務暫時無法使用。

### 504 — 服務在處理要求時逾時。

### default — 錯誤回應；上游透傳回應可能採用供應商格式

**application/json**

Schema:

```json
{}
```
