# Hugging Face API parameters

**URL:** <https://discuss.huggingface.co/t/hugging-face-api-parameters/24443>\
**Category:** Beginners\
**Created:** [October 14, 2022, 1:21pm UTC](https://discuss.huggingface.co/t/hugging-face-api-parameters/24443 "2022-10-14T13:21:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![findus8000](https://avatars.discourse-cdn.com/v4/letter/f/71c47a/32.png) [@findus8000](https://discuss.huggingface.co/u/findus8000)\
**Post date:** [October 14, 2022, 1:21pm UTC](https://discuss.huggingface.co/t/hugging-face-api-parameters/24443/1 "2022-10-14T13:21:00Z")

</div>

Hi, complete noob here. I am trying to use the the inference api to do some text generation with the bloom model. When I get my generated text from the api in my code it seems to be using the “greedy” setting instead of the “sampling”. Like it is shown in the example here: [bigscience/bloom · Hugging Face](https://huggingface.co/bigscience/bloom). So my question is how do I change the parameters([Detailed parameters](https://huggingface.co/docs/api-inference/detailed_parameters#text-generation-task)) of the model because I guess that’s how I get the output to be more like “sampling” on the model webpage. Ive tried sending parameters like this:

```auto
const response = await fetch(
        "https://api-inference.huggingface.co/models/bigscience/bloom",
        {
            headers: { Authorization: `Bearer ${key}` },
            method: "POST",
            body: JSON.stringify({inputs: data, parameters: {top_k: 0, etc}})
        }
    );

```

But it does not work. Any help would be appreciated!
