---
title: "Exa AI 搜尋"
url: "/docs/search/exa_ai"
canonical_url: "https://docs.litellm.ai/docs/search/exa_ai"
type: "docs"
last_updated: "2026-10-08"
related:
  - "/docs/search/tavily"
  - "/docs/search/brave"
---
# Exa AI 搜尋

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


**取得 API 金鑰：** [https://exa.ai](https://exa.ai)

## LiteLLM Python SDK {#litellm-python-sdk}

```python showLineNumbers title="Exa AI Search"
import os
from litellm import search

os.environ["EXA_API_KEY"] = "exa-..."

response = search(
    query="latest AI developments",
    search_provider="exa_ai",
    max_results=5
)
```

## LiteLLM AI 閘道 {#litellm-ai-gateway}

### 1. 設定 config.yaml {#1-setup-configyaml}

```yaml showLineNumbers title="config.yaml"
model_list:
  - model_name: gpt-5.6-terra
    litellm_params:
      model: gpt-5.6-terra
      api_key: os.environ/OPENAI_API_KEY

search_tools:
  - search_tool_name: exa-search
    litellm_params:
      search_provider: exa_ai
      api_key: os.environ/EXA_API_KEY
```

### 2. 啟動 proxy {#2-start-the-proxy}

```bash
litellm --config /path/to/config.yaml

# RUNNING on http://0.0.0.0:4000
```

### 3. 測試搜尋端點 {#3-test-the-search-endpoint}

```bash showLineNumbers title="Test Request"
curl http://0.0.0.0:4000/v1/search/exa-search \
  -H "Authorization: Bearer $LITELLM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest AI developments",
    "max_results": 5
  }'
```

## 提供者特定參數 {#provider-specific-parameters}

```python showLineNumbers title="Exa AI Search with Provider-specific Parameters"
import os
from litellm import search

os.environ["EXA_API_KEY"] = "exa-..."

response = search(
    query="AI research papers",
    search_provider="exa_ai",
    max_results=10,
    search_domain_filter=["arxiv.org"],
    # Exa-specific parameters
    type="neural",                   # 'neural', 'keyword', or 'auto'
    contents={"text": True},         # Request text content
    use_autoprompt=True              # Enable Exa's autoprompt
)
```

## Related pages

- [Tavily 搜尋](https://docs.litellm.ai/docs/search/tavily.md)
- [Brave 搜尋](https://docs.litellm.ai/docs/search/brave.md)
