Skip to content
View as Markdown

Answer

Searches the web for a question and returns a short written answer, in Markdown, with the sources it used. Use it when you want the answer itself; use Search when you want raw results to give your own model. An answer takes a few seconds longer than a search.

POSThttps://api.freetheai.org/v1/answer

Request ​

bash
curl https://api.freetheai.org/v1/answer \
  -H "Authorization: Bearer $FTAI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "When does daylight saving time end in the US this year?"}'
python
import os
import requests

response = requests.post(
    "https://api.freetheai.org/v1/answer",
    headers={"Authorization": f"Bearer {os.environ['FTAI_KEY']}"},
    json={"query": "When does daylight saving time end in the US this year?"},
    timeout=90,
)
response.raise_for_status()
data = response.json()
print(data["answer"])
for source in data["sources"]:
    print("-", source["title"], source["url"])
ts
type Source = { title: string; url: string }

const response = await fetch('https://api.freetheai.org/v1/answer', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.FTAI_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ query: 'When does daylight saving time end in the US this year?' }),
})
if (!response.ok) throw new Error((await response.json()).error?.message)
const data = (await response.json()) as { answer: string; sources: Source[] }
console.log(data.answer)

Body parameters ​

ParameterTypeDescription
querystring, requiredThe question to answer, up to 1,024 characters.
num_resultsintegerThe most sources to use and return, 1 to 25. Default 10.

Response ​

json
{
  "query": "When does daylight saving time end in the US this year?",
  "answer": "Daylight saving time ends on **Sunday, November 1, 2026** at 2:00 AM local time, when clocks go back one hour [1].",
  "sources": [
    { "title": "Daylight Saving Time 2026", "url": "https://www.timeanddate.com/time/change/usa" }
  ],
  "daily_used": 4,
  "daily_limit": 50
}
FieldTypeDescription
querystringThe question that was answered.
answerstringA short answer written from current web sources, in Markdown.
sourcesarrayThe pages the answer used, each with url and title.
daily_usedintegerSearches used today, including this one.
daily_limitintegerYour account's daily web-search allowance.

Limits ​

Every call counts against the same daily web-search allowance as /v1/search, separate from your free requests, and resets at 00:00 UTC. Identical questions within an hour return the same answer.

Errors ​

StatusMeaning
400The query is missing or too long.
401Missing or invalid API key.
429The daily web-search allowance is used up. It resets at 00:00 UTC.
502No answer could be written right now. Try again, or use /v1/search.

FreeTheAI documentation. Paid models and plans are coming soon; the free tier has daily limits.