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
questionstringYes1000The question to be answered based on the context
contextstringYes50 000The text context from which to answer the question
searchOnWebbooleanNo-Whether to search the web for additional context.
languagestringNo-The language in which the answer should be generated. Default is 'auto'.

Response

NameTypeDescription
dataobjectThe result of the question answering
data.responsestringThe answer to the question based on the provided context
data.languagestringThe language 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.