2.7 Hyper Code
The HyperCode endpoint generates code based on a provided prompt using the "HyperCode" model. Users must have sufficient credits, which are deducted upon successful code generation.
Method: POST
Endpoint
https://sdk.hypergpt.ai/hyperCode
Headers:
Bearer Token
new_user_token
Params:
Query (str): The text prompt provided by the user for generating the code.
Example Request:
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):
{
"content": "def factorial(n):\n if n == 0:\n return 1\n else:\n return n * factorial(n-1)"
}
Example Response (Error):
{
"detail": "Credit not enough"
}
Last updated