# 2.7 Hyper Code

**Method:** `POST`

#### Endpoint

```
https://sdk.hypergpt.ai/hyperCode
```

**Headers:**

<table data-header-hidden><thead><tr><th width="343">Key</th><th>Value</th></tr></thead><tbody><tr><td>Bearer Token</td><td>new_user_token</td></tr></tbody></table>

**Params**:

* **Query (str):** The text prompt provided by the user for generating the code.

#### Example Request:

```python
headers = {
    "Authorization": "Bearer " + bearer_token,

}
data = {
    "Query": Query,
}
response = requests.post(
    "https://sdk.hypergpt.ai/hyperCode",
    headers=headers,
    params=data
)

return response.json()
```

#### Example Response (Success):

```swift
{
    "content": "def factorial(n):\n    if n == 0:\n        return 1\n    else:\n        return n * factorial(n-1)"
}
```

#### Example Response (Error):

```json
{
    "detail": "Credit not enough"
}
```
