🔑
Get your Incredible API key
Generate your API key to start using this endpoint
→
Overview
The Answer API provides a streamlined way to get direct, concise answers to questions without the complexity of managing conversation history or tool calling. It’s optimized for single-turn Q&A use cases where you need a quick response. This endpoint is particularly useful when you need to:- Extract specific information from your knowledge base
- Generate quick responses to user queries
- Transform unstructured text into structured JSON data
- Provide answers based on document context
Using Answer
The Answer endpoint is designed to generate concise answers to questions, extract information from your data, or convert unstructured text into structured formats. It’s ideal for Q&A tasks, transforming text into JSON, or providing instant, context-based responses.- Be specific and clear in your questions
- Include relevant context within the query if not using files
- For complex queries, consider breaking them into smaller questions
Working with Files
You can enhance the Answer API’s responses by providing document context. This is especially useful for answering questions about specific documents, analyzing reports, or extracting information from files. You can provide document context by uploading files first, then referencing them in your answer request:Structured Output
The Answer API can return data in any JSON structure you define, making it incredibly powerful for data extraction and transformation tasks. By providing aresponse_format schema, you instruct the API to return structured data instead of plain text.
This feature is ideal for:
- Sentiment analysis - Extract sentiment and confidence scores
- Entity extraction - Pull out names, dates, locations from text
- Form generation - Convert descriptions into structured form data
- Data validation - Transform unstructured input into validated structures
- API integration - Get responses in formats that match your application’s data models
Streaming Responses
For longer answers or when you want to provide immediate feedback to users, enable streaming by settingstream: true. Instead of waiting for the complete answer, you’ll receive chunks of text as they’re generated, creating a more interactive and responsive experience.
When to use streaming:
- Long-form answers or explanations
- Interactive user interfaces where immediate feedback is valuable
- Reducing perceived latency for users
- Building chat-like experiences
content- Text chunks as they’re generatedthinking- Internal reasoning process (if available)done- Signals completion of the streamerror- Any errors that occurred during generation
