메인 콘텐츠로 건너뛰기
OrcaRouter를 통한 웹 검색의 두 가지 경로:
  1. Search-preview 모델/v1/chat/completions에서 검색 변형을 직접 호출
  2. 일반 모델의 도구 / 옵션web_search_options(Chat) 또는 tools: [{"type": "web_search"}](Responses)를 전달

Search-preview 모델 (OpenAI)

OpenAI는 여러 모델에 대해 search-preview 변형을 공개합니다 — 예시: openai/gpt-4o-search-previewopenai/gpt-5-search-api. 이 중 하나를 /v1/chat/completionsmodel로 지정하면 업스트림이 서버 측에서 검색을 처리합니다. 실시간 카탈로그는 /v1/models를 호출하세요.

web_search_options (Chat Completions)

curl https://api.orcarouter.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-orca-..." \
  -d '{
    "model": "openai/gpt-4o-search-preview",
    "messages": [{"role": "user", "content": "What changed in OpenAI pricing this week?"}],
    "web_search_options": {"search_context_size": "medium"}
  }'
search_context_size: low / medium / high. 검색 깊이를 제어합니다(web_search의 호출당 가격은 크기에 관계없이 동일).

도구 (Responses API)

/v1/responses는 OpenAI 모델과 모든 Grok 모델에서 tools: [{"type": "web_search"}]를 받습니다 — xAI의 Agent Tools 표면이 동일 엔드포인트에 존재합니다.
# OpenAI
curl https://api.orcarouter.ai/v1/responses \
  -H "Authorization: Bearer sk-orca-..." \
  -d '{
    "model": "openai/gpt-5",
    "input": "What changed in OpenAI pricing this week?",
    "tools": [{"type": "web_search"}]
  }'

# Grok (xAI Agent Tools)
curl https://api.orcarouter.ai/v1/responses \
  -H "Authorization: Bearer sk-orca-..." \
  -d '{
    "model": "grok/grok-4-fast-reasoning",
    "input": "What changed in xAI pricing this week?",
    "tools": [{"type": "web_search"}]
  }'
업스트림이 발행하는 각 web_search_call은 청구를 위해 카운트 됩니다 — 운영 / 청구 및 사용량 참조.

프로바이더 간 지원

웹 검색은 그것을 제공하는 모든 프로바이더에 도달합니다; 진입점만 다릅니다:
프로바이더웹 검색방법
OpenAISearch-preview 모델, 또는 /v1/responsesweb_search 도구 전달
xAI Grok/v1/responses에서 모든 Grok 모델과 tools: [{"type": "web_search"}] 호출 — xAI의 Agent Tools API. (xAI는 2026-01-12에 chat completions의 레거시 search_parameters를 폐기; 이전 *-search 모델 이름 변형은 더 이상 작동하지 않음.)
AnthropicChat Completions 요청에 web_search_options 전달 — Anthropic의 네이티브 web_search 서버 도구로 변환. search_context_size(low/medium/high)는 max_uses에, user_location.approximate는 Anthropic의 user_location에 매핑.
GeminigoogleSearch라는 이름의 함수 도구 전달(아래 참조) — Gemini의 네이티브 GoogleSearch 그라운딩 도구로 변환.
DeepSeekDeepSeek API는 웹 검색을 노출하지 않음.

googleSearch를 통한 Gemini 그라운딩

Gemini 모델의 경우, OrcaRouter의 변환층은 매직 함수 이름 googleSearch를 인식하여 Gemini의 네이티브 GoogleSearch 그라운딩 도구로 변환합니다. 다른 OpenAI 스타일 함수 도구처럼 전달하세요:
curl https://api.orcarouter.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-orca-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemini-2.5-flash",
    "messages": [{"role":"user","content":"What changed in Gemini pricing this week?"}],
    "tools": [{"type":"function","function":{"name":"googleSearch"}}]
  }'
Gemini가 반환하는 그라운딩 메타데이터(webSearchQueries 등)는 게이트웨이가 청구를 위해 캡처하고 표준 chat-completion 필드를 통해 노출됩니다. 동일한 코드 경로에서 인식되는 두 가지 관련 매직 이름이 있습니다:
  • codeExecution — Gemini 네이티브 코드 실행 도구 활성화
  • urlContext — Gemini URL 컨텍스트 도구 활성화

또는 네이티브로

이미 /v1beta/로 Gemini의 네이티브 프로토콜을 사용 중이라면, 매직 이름 변환 없이 Gemini 형태로 googleSearch를 직접 전달하세요:
curl "https://api.orcarouter.ai/v1beta/models/google/gemini-2.5-flash:generateContent" \
  -H "Authorization: Bearer sk-orca-..." \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [{"role":"user","parts":[{"text":"What changed in Gemini pricing this week?"}]}],
    "tools": [{"googleSearch": {}}]
  }'
{"codeExecution": {}}{"urlContext": {}}도 네이티브 경로에서 동일하게 작동합니다. 네이티브 형식 / Gemini 참조.

청구

web_searchweb_search_preview는 내장 도구 호출로 추적됩니다. 가격 등급이 다릅니다운영 / 청구 및 사용량에서 내역을 참조하세요.