Ask
Reference
Ask
Grounded answer generation with citations. Repo retrieves context and asks the LLM for you.
POST
Ask
Documentation Index
Fetch the complete documentation index at: https://docs.userepo.com/llms.txt
Use this file to discover all available pages before exploring further.
/v1/ask is the highest-level endpoint: retrieve context + generate an answer + return citations in one round-trip. Use it when you want the simplest possible integration. Use /v1/context if you want to bring your own prompt or LLM.
Required action
ask
Cost
1 credit per call. Note:/v1/ask also incurs OpenAI completion costs (passed through transparently — credits cover both retrieval and the generation token cost in your tier’s bundle).
Body
Same as/v1/search:
The user-facing question.
How many context hits to feed the LLM. Min 1, max 25.
Response
Echo of the input query.
LLM-generated answer, cited inline as
[N]. When OpenAI is unavailable Repo falls back to a deterministic synthesis from the top hits.The retrieved hits the LLM saw. Includes provider, URL, and score. Useful for your UI to render source previews next to the answer.
Example
Behavior when retrieval is empty
If no hits match the query (within the calling key’s scope), Repo returns an answer like:citations + context are empty arrays. Your agent should treat this as “no grounded answer available” and either re-prompt the user, try a broader query, or fall back to its own knowledge with a disclaimer.
When to use this vs /v1/context
Use /v1/ask when | Use /v1/context when |
|---|---|
| You want the simplest one-call integration | You want to control the prompt or use your own LLM |
| Your agent doesn’t need to know about excluded providers | Your agent needs the full Context Contract |
| You’re fine with Repo’s default citation format | You’re rendering citations in custom UI |