# Data structure: Accelerated Inference API

**URL:** <https://discuss.huggingface.co/t/data-structure-accelerated-inference-api/40943>\
**Category:** Beginners\
**Created:** [May 25, 2023, 11:06am UTC](https://discuss.huggingface.co/t/data-structure-accelerated-inference-api/40943 "2023-05-25T11:06:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahe61](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@ahe61](https://discuss.huggingface.co/u/ahe61)\
**Post date:** [May 25, 2023, 11:06am UTC](https://discuss.huggingface.co/t/data-structure-accelerated-inference-api/40943/1 "2023-05-25T11:06:43Z")

</div>

Hi,

new to the forum, so I hope the question isn’t to silly ☹

I try to copy examples on the blog post of one-shot learning, but I can’t figure out the payload format.  
The snippet: ([Detailed parameters](https://huggingface.co/docs/api-inference/detailed_parameters))

```auto
import json
import requests
headers = {"Authorization": f"Bearer {API_TOKEN}"}
API_URL = "https://api-inference.huggingface.co/models/deepset/roberta-base-squad2"
def query(payload):
    data = json.dumps(payload)
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))
data = query(
    {
        "inputs": {
            "question": "What's my name?",
            "context": "My name is Clara and I live in Berkeley.",
        }
    }
)

print(data)
 'Error:u n k n o w n e r r o r'

```

In a later phase I wish to use this with few-shot learning, so if you have the solution 😉

thanks,

Andreas
