# 모델 기반 웹 검색(Anthropic).

**API:** Data API

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

**Tags:** Anthropic Web Search

Claude와 웹 검색으로 인용이 포함된 답변을 생성합니다. messages와 max_tokens를 제공하세요. 모델과 web_search 도구는 서비스에서 관리하며, max_uses는 검색 횟수를 제한합니다. 응답은 도구 사용, 검색 결과, 텍스트 블록으로 구성된 Anthropic Messages 객체입니다. 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": [
    "messages",
    "max_tokens"
  ],
  "properties": {
    "messages": {
      "type": "array",
      "description": "대화 메시지입니다. Anthropic Messages API와 같은 형식이며, 사용자 턴에 질문이 들어갑니다.",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "type": "string",
            "description": "메시지 텍스트입니다. 구조화된 콘텐츠 블록도 허용됩니다."
          }
        }
      },
      "example": [
        {
          "role": "user",
          "content": "What are the three biggest AI announcements this week? Give one sentence each with sources."
        }
      ]
    },
    "max_tokens": {
      "type": "integer",
      "description": "답변에서 생성할 최대 토큰 수입니다. 업스트림 Messages API에서 필수입니다.",
      "default": 1024,
      "example": 1024
    },
    "system": {
      "type": "string",
      "description": "답변의 어조나 형식을 조정하는 선택적 시스템 프롬프트입니다."
    }
  }
}
```

Example:

```json
{
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "What are the three biggest AI announcements this week? Give one sentence each with sources."
    }
  ]
}
```

## Responses

### 200 — 표준 Anthropic Messages 응답입니다. `content[]`는 수행된 검색과 인용된 답변을 교차 배치하며, `usage.server_tool_use.web_search_requests`는 청구되는 검색 횟수입니다.

Headers:
- `X-Request-Id` (string) — Felo 지원팀에 문의할 때 포함할 요청 식별자입니다.

**application/json**

Schema: object

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "example": "message"
    },
    "role": {
      "type": "string",
      "example": "assistant"
    },
    "stop_reason": {
      "type": "string",
      "example": "end_turn"
    },
    "content": {
      "type": "array",
      "description": "정렬된 블록: server_tool_use(검색 쿼리), web_search_tool_result(출처), text(인용된 답변).",
      "items": {
        "type": "object"
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "input_tokens": {
          "type": "integer"
        },
        "output_tokens": {
          "type": "integer"
        },
        "cache_read_input_tokens": {
          "type": "integer"
        },
        "cache_creation_input_tokens": {
          "type": "integer"
        },
        "server_tool_use": {
          "type": "object",
          "properties": {
            "web_search_requests": {
              "type": "integer",
              "description": "청구된 웹 검색 횟수입니다."
            }
          }
        }
      }
    }
  }
}
```

### 400 — 요청을 처리할 수 없습니다. 요청 매개변수를 확인하세요.

### 401 — 유효한 Felo API 키가 필요합니다.

### 402 — 청구 요건이 충족되지 않아 요청을 진행할 수 없습니다.

### 403 — 이 계정에는 이 작업을 수행할 권한이 없습니다.

### 429 — 요청 또는 지출 한도에 도달했습니다.

### 502 — 서비스가 요청을 완료할 수 없습니다.

### 503 — API 또는 청구 서비스를 일시적으로 사용할 수 없습니다.

### 504 — 요청을 처리하는 동안 서비스 시간이 초과되었습니다.

### default — 오류 응답. 업스트림 패스스루 응답은 공급자 형식을 사용할 수 있습니다.

**application/json**

Schema:

```json
{}
```
