Skip to main content
POST
/
search
/
v1
/
answer
Generate AI-powered answers from web search
curl --request POST \
  --url https://api.case.dev/search/v1/answer \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "useCustomLLM": false,
  "model": "gpt-4o",
  "searchType": "auto",
  "numResults": 10,
  "includeDomains": [
    "<string>"
  ],
  "excludeDomains": [
    "<string>"
  ],
  "temperature": 0.3,
  "maxTokens": 2048,
  "text": true,
  "stream": false
}
'
{
  "answer": "<string>",
  "citations": [
    {
      "id": "<string>",
      "url": "<string>",
      "title": "<string>",
      "publishedDate": "<string>",
      "text": "<string>"
    }
  ],
  "model": "<string>",
  "searchType": "<string>"
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Body

application/json

Answer generation configuration

query
string
required

The question or topic to research and answer

useCustomLLM
boolean
default:false

Use Case.dev LLM for answer generation instead of provider's native answer

model
string
default:gpt-4o

LLM model to use when useCustomLLM is true

searchType
enum<string>
default:auto

Type of search to perform

Available options:
auto,
web,
news,
academic
numResults
integer
default:10

Number of search results to consider

Required range: 1 <= x <= 50
includeDomains
string[]

Only search within these domains

excludeDomains
string[]

Exclude these domains from search

temperature
number
default:0.3

LLM temperature for answer generation

Required range: 0 <= x <= 2
maxTokens
integer
default:2048

Maximum tokens for LLM response

text
boolean
default:true

Include text content in response

stream
boolean
default:false

Stream the response (only for native provider answers)

Response

Answer generated successfully

answer
string

The generated answer with citations

citations
object[]

Sources used to generate the answer

model
string

Model used for answer generation

searchType
string

Type of search performed