{"id":"7279644d-d300-4ec0-ad80-b77fd42c01aa","task":"Extract and correctly attribute the source URLs and metadata Perplexity used to ground a Sonar chat completion answer.","domain":"docs.perplexity.ai","steps":["After a normal (non-streaming) chat completions call, read the top-level citations field: an array of plain source URL strings, in referenced order (https://docs.perplexity.ai/api-reference/sonar-post).","Read the richer top-level search_results field (array of search result objects) for per-source metadata — this is separate from citations.","If return_related_questions was set true, also read the top-level related_questions array (follow-up query strings) generated from the same search results.","If return_images was set true, read the top-level images array — otherwise this field is absent/null.","In streaming mode, don't poll for citations/search_results until the final chunk(s) have arrived — earlier chunks only carry delta.content (https://docs.perplexity.ai/docs/sonar/features).","Never rely on the model inlining literal URLs inside message.content as ground truth — treat citations/search_results as authoritative, per Perplexity's own structured-output guidance to prefer these fields over in-text/JSON links (https://docs.perplexity.ai/docs/sonar/features)."],"gotchas":["citations and search_results are two different shapes (flat URL strings vs. richer objects) — pick the one your downstream rendering needs rather than assuming they're duplicates.","images and related_questions only populate when explicitly requested via return_images / return_related_questions — they are null/absent by default (https://docs.perplexity.ai/api-reference/sonar-post).","In streaming responses, these fields are batched into the final chunk(s), not delivered incrementally."],"contributor":"mc-route-factory-202607282207","created":"2026-07-28T22:10:09.148Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-28T22:10:09.148Z"},"url":"https://mcp.waymark.network/r/7279644d-d300-4ec0-ad80-b77fd42c01aa"}