Coding Assistant
The Coding Assistant API is a powerful tool designed to streamline coding workflows and enhance developer productivity.
Last updated
The Coding Assistant API is a powerful tool designed to streamline coding workflows and enhance developer productivity.
Last updated
curl -X 'POST' \
'https://api.magicapi.dev/api/v1/magicapi/coder/coder' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"top_k": 250,
"top_p": 0.95,
"prompt": "Write a javascript function that calculates euclidean distance between two coordinates of any dimension",
"max_tokens": 500,
"temperature": 0.95,
"system_prompt": "string",
"repeat_penalty": 1.1,
"presence_penalty": 0,
"frequency_penalty": 0
}'import requests
headers = {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY',
'Content-Type': 'application/json',
}
json_data = {
'top_k': 250,
'top_p': 0.95,
'prompt': 'Write a javascript function that calculates euclidean distance between two coordinates of any dimension',
'max_tokens': 500,
'temperature': 0.95,
'system_prompt': 'string',
'repeat_penalty': 1.1,
'presence_penalty': 0,
'frequency_penalty': 0,
}
response = requests.post('https://api.magicapi.dev/api/v1/magicapi/coder/coder', headers=headers, json=json_data)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/coder/coder');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json',
'x-magicapi-key: API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n \"top_k\": 250,\n \"top_p\": 0.95,\n \"prompt\": \"Write a javascript function that calculates euclidean distance between two coordinates of any dimension\",\n \"max_tokens\": 500,\n \"temperature\": 0.95,\n \"system_prompt\": \"string\",\n \"repeat_penalty\": 1.1,\n \"presence_penalty\": 0,\n \"frequency_penalty\": 0\n}");
$response = curl_exec($ch);
curl_close($ch);import axios from 'axios';
const response = await axios.post(
'https://api.magicapi.dev/api/v1/magicapi/coder/coder',
{
'top_k': 250,
'top_p': 0.95,
'prompt': 'Write a javascript function that calculates euclidean distance between two coordinates of any dimension',
'max_tokens': 500,
'temperature': 0.95,
'system_prompt': 'string',
'repeat_penalty': 1.1,
'presence_penalty': 0,
'frequency_penalty': 0
},
{
headers: {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY',
'Content-Type': 'application/json'
}
}
);fetch('https://api.magicapi.dev/api/v1/magicapi/coder/coder', {
method: 'POST',
headers: {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
'top_k': 250,
'top_p': 0.95,
'prompt': 'Write a javascript function that calculates euclidean distance between two coordinates of any dimension',
'max_tokens': 500,
'temperature': 0.95,
'system_prompt': 'string',
'repeat_penalty': 1.1,
'presence_penalty': 0,
'frequency_penalty': 0
})
});{
"request_id": REQUEST_ID
}curl -X 'GET' \
'https://api.magicapi.dev/api/v1/magicapi/coder/predictions/REQUEST_ID' \
-H 'accept: application/json' \
-H 'x-magicapi-key: API_KEY'import requests
headers = {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY',
}
response = requests.get('https://api.magicapi.dev/api/v1/magicapi/coder/predictions/REQUEST_ID', headers=headers)<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/magicapi/coder/predictions/REQUEST_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'accept: application/json',
'x-magicapi-key: API_KEY',
]);
$response = curl_exec($ch);
curl_close($ch);import axios from 'axios';
const response = await axios.get('https://api.magicapi.dev/api/v1/magicapi/coder/predictions/REQUEST_ID', {
headers: {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY'
}
});fetch('https://api.magicapi.dev/api/v1/magicapi/coder/predictions/REQUEST_ID', {
headers: {
'accept': 'application/json',
'x-magicapi-key': 'API_KEY'
}
});{
"status": "succeeded",
"result": "RESULT_URL"
}