Responses
POST/v1/responses
info
Get an API Token (Bearer Token) via http://nilai.nillion.com
Generate a response from the AI model using the Responses API.
This endpoint provides a more flexible and powerful way to interact with models, supporting complex inputs and a structured event stream.
- req: Response request containing input and model specifications
- Returns: Full response with model output, usage statistics, and cryptographic signature
Request Requirements
- Must include non-empty input (string or structured input)
- Must specify a model
- Supports optional instructions to guide the model's behavior
- Optional web_search parameter to enhance context with current information
Response Components
- Model-generated text completion
- Token usage metrics
- Cryptographically signed response for verification
Processing Steps
- Validate input request parameters
- If web_search is enabled, perform web search and enhance context
- Prepare input for model processing
- Generate AI model response
- Track and update token usage
- Cryptographically sign the response
Web Search Feature
When web_search=True, the system will:
- Extract the user's query from the input
- Perform a web search using Brave API
- Enhance the context with current information
- Add search results to instructions for better responses
Potential HTTP Errors
- 400 Bad Request:
- Missing or empty input
- No model specified
- 500 Internal Server Error:
- Model fails to generate a response
Request
Responses
- 200
- 422
Successful Response
Validation Error