---
title: "Generate AI-powered answers from web search"
method: POST
path: "/search/v1/answer"
tags: ["Search"]
---

# Generate AI-powered answers from web search

`POST /search/v1/answer`

Generate comprehensive answers to questions using web search results. Supports two modes: native provider answers or custom LLM-powered answers using Case.dev's AI gateway. Perfect for legal research, fact-checking, and gathering supporting evidence for cases.

## Request body

- object
  - `query` string, required — The question or topic to research and answer
  - `useCustomLLM` boolean — Use Case.dev LLM for answer generation instead of provider's native answer
  - `model` string — LLM model to use when useCustomLLM is true
  - `searchType` 'auto' | 'web' | 'news' | 'academic' — Type of search to perform
  - `numResults` integer — Number of search results to consider
  - `includeDomains` string[] — Only search within these domains
  - `excludeDomains` string[] — Exclude these domains from search
  - `temperature` number — LLM temperature for answer generation
  - `maxTokens` integer — Maximum tokens for LLM response
  - `text` boolean — Include text content in response
  - `stream` boolean — Stream the response (only for native provider answers)

## Response `200`

Answer generated successfully

- object
  - `answer` string — The generated answer with citations
  - `citations` object[] — Sources used to generate the answer
    - `id` string
    - `url` string
    - `title` string
    - `publishedDate` string
    - `text` string
  - `model` string — Model used for answer generation
  - `searchType` string — Type of search performed

## Other responses

- `400` — Invalid request - missing query or validation error
- `401` — Invalid API key
- `403` — API key does not have access to Search service

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/revisions/5b7e64e6d6f9/schema)
