Get Attributions for an Answer
Retrieve a list of attributions and source documents used in a specific AI chat response.
Overview
This endpoint returns attribution metadata used by the AI to generate a specific chat reply. Use it to provide transparency and highlight supporting content segments from referenced sources.
Usage Flow
This endpoint is part of a three-step flow:
-
Create a chat session and get conversation IDs
CallPOST /v1/chat
to start a conversation and receivethreadId
andturnId
. -
Get AI chat response
CallGET /v1/chat/response/{threadId}/{turnId}
to retrieve the AI-generated reply. -
Get attributions
CallGET /v1/chat/attributions/{threadId}/{turnId}
to obtain the list of sources and content segments attributed in the response.
Endpoint
GET https://example.com/v1/chat/attributions/{threadId}/{turnId}
- Authentication Required: Yes
- Rate Limiting: Applies per organization settings
X-RateLimit-Limit
: Max requests allowedX-RateLimit-Remaining
: Remaining requestsX-RateLimit-Reset
: Reset timestamp (Unix)
Path Parameters
Field | Type | Required | Description |
---|---|---|---|
threadId | string | ✅ | Thread ID from your previous /v1/chat response |
turnId | string | ✅ | Turn ID from your previous /v1/chat response |
Header Parameters
Field | Type | Required | Description |
---|---|---|---|
Authorization | string | ✅ | Bearer token for API authentication |
X-User-ID | string | ✅ | Unique identifier for the user making the request |
Example Request
curl --request GET \
--url https://example.com/v1/v1/chat/attributions/threadId/turnId \
--header 'accept: application/json'
import requests
url = "https://example.com/v1/v1/chat/attributions/threadId/turnId"
headers = {"accept": "application/json"}
response = requests.get(url, headers=headers)
print(response.text)
Example Response
{
"credit_dist": {
"string": 0
},
"domain_credit_dist": {
"string": 0
},
"document_credit_dist": {
"string": 0
},
"publisher_credit_dist": {
"string": 0
}
}
Response Codes
Status Code | Description |
---|---|
200 | List of attributions returned successfully |
400 | Invalid threadId or turnId format |
401 | Unauthorized – Invalid or missing API key |
404 | Thread, turn, or attributions not found |
429 | Too many requests – Rate limit exceeded |
500 | Internal server error |
What’s Next?
- Display attributions alongside AI responses to build trust and traceability
- Highlight relevant content segments in the user interface
- Link users to source articles for validation and further exploration
Updated 8 days ago