canonical: https://jentic.com/apis/azure.com/qnamaker-runtime-client

# Microsoft Azure QnAMaker Runtime Client

Jentic publishes the only available OpenAPI specification for QnAMaker Runtime Client, keeping it validated and agent-ready. The runtime API serves answers from a published Azure QnA Maker knowledge base - given a user question and the knowledge base ID, it returns the best matching question-and-answer pair along with a confidence score. It also exposes a training endpoint that ingests user feedback so the knowledge base can refine its ranking over time.

## For AI agents

Generate answers from a published Azure QnA Maker knowledge base by sending a user question to the runtime and submit feedback to refine future ranking.

## Scope

Does not author or publish knowledge bases, manage the Cognitive Services account, or run general language model inference - use for QnA Maker runtime answer generation and feedback training only.

## Capabilities

- Generate the best matching answer for a user question from a knowledge base
- Return a ranked list of candidate answers with confidence scores
- Apply metadata filters when searching a knowledge base for an answer
- Submit user feedback to improve answer ranking on future calls
- Score multiple candidate questions against a single user query

## Use cases

### FAQ chatbot answers

Customer support chatbots use QnA Maker to answer routine questions sourced from product documentation and FAQ pages. The runtime takes the user's question, consults the published knowledge base, and returns the top-ranked answer with a confidence score so the bot can either answer directly or escalate to a human agent when confidence is low.

Example prompt: Send 'How do I reset my password?' to QnA Maker knowledge base 'kb-support-prod' with top=3 and return the answer plus confidence score

### Active learning via feedback

QnA Maker improves ranking over time when users mark answers as helpful or not. The /train endpoint accepts feedback records linking user queries to the question they actually meant, and the runtime uses that signal to rerank ambiguous questions on future calls.

Example prompt: Submit a feedback record stating that the user query 'forgot password' actually matched the question id for 'How do I reset my password?'

### Metadata-filtered answers

Knowledge bases that cover multiple products or audiences can tag entries with metadata, so a single endpoint serves filtered slices. The generateAnswer call accepts strict and not filters on metadata so the runtime returns answers only from the relevant product, language, or audience.

Example prompt: Generate an answer for 'how do I install the agent' with strict filter product=android

### Agent-driven knowledge retrieval

An AI agent fronting an internal helpdesk uses QnA Maker as a structured retrieval layer behind its language model. The agent calls generateAnswer for each user turn, threads the top answer into its prompt context, and submits feedback when the user marks the response as helpful. Jentic isolates the QnA Maker subscription key in its vault.

Example prompt: For each new user message, call generateAnswer on knowledge base 'kb-helpdesk' with top=1 and pass the response into the agent's prompt context

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /knowledgebases/{kbId}/generateAnswer | Generate answers for a question from a knowledge base |
| POST | /knowledgebases/{kbId}/train | Submit user feedback to train the knowledge base |

## Key resources

- **Knowledge Bases** — Generate answers from a published QnA Maker knowledge base
- **Training Feedback** — Submit user feedback to refine answer ranking on future runtime calls

## Why Jentic

- **Setup:** Wiring the QnAMaker Runtime Client by hand means resolving your published runtime endpoint host, formatting the endpoint key into the 'EndpointKey {key}' Authorization header, and smoothing the per-knowledge-base rate limits yourself. Through Jentic you install once, import the QnAMaker Runtime Client from the API Directory, store the endpoint key once, and your agent calls it.
- **Permission scoping:** The knowledge base id travels in the URL path (/knowledgebases/{kbId}/generateAnswer and /knowledgebases/{kbId}/train), so a rule can pin your agent to one knowledge base and the operations it needs. You choose the operations it may call, so you can allow answer generation while leaving out the training feedback submission unless you add it.
- **Credential handling:** Your QnA Maker endpoint key is stored once, encrypted, by your own Jentic One instance and injected as the Authorization header at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'answer a question from a qna maker knowledge base' or 'submit feedback to a knowledge base', and Jentic returns the matching operation with its input schema so the agent supplies the kbId, question, top, and metadata filters without browsing the reference docs.

## Related APIs

- **Cognitive Services Management Client** — Provisions the Cognitive Services account that hosts the QnA Maker resource
- **App Service Plans API Client** — Manages the App Service plan that hosts the QnA Maker runtime
- **Azure ML Web Services Management Client** — Hosts custom ML models as web services rather than QnA-style retrieval

## FAQ

### Why is there no official OpenAPI spec for QnAMaker Runtime Client?

Microsoft Azure does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call QnAMaker Runtime Client via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the QnA Maker Runtime API use?

The runtime uses an API key passed in the Authorization header (named auth_key in the spec, expected format 'EndpointKey {key}'). Through Jentic, the endpoint key is held in the encrypted vault and injected at execute time so the raw secret never appears in the agent's context.

### Can I limit answers to a specific product or audience?

Yes. POST /knowledgebases/{kbId}/generateAnswer accepts strictFilters and notFilters arrays of metadata key/value pairs, so the runtime returns only answers tagged with the requested metadata. This is the standard way to scope a single knowledge base across multiple products.

### What are the rate limits for the QnA Maker Runtime API?

QnA Maker runtime traffic is throttled per knowledge base based on the underlying App Service SKU and tier. Standard tiers cap at around 10 transactions per second per knowledge base; sustained higher traffic returns 429 and should be smoothed with backoff.

### How do I generate an answer through Jentic?

Search Jentic for 'qna maker generate answer', load the schema for POST /knowledgebases/{kbId}/generateAnswer, then execute with the kbId path parameter and a body containing 'question' and 'top'. The pip install jentic Python SDK uses the async search, load, execute pattern.

### Is the QnA Maker Runtime API free?

QnA Maker pricing is tied to the underlying Azure Cognitive Services and the App Service plan that hosts the runtime. Free SKUs cap monthly transactions; paid tiers bill per million transactions. Newer workloads should consider Azure AI Search and language understanding services as QnA Maker has been retired for new resources.

### Can I limit what my agent is allowed to do with the QnA Maker Runtime API?

Yes. Jentic One runs self-hosted, so your own rules decide which operations and credentials the agent may use. Because the knowledge base id travels in the URL path for both POST /knowledgebases/{kbId}/generateAnswer and POST /knowledgebases/{kbId}/train, you can pin the agent to a single knowledge base and expose only the calls it needs. For example, you can allow answer generation while withholding the training feedback endpoint until you choose to add it.
