Implementation Required : Your DSP must implement this endpoint on your own server. The SSP at ssp.thrads.ai will send POST requests to your configured DSP endpoint URL.
Authorizations
Your API key for authentication
Client IP address for geolocation (optional but recommended)
Backup client IP header (optional)
Body
Unique user identifier. Use anonymous UUIDs (e.g., user_a1b2c3d4-...). Do not use email or name.
Conversation identifier. One unique ID per conversation, not per user. Reset when user starts a new chat.
Number of ads shown before this request in the current conversation. Added by SSP from cache. Optional.
Conversation history. Must contain at least 2 messages (user and assistant). Messages must alternate between user and assistant roles, ending with a user message followed by an assistant message. Message role. Must be either "user" or "assistant".
Optional ISO 8601 or Unix timestamp. Including timestamps enables time-in-chat analytics for better targeting.
Whether the request is for production. Defaults to true.
Optional request identifier for distributed tracing when called from SSP. Used for correlation across services.
{
"userId" : "user_123" ,
"chatId" : "chat_456" ,
"nAdsBefore" : 2 ,
"messages" : [
{
"role" : "user" ,
"content" : "Looking for running shoes" ,
"timestamp" : "2024-11-23T10:00:00Z"
},
{
"role" : "assistant" ,
"content" : "What's your budget?" ,
"timestamp" : "2024-11-23T10:00:15Z"
}
],
"production" : true ,
"request_id" : "req_abc123"
}
200 - Success with Bid
200 - No Bid
500 - Error
{
"data" : {
"bid" : 7.50 ,
"bidId" : "bid_abc123"
}
}
Response
Additional fields (such as requestId, timestamp, status, message, etc.) are allowed in the response and will be ignored by the SSP.
REQUIRED - Response data payload. Must contain bid and bidId when submitting a bid. Return empty object {} for no-bid.REQUIRED (when bidding) - Bid amount in CPM (cost per mille) dollars. Must be >= 0. Automatically rounded to 2 decimal places.
REQUIRED (when bidding) - Unique bid identifier required for render endpoint. Used to retrieve bid details during render phase.
Error message when the request fails. Only present on error responses.
Status Codes
Status Code Meaning Scenario 200 OKSuccess Bid generated successfully or DSP chose not to bid 400 Bad RequestInvalid input Malformed request body or missing required fields 401 UnauthorizedAuthentication failed Missing or invalid thrad-api-key 429 Too Many RequestsRate limit exceeded Publisher exceeded request quota 500 Internal Server ErrorServer error Exception during auction execution, database failure, or service unavailable