Create a new Answer Engine and index the provided documents.
This endpoint creates a new answer engine that can be used to answer questions based on the provided documents.
Form Fields (Required):
answer_engine_name: Name for the enginemodel_llm: LLM model for answer generation (e.g. llama-v3p3-70b-instruct)model_embedding: Embedding model for retrieval (e.g. nugen-flash-embed)Form Fields (Optional):
model_reranker: Reranker model (e.g. bge-reranker-v2-m3)system_prompt: Custom system prompt for the enginetemperature: LLM temperature (default: 0.2)max_tokens: Max tokens for LLM response (default: 600)documents: One or more files to indexs3_uris: List of S3 URIs to indexs3_prefix: S3 prefix to list and index JSON files fromNote: At least one of documents, s3_uris, or s3_prefix must be provided.
Returns:
data: Newly created engine object containing:
answer_engine_id: Unique answer engine identifier (e.g. ae_8c625d9d71)status: Engine status (processing while indexing, ready when done)answer_engine_name: Name of the engineuser_id: User identifierorg_id: Organisation identifierdocument_count: Number of indexed documentschunk_count: Number of indexed chunkserror_message: Error message if indexing failed (null if no error)created_at: ISO 8601 timestamp of creationErrors:
400: Must provide at least one of documents, s3_uris, or s3_prefix422: Missing required fieldExample Request:
curl -X POST https://api.nugen.in/api/v3/answer-engine \
-H "Authorization: Bearer <api_key>" \
-F answer_engine_name="Test_quer_round" \
-F model_llm="llama-v3p3-70b-instruct" \
-F model_embedding="nugen-flash-embed" \
-F model_reranker="bge-reranker-v2-m3" \
-F system_prompt="You are a helpful assistant that answers strictly from the provided documents." \
-F temperature="0.2" \
-F max_tokens="600" \
-F documents=@handbook.pdf \
-F s3_uris="s3://<bucket>/<file_path>.json" \
-F s3_prefix="s3://<bucket>/<prefix>/"
Example Response:
{
"data": {
"answer_engine_id": "ae_8c625d9d71",
"status": "ready",
"answer_engine_name": "Test_quer_round",
"user_id": "user_415",
"org_id": "org_415",
"document_count": 1,
"chunk_count": 5,
"error_message": null,
"created_at": "2026-03-13T15:11:51.105262+05:30"
}
}
Notes:
processing while documents are being indexedGET /api/v3/answer-engine/{id} to check when status becomes readyready, the engine can be used for chat and retrievalBearer authentication header of the form Bearer <token>, where <token> is your auth token.
Name for the answer engine
LLM model for answer generation (e.g. llama-v3p3-70b-instruct)
Embedding model for retrieval (e.g. nugen-flash-embed)
Reranker model (e.g. bge-reranker-v2-m3)
Custom system prompt
LLM temperature (default: 0.2)
Max tokens for LLM response (default: 600)
List of S3 URIs to index
S3 prefix to list and index JSON files from
One or more files to index
Returns details of the newly created answer engine including its unique identifier, status, and configuration
Response returned after successfully creating a new answer engine.
Shared response shape for a single answer engine object, used by create, get, and list responses.