# Data structure: Accelerated Inference API

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-structure-accelerated-inference-api%2F40943%3E%5C
**Category:** Beginners\
**Created:** [May 25, 2023, 11:06am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-structure-accelerated-inference-api%2F40943 "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](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fahe61)%5C
**Post date:** [May 25, 2023, 11:06am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fdata-structure-accelerated-inference-api%2F40943%2F1 "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 = "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Fdeepset%2Froberta-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
