Serverless AI Question Answering

AI powered question answering based on provided context. Extract precise answers from text passages, documents, or any context. Ideal for building virtual assistants, knowledge bases, FAQ systems, and information extraction applications.

Endpoint

Answer questions based on provided context with AI precision.

POSThttps://api.xtartapp.com/text/question-answering

*Authentication

You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.

Request body

NameTypeRequiredMaxDescription
textstringYes300The question to be answered based on the context
contextstringYes5000The text context from which to answer the question

Response

NameTypeDescription
dataobjectThe result of the question answering
data.answerstringThe answer to the question based on the provided context
data.confidencenumberConfidence score (0.0 to 1.0) indicating the certainty of the answer
metadataobjectMetadata about the question answering process
metadata.costnumberThe cost of the question answering request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_QUESTION_ANSWERING_ERROREx: could not answer the question based on context | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.