A model has a 5000-token context budget. The prompt uses 2000 tokens and you reserve 1000 output tokens. How many tokens remain for additional retrieved text?
Answer & explanation
Answer: 2000
Subtract both the existing input and the reserved output from the total context budget. Real APIs may also have separate output limits.