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:

  1. Create a chat session and get conversation IDs
    Call POST /v1/chat to start a conversation and receive threadId and turnId.

  2. Get AI chat response
    Call GET /v1/chat/response/{threadId}/{turnId} to retrieve the AI-generated reply.

  3. Get attributions
    Call GET /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 allowed
    • X-RateLimit-Remaining: Remaining requests
    • X-RateLimit-Reset: Reset timestamp (Unix)

Path Parameters

FieldTypeRequiredDescription
threadIdstringThread ID from your previous /v1/chat response
turnIdstringTurn ID from your previous /v1/chat response

Header Parameters

FieldTypeRequiredDescription
AuthorizationstringBearer token for API authentication
X-User-IDstringUnique 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 CodeDescription
200List of attributions returned successfully
400Invalid threadId or turnId format
401Unauthorized – Invalid or missing API key
404Thread, turn, or attributions not found
429Too many requests – Rate limit exceeded
500Internal 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