Skip to content

API / long context

Long-context LLM API: planning and limits

Use BrokenGPT's long-context API responsibly with token budgeting, retrieval, summarization, structured prompts, context error handling, and evaluation guidance.

UPDATED 01 Aug 20268 MIN READTECHNICAL GUIDE
01

A large context window is capacity, not guaranteed recall.

The BrokenGPT public contract defaults to a 1,048,576-token context cap, with the live configured value published on the system page. Input, tool definitions, response schemas, and any explicit output allowance must fit together.

More context can reduce truncation, but it can also increase latency, cost, distraction, and the chance that relevant evidence is buried. Measure answer quality at the document positions and lengths your product will use.

02

Reserve context for instructions and the answer.

  1. Count or estimate the serialized messages, tools, and schemas.
  2. Choose an output allowance that matches the task rather than the maximum remaining capacity.
  3. Leave a margin for serialization and tokenizer differences.
  4. If the request is too large, reduce history, retrieve passages, summarize in stages, or split the job.
03

Choose a pattern based on the evidence shape.

Long-context application patterns
PatternUse whenMain risk
Full documentOne bounded source must be read togetherCost and weak attention to middle sections
RetrievalA small set of passages answers each queryMissing evidence during retrieval
Map-reduceMany independent sections can be summarizedLosing cross-section relationships
Rolling summaryConversation history grows over timeSummary drift and omitted commitments
Hierarchical analysisLarge corpora need section and corpus viewsComplex orchestration and traceability
04

Test recall, citation, latency, and cost at realistic lengths.

  • Place answer-bearing evidence near the start, middle, and end of samples.
  • Include conflicting and irrelevant passages to measure grounding.
  • Require source identifiers or quoted spans that your application can verify.
  • Record input/output tokens, first-token latency, total latency, and failure rate.
  • Test context_length_exceeded and cancellation paths explicitly.

STRAIGHT ANSWERS

Frequently asked questions

01What is the BrokenGPT context window?

The public contract defaults to 1,048,576 tokens; the system page displays the live configured cap.

02Does a large context guarantee the model will use every fact?

No. Capacity does not guarantee perfect recall, reasoning, or citation across the entire input.

03Should I always send the full document library?

Usually not. Retrieval, selection, or hierarchical processing can reduce cost and distraction while improving traceability.

BUILD WITH THE LIVE CONTRACT

Test one real request end to end.

Create a scoped key, send a representative prompt, and verify output, usage, limits, and error handling before expanding the integration.

Create an account