# Inference API detailed request

**URL:** <https://discuss.huggingface.co/t/inference-api-detailed-request/876>\
**Category:** Beginners\
**Created:** [August 26, 2020, 3:13pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876 "2020-08-26T15:13:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hexapoda](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hexapoda/32/295_2.png) [@Hexapoda](https://discuss.huggingface.co/u/Hexapoda)\
**Post date:** [August 26, 2020, 3:13pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/1 "2020-08-26T15:13:47Z")

</div>

I am using this api endpoint of gpt2 from [https://huggingface.co/gpt2](https://huggingface.co/gpt2)  
this is given curl request,  
" curl -X POST   
-H “Authorization: Bearer api\_xxxxxxxxxxxxxxxxxxxxxxx”   
-H “Content-Type: application/json”   
-d ‘“My name is Mariama, my favorite”’   
[https://api-inference.huggingface.co/models/gpt2](https://api-inference.huggingface.co/models/gpt2) "

The problem is this request only specifies start of the output text. “my name is marima, my favorite” in this case.  
But when using transformers you can specify max lenght of output too with

```auto
>>> generator("Hello, I'm a language model,", max_length=30, num_return_sequences=5)

```

is it achievable with inference api ? Probably something like below request.

" curl -X POST   
-H “Authorization: Bearer api\_xxxxxxxxxxxxxxxxxxxxxxx”   
-H “Content-Type: application/json”   
-d ‘“My name is Mariama, my favorite”’   
-d “max\_length = 30”  
htt/api-inference.huggingface.co/models/gpt2 "

---

<div class="post-metadata">

**Author:** ![rgwatwormhill](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rgwatwormhill](https://discuss.huggingface.co/u/rgwatwormhill)\
**Post date:** [August 26, 2020, 9:55pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/2 "2020-08-26T21:55:17Z")

</div>

hi hexapoda,

I have no idea what your post is asking about, but the link doesn’t seem to work (I get “method not allowed” when I try to use it).

It might be good to include more detail too.

---

<div class="post-metadata">

**Author:** ![Hexapoda](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hexapoda/32/295_2.png) [@Hexapoda](https://discuss.huggingface.co/u/Hexapoda)\
**Post date:** [August 27, 2020, 12:30pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/3 "2020-08-27T12:30:18Z")

</div>

i edited the post, my question briefly " is there any other way to use inference api ?"

---

<div class="post-metadata">

**Author:** ![valhalla](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/valhalla/32/4179_2.png) [@valhalla](https://discuss.huggingface.co/u/valhalla)\
**Post date:** [August 28, 2020, 3:54pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/4 "2020-08-28T15:54:50Z")

</div>

Hey, I think this not yet available, @julien-c might have better answer

---

<div class="post-metadata">

**Author:** ![clem](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/clem/32/2838_2.png) [@clem](https://discuss.huggingface.co/u/clem)\
**Post date:** [September 11, 2020, 12:10pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/5 "2020-09-11T12:10:53Z")

</div>

Hi @Hexapoda! This is going to be available in the next release of our paid accelerated inference API. If you’re still interested, feel free to send an email to [api-enterprise@huggingface.co](mailto:api-enterprise@huggingface.co).

---

<div class="post-metadata">

**Author:** ![Hexapoda](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/hexapoda/32/295_2.png) [@Hexapoda](https://discuss.huggingface.co/u/Hexapoda)\
**Post date:** [September 11, 2020, 12:23pm UTC](https://discuss.huggingface.co/t/inference-api-detailed-request/876/6 "2020-09-11T12:23:37Z")

</div>

Thanks for your attention, i already created my own api which is more flexible and fast as expected. Put huggingface helped me a lot with prototype great community!
