Decisions API: shared state counted per question in usage.input_tokens

Summary

The Decisions API reports shared state tokens once per question in a batch. With eight questions, extending the state by 1,000 tokens increases usage.input_tokens by 8,000 rather than 1,000. Identical requests to Jev increase by 1,000 regardless of question count.

Reproduced twice with direct HTTP requests and synthetic text, without an SDK, retries, an application adapter, or a response cache. All requests succeeded with HTTP 200.

Expected behavior

I expected the shared state to contribute once per request, plus the tokens for each question. If repeating the state in billable usage for every question is intentional, please explicitly document that accounting rule and the resulting cost of batching. Otherwise, could you investigate the input-token accounting?

The pricing documentation says billing uses the response usage.input_tokens. I have verified the response counts, but have not independently reconciled them against an invoice.

Actual behavior

State Questions Perplexity pplx-decider-v1.1-27b Jev jev-1.13.0
Short 1 99 288
Short 8 792 393
Long 1 1,099 1,288
Long 8 8,792 1,393

Subtracting short-state usage from long-state usage controls for question overhead and tokenizer differences:

  • Perplexity: 1,000 extra tokens with one question; 8,000 with eight questions.
  • Jev: 1,000 extra tokens with one question; 1,000 with eight questions.

Perplexity also multiplies both full-request counts exactly by eight: 99 → 792 and 1,099 → 8,792. The state occurs only once in each JSON request body.

Minimal reproduction

Save as reproduce.py, set PERPLEXITY_API_KEY and TYPESAFE_API_KEY in the environment, and run python3 reproduce.py. No packages are needed. It makes four paid requests to each provider and prints usage and request IDs. Jev is a comparison control; the first four calls reproduce the Perplexity behavior independently.

import json
import os
from urllib.request import Request, urlopen

providers = [
    ("Perplexity", "https://api.perplexity.ai/v1/decisions",
     "pplx-decider-v1.1-27b", "PERPLEXITY_API_KEY"),
    ("Jev", "https://api.typesafe.ai/v1/systemone",
     "jev-1.13.0", "TYPESAFE_API_KEY"),
]
short = "The warehouse shipment arrived on Tuesday. "
states = {
    "short": {"document": short},
    "long": {"document": short +
             "The inventory contains numbered blue boxes and green labels. " * 100},
}

for provider, endpoint, model, key in providers:
    counts = {}
    for length, state in states.items():
        for n in (1, 8):
            body = {
                "model": model,
                "state": state,
                "questions": {
                    f"q{i}": {
                        "type": "noul",
                        "instructions": "Does the document say the shipment arrived?",
                    }
                    for i in range(n)
                },
            }
            request = Request(
                endpoint, data=json.dumps(body).encode(),
                headers={"Authorization": "Bearer " + os.environ[key],
                         "Content-Type": "application/json"},
            )
            with urlopen(request, timeout=45) as response:
                payload = json.load(response)
                request_id = response.headers.get("x-request-id")
            counts[length, n] = payload["usage"]["input_tokens"]
            print(provider, length, n, payload["usage"], request_id)
    print(provider, "extra state tokens:",
          "one question =", counts["long", 1] - counts["short", 1],
          "eight questions =", counts["long", 8] - counts["short", 8])

Request details

  • Endpoint: POST https://api.perplexity.ai/v1/decisions
  • Model: pplx-decider-v1.1-27b
  • Language: Python 3.13.13; standard-library HTTP client
  • Approximate time: October 8, 2026, 17:56 UTC (19:56 Africa/Johannesburg)
  • Consistency: identical counts in two independent executions
  • Content: synthetic warehouse text only; no images or private data

Perplexity request IDs from the second execution:

State Questions Request ID
Short 1 682bfd05-10aa-4ec2-9736-c6be3d577a73
Short 8 f9017169-e57a-4f2f-a7ad-6eab52e22b31
Long 1 4b30c5e9-f6b3-455c-b8a6-4f3863c85d71
Long 8 bd8553b7-236e-47d7-a993-cf9d92868f11

The long-state, eight-question response returned this usage excerpt (HTTP 200):

{"usage": {"input_tokens": 8792, "output_tokens": 8}}

Impact

Batching many questions against a shared document multiplies the state component of reported billable usage. This materially changes cost estimates compared with accounting that amortizes shared state across questions. Could you confirm whether this is intended billing behavior or a usage-reporting bug?

Hello @Urs_de_Swardt,

Thank you for the report. I have sent it over to Engineering for review. I will confirm if this is the intended behavior.

Andrew

I’ve confirmed with engineering that the model is working as expected.

Each question runs its own inference with the full state, so the state is counted once per question in usage. input_tokens. Billing uses that same value.

I’ve passed your request to engineering: count the shared state once per request as a feature request.

Thank you,

Andrew

The billing count reflects how each sub-request is processed rather than bugged reporting. When batching questions against shared state, the engine treats each question as a separate context evaluation, so the full document tokens are counted for each prompt. If you need to amortize input tokens, sending a single structured prompt that asks for all evaluations at once avoids the per-question state multiplication.

Thanks for the quick response!

If you need to amortize input tokens, sending a single structured prompt that asks for all evaluations at once avoids the per-question state multiplication.

Could you maybe share an example?

Hi Andrew and Lukas, I just want to follow up on this.

Hello! Can I please get some help with this?

Hello @Urs_de_Swardt ,

We just updated the model to pplx-decider-v1.2. Billing is now State + Questions. Please try the new model (also available is pplx-decider-flash-v1.2).

Thank you,

Andrew

Thanks Andrew! Looks like it’s fixed on pplx-decider-v1.2. pplx-decider-flash-v1.2 still has the old behaviour, but we’re not using it yet, so not a blocker for us.

@andrewmadson-pplx I can confirm similar behavior for Flash v1.2 via OpenRouter, with the upstream provider reported as Perplexity.

For perplexity/pplx-decider-flash-v1.2, my saved response usage shows:

Questions in one request 2026-10-17 input tokens 2026-10-21 input tokens
1 353–354 354
10 666 3,584
100 3,711 35,994

The 100-question comparison uses exactly the same question IDs and question descriptions on both dates. Both requests contained one image, using the same image-quality setting, with image payload sizes of 41,252 and 41,286 bytes respectively. The images were different captures, so this is a comparison of historical observations, not a byte-identical replay. The 10-question sets differ and should not be treated as a controlled same-question comparison.

The 100-question input usage is now approximately 9.7 times the earlier value, while single-question usage is essentially unchanged. This appears consistent with shared-state tokens being counted separately for each question on the Flash route, but I cannot confirm the internal accounting mechanism. These are returned usage values; I have not reconciled them against an invoice.

Relevant OpenRouter generation IDs:

  • 2026-10-17, 100 questions, 3,711 input / 100 output: gen-dec-1792201599-Tm5CDP3twckQMVkrBcX5
  • 2026-10-21, 100 questions, 35,994 input / 100 output: gen-dec-1792548053-VPPjyCBrY35QYeAus9MX
  • 2026-10-21, 10 questions, 3,584 input / 10 output: gen-dec-1792548363-PRCrK46GeSIKySG3dbZ1
  • 2026-10-21, 1 question, 354 input / 1 output: gen-dec-1792548201-8H7dOnE3NfAL0vvxTEQx

My separate latest test of standard Decider v1.2 remains consistent with its earlier usage, matching the distinction reported above between standard and Flash.

Could the team please clarify:

  1. Does the announced “State + Questions” accounting apply to Flash v1.2 as well as standard v1.2, including requests routed through OpenRouter?
  2. Is the Flash behavior above a known usage-reporting or routing issue, or intended accounting? If intended, when did it change?
  3. Are these returned input-token counts also the billable counts, and what is the next update or expected resolution for Flash?

No image contents, question contents, credentials, or private application details are included here. I can provide further sanitized technical details privately if needed.

I confirmed with the team -

Decider and decider-flash treat state differently. pplx-decider-v1.2 is (state + questions). Flash is mean for fewer questions and is (state * questions). This is intentional and is not an error.

Docs have been updated to reflect the difference between decider and decider-flash.

Thanks for chasing this down, the state × questions rule for flash is easy to miss when budgeting. The way we look at it at aicost.tools: with a big shared state, flash becomes more expensive than the full decider once the number of questions per request passes roughly the ratio of their per-token prices, so for large batches the “cheaper” model can end up costing more. @andrewmadson-pplx did pplx-decider-v1.3 and flash-v1.3 keep the same accounting?