# Is there an response length limit for the inference API?

**URL:** <https://discuss.huggingface.co/t/is-there-an-response-length-limit-for-the-inference-api/79153>\
**Category:** Inference Endpoints on the Hub\
**Created:** [March 28, 2024, 3:06pm UTC](https://discuss.huggingface.co/t/is-there-an-response-length-limit-for-the-inference-api/79153 "2024-03-28T15:06:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![roland71](https://avatars.discourse-cdn.com/v4/letter/r/c37758/32.png) [@roland71](https://discuss.huggingface.co/u/roland71)\
**Post date:** [March 28, 2024, 3:06pm UTC](https://discuss.huggingface.co/t/is-there-an-response-length-limit-for-the-inference-api/79153/1 "2024-03-28T15:06:53Z")

</div>

Hi, I am testing the Inference API with different models to rewrite texts. But no matter which model I choose, only about 2 - 3 sentences are returned as response. How can this be adjusted?

---

<div class="post-metadata">

**Author:** ![davidsmith026](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@davidsmith026](https://discuss.huggingface.co/u/davidsmith026)\
**Post date:** [August 4, 2026, 10:24am UTC](https://discuss.huggingface.co/t/is-there-an-response-length-limit-for-the-inference-api/79153/2 "2026-08-04T10:24:58Z")

</div>

A few things to check:

- Make sure you’re setting `max_new_tokens` (or the equivalent generation parameter) high enough. The default value can be quite small.

- Verify that the model you’re using supports long-form text generation.

- Check whether your input plus output exceeds the model’s context window.

- If you’re using the Inference API, inspect the full response to see if it indicates the generation stopped because it reached a token limit (`finish_reason` or similar).

If you can share the model name and your request payload, it will be easier to identify the cause.
