API Reference
Streaming Search
⚠️ Important Note: The auto-generated code samples in the playground will not work for this WebSocket endpoint, with the exception of the Python and JS(WebSocket) examples shown. Please use these provided examples only, and not the auto-generated ones.
This endpoint provides a WebSocket connection for streaming search results in real-time.
Connection
Connect to: wss://api.critique-labs.ai/v1/ws/search
Headers
- X-API-Key: (Required) Your unique API key for authentication.
Message Format
After connecting, send a JSON message with the following structure:
{
"prompt": "your search query",
"image": "optional base64 image or URL",
"source_blacklist": ["optional list of domains to exclude"],
"output_format": {
// Optional structured output format
}
}
Streaming Responses
The server will stream responses as JSON messages with the following structure:
{
"type": "response" | "context" | "error",
"content": "the actual content"
}
type: "response"
- Contains generated response contenttype: "context"
- Contains source context informationtype: "error"
- Contains error messages if any occur
GET
Headers
Your API key for authentication
Body
application/json
Response
101
WebSocket connection established