Skip to main content
POST
/
v1
/
ask
Ask
curl --request POST \
  --url https://api.userepo.com/v1/ask \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "limit": 123
}
'
{
  "question": "<string>",
  "answer": "<string>",
  "citations": [
    {}
  ],
  "context": [
    {}
  ]
}

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:
query
string
required
The user-facing question.
limit
integer
default:"8"
How many context hits to feed the LLM. Min 1, max 25.

Response

{
  "question": "What did we decide about the brand color?",
  "answer": "Based on Repo memory, the strongest context is:\n[1] Brand decisions: We're keeping the lime-green accent because Q2 testing showed...\n[2] Design review notes: The team agreed to retire the navy variant...",
  "citations": [
    { "index": 1, "sourceItemId": "uuid", "title": "Brand decisions" },
    { "index": 2, "sourceItemId": "uuid", "title": "Design review notes" }
  ],
  "context": [
    {
      "sourceItemId": "uuid",
      "title": "Brand decisions",
      "content": "We're keeping the lime-green accent...",
      "url": "https://www.notion.so/...",
      "provider": "notion",
      "score": 0.8432
    }
  ]
}
question
string
Echo of the input query.
answer
string
LLM-generated answer, cited inline as [N]. When OpenAI is unavailable Repo falls back to a deterministic synthesis from the top hits.
citations
array
Numbered list mapping [N] markers to source items. See Citations.
context
array
The retrieved hits the LLM saw. Includes provider, URL, and score. Useful for your UI to render source previews next to the answer.

Example

curl -X POST https://api.userepo.com/v1/ask \
  -H "Authorization: Bearer repo_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "When does the brand-refresh project ship?",
    "limit": 5
  }'

Behavior when retrieval is empty

If no hits match the query (within the calling key’s scope), Repo returns an answer like:
I could not find company context for: <query>
…and 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 whenUse /v1/context when
You want the simplest one-call integrationYou want to control the prompt or use your own LLM
Your agent doesn’t need to know about excluded providersYour agent needs the full Context Contract
You’re fine with Repo’s default citation formatYou’re rendering citations in custom UI