Skip to content

Extremely high token usage on s.jina.ai — spikes up to 1.9M tokens per single request #1241

Description

@tabunovav1980

Hello Jina team,

I'm running a production news aggregation service and experiencing extremely high token consumption on s.jina.ai, including single-request spikes that appear to be a bug on your side.


Token usage history (with evidence)

April 5 (BEFORE any optimizations on our side):

  • 05:23 — 1 request → 1,925,546 tokens (s.jina.ai)
  • 00:43 — 1 request → 92,640 tokens (s.jina.ai)

April 6 (still before our optimizations were deployed):

  • 16:59 — 4 requests → 1,112,564 tokens (s.jina.ai) = ~278k per request
  • 17:42 — 4 requests → 224,988 tokens (s.jina.ai)
  • 15:40 — 1 request → 128,452 tokens (s.jina.ai)
  • 10:58 — 3 requests → 285,437 tokens (s.jina.ai)

April 7 (after we added X-Respond-With: no-content + X-Token-Budget: 15000):

  • 04:39 — 1 request → 434,395 tokens (s.jina.ai)
  • 02:58 — 1 request → 96,749 tokens (s.jina.ai)

April 9 (optimizations confirmed present in code):

  • 02:26 — 2 requests → 1,925,830 tokens (s.jina.ai)
  • 03:48 — 2 requests → 211,527 tokens (s.jina.ai)
  • 05:33 — 1 request → 57,402 tokens (s.jina.ai)

7-day total: 7,313,470 tokens across 46 requests (~159,000 tokens/request average)


Our implementation

We call s.jina.ai only as a last resort — after HTML parsing and known-source detection have failed. It is NOT called for every article.

Current request code:

jina_url = f"https://s.jina.ai/{query}?count=3"
headers = {
    'Authorization': f'Bearer {API_KEY}',
    'X-Respond-With': 'no-content',  # only URL+title, no page loading
    'X-Token-Budget': '15000',
    'Accept': 'application/json',
}

Despite X-Respond-With: no-content and X-Token-Budget: 15000, we still see requests consuming 400k–1.9M tokens. The optimizations appear to have no effect.


Questions

  1. Does X-Respond-With: no-content actually work for s.jina.ai? Our data suggests it is being ignored — token counts are far above what URL+title-only responses should cost.

  2. What causes single-request spikes of 1.9M tokens? This happened on April 5 (before our optimizations) AND again on April 9 (after optimizations). 1 request → 1,925,546 tokens seems like a bug on your end.

  3. Is X-Token-Budget a hard cap or a soft suggestion for s.jina.ai? If we set it to 12,000, will requests exceeding that budget FAIL rather than proceed at full cost?

  4. Your pricing page states s.jina.ai has a minimum fixed cost of 10,000 tokens per request. We are seeing an average of 159,000 tokens per request. What is driving this 15x overage?

  5. Is there any way to retrieve ONLY search result URLs and titles (no page content whatsoever) to stay close to the 10,000 token minimum?

Thank you for your help. We are happy to share API key details privately if it helps diagnose the issue.

Best regards,
Alexei

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions