Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

[Bug] Charged citation_tokens and number_of_search_results tokens API #319

@Triespo

Description

@Triespo

🐛 Describe the Bug

Despite the update in the documentation stating that citation_tokens and number_of_search_results would no longer be billed as of April 18, 2025, they are still appearing in the usage field and seem to contribute to the final cost charged by the API.

✅ Expected Behavior

citation_tokens and number_of_search_results should not be billed or factored into the total cost calculation after April 18, 2025, per the official documentation.

❌ Actual Behavior

citation_tokens and number_of_search_results still appear in the usage breakdown and appear to be contributing to billing. When calculated, the cost matches the invoice total ($0.23), indicating they are still being charged.

🔄 Steps to Reproduce

Call the Sonar API (e.g., sonar-reasoning-3) with any query that triggers citations and search results.

Observe the usage field in the response.

Calculate the expected cost, including citation_tokens and number_of_search_results.

Compare it to the actual amount charged — they match, implying these fields are still billed.

📌 API Request & Response (if applicable)

🌍 Environment

API Version: sonar-reasoning-3

SDK (if applicable): Python OpenAi client

Operating System: Linux

Authentication Type: API Key

📎 Logs or Screenshots (if applicable)

Cost Calculation:

Input tokens: (1340 × 2 / 1,000,000)

Output tokens: (1505 × 8 / 1,000,000)

Search queries: (7 × 5 / 1,000)

Reasoning tokens: (54,927 × 3 / 1,000,000)

Citation tokens: (8,476 × 3 / 1,000,000)

Total = $0.23, which exactly matches the amount charged

📝 Additional Context

According to the documentation, neither citation_tokens nor number_of_search_results should be billed anymore. However, billing still includes them. Either the documentation is incorrect, or there is a bug in the billing logic or reporting system.

https://docs.perplexity.ai/changelog/changelog#improved-sonar-models-new-search-modes

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions