Grounded answers with citations, tuned for the agent loop. Ask a question, get a synthesized answer plus the sources it stands on. Synchronous: one request, one response.
Copy one work order and paste it into Claude Code, Cursor, or any coding agent — it finds the right place in your codebase and wires STELQ Answers in, so your users get grounded, cited answers at runtime. Every payload references $STELQ_KEY from your environment, never a live secret.
One request to POST /v1/answers/ask. Set $STELQ_KEY in your environment and run this as-is — it is generated from the live contract, not transcribed.
curl -X POST https://api.stelq.com/v1/answers/ask \
-H "Authorization: Bearer $STELQ_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"RAG vs fine-tuning for enterprise?","maxTokens":512,"citations":true}'Every request carries a bearer token in the Authorization header. Copied agent payloads reference the $STELQ_KEY environment variable, so set it in your agent's environment rather than pasting a live secret into a prompt or a chat log.
Authorization: Bearer $STELQ_KEY
| Field | Type | Notes |
|---|---|---|
| queryrequired | string | The question to answer. |
| maxTokens | integer | Cap the answer length (default 512). |
| citations | boolean | Return the sources behind the answer (default true). |
{
"query": "RAG vs fine-tuning for enterprise?",
"maxTokens": 512,
"citations": true
}A successful call returns JSON with the result inline.
{
"answer": "Use RAG when the knowledge changes often or must be cited; fine-tune when you need…",
"citations": [
{
"url": "https://example.com/rag-vs-ft",
"title": "RAG vs fine-tuning, compared"
}
]
}| Status | Meaning |
|---|---|
| 400 | Invalid request — a field is missing or malformed (the body says which). |
| 401 | Missing or invalid API key. |
| 402 | Insufficient balance — top up credits to continue. |
| 429 | Rate limited — back off and retry after the Retry-After header. |
| 502 | Upstream temporarily unavailable — safe to retry; not charged. |
Up to 50 requests/second per key.