onesentence.fun

API docs

onesentence.fun answers any question in exactly one sentence. Every request goes to openai/gpt-6-astra-pro via OpenRouter with reasoning effort max and a 128,000-token output budget. The same API powers the website.

Authentication

Sign in at https://onesentence.fun with your phone number (Privy SMS code). Send the Privy access token as Authorization: Bearer <token>. In a signed-in browser, get it with getAccessToken() from @privy-io/react-auth. Missing or invalid tokens get a 401.

POST /api/v1/answer

Body: {"question": string, "stream"?: boolean}. The question can hold up to 390,000 characters of context. Answers take 3 to 10 minutes, so use a long client timeout.

JSON (wait for the whole answer)

curl -sS https://onesentence.fun/api/v1/answer \
  -H "Authorization: Bearer $PRIVY_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  --max-time 900 \
  -d '{"question": "Why is the sky blue?", "stream": false}'
{
  "answer": "The sky looks blue because air molecules scatter short blue wavelengths of sunlight far more than longer red ones (Rayleigh scattering).",
  "trimmed": false,
  "model": "openai/gpt-6-astra-pro",
  "reasoning_effort": "max",
  "max_tokens": 128000,
  "usage": { "prompt_tokens": 2208, "completion_tokens": 1170, "cost": 0.08058 },
  "cost_usd": 0.08058,
  "elapsed_ms": 19700
}

Streaming (server-sent events, the default)

Events arrive in this order: meta, any number of reasoning (short reasoning summary text) and delta (answer text), then one done (the full JSON result above) or error. Lines starting with : are keep-alives sent while the model thinks; ignore them.

const res = await fetch("https://onesentence.fun/api/v1/answer", {
  method: "POST",
  headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
  body: JSON.stringify({ question }),
});
const reader = res.body!.pipeThrough(new TextDecoderStream()).getReader();
let buf = "";
for (;;) {
  const { value, done } = await reader.read();
  if (done) break;
  buf += value;
  let i;
  while ((i = buf.indexOf("\n\n")) >= 0) {
    const block = buf.slice(0, i); buf = buf.slice(i + 2);
    const event = /^event: (.*)$/m.exec(block)?.[1];
    const data = /^data: (.*)$/m.exec(block)?.[1];
    if (event === "done") console.log(JSON.parse(data!).answer);
  }
}

Errors and limits

MCP server

Streamable HTTP at https://onesentence.fun/mcp with one tool, ask_one_sentence. Listing tools is public; calling one needs the same Bearer token.

{
  "mcpServers": {
    "onesentence": {
      "url": "https://onesentence.fun/mcp",
      "headers": { "Authorization": "Bearer <privy-access-token>" }
    }
  }
}

System prompt

Sent verbatim as the system message with every question:

You are onesentence.fun. Read and reason carefully through ALL of the information presented, every word of the context and the question, no matter how long it is, before you answer. Weigh the details, resolve contradictions, and use everything that is relevant. Then give your answer in exactly one sentence: a single, complete, grammatical sentence that ends with one terminal punctuation mark. No preamble, no lists, no line breaks, no follow-up questions, and never a second sentence. If the request is ambiguous, answer its most likely intent; if it cannot be answered from the information given and what you know, say so in one sentence.

Machine-readable files