GentaAPI allows developers to integrate LLMs into their applications powered by open-source models.
This Quickstart is designed to help you get started to use and implement LLMs into your development environment. We believe that standard APIs thus interchangeably are the keys to healthy development and competition, thus our API could also be used and called from the OpenAI API package in Python and Node.Js
This Quickstart will cover:
How to get Genta Technology API Key
How to send GentaAPI requests
Genta Technology API Key
Currently, the current way to get Genta Technology API Keys is by contacting us at:
Contact Us
After contacting us, please allow us up to the next 24 hours to generate and set up the API key for you.
Genta API Requests
Curl
curl https://api.genta.tech/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer $GENTA_API_KEYS"
-d '{
"model": "Meta-Llama-3-8B-Instruct",
"messages": [
{
"role": "system",
"content": "Kamu adalah asisten yang pandai dalam membuat cerita wayang fiksi dan menjelaskan konsep pemrograman menggunakan media kreatif berupa cerita wayang fiksi."
},
{
"role": "user",
"content": "Buatlah cerita wayang yang menjelaskan konsep infinite loop."
}
]
}'
Python
To use GentaAPI, you can use requests or use OpenAI packages
Requests
import requests
import json
url = 'https://api.genta.tech/chat/completions'
headers = {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer GENTA_API_KEY'
}
data = {
'model': 'Meta-Llama-3-8B-Instruct',
'messages': [
{
"role": "system",
"content": "Kamu adalah asisten yang pandai dalam membuat cerita wayang fiksi dan menjelaskan konsep pemrograman menggunakan media kreatif berupa cerita wayang fiksi."
},
{
"role": "user", "content": "Buatlah cerita wayang yang menjelaskan konsep infinite loop."
}
]
}
response = requests.request(url=url, headers=headers, data=json.dumps(data), method='POST')
print(response.content)
Using OpenAI Package
Make sure you have installed the OpenAI Package
from openai import OpenAI
client = OpenAI(base_url="https://api.genta.tech", api_key=GENTA_API_KEY)
completion = client.chat.completions.create(
model="Meta-Llama-3-8B-Instruct",
messages=[
{
"role": "system",
"content": "Kamu adalah asisten yang pandai dalam membuat cerita wayang fiksi dan menjelaskan konsep pemrograman menggunakan media kreatif berupa cerita wayang fiksi."
},
{
"role": "user",
"content": "Buatlah cerita wayang yang menjelaskan konsep infinite loop."
}
]
)
print(completion.choices[0].message)
Node.JS
To use GentaAPI, you can use the OpenAI package in Node.JS
Make sure you have installed the OpenAI Package
or
import OpenAI from "openai";
const openai = new OpenAI(base_url="https://api.genta.tech", api_key=GENTA_API_KEY);
async function main() {
const completion = await openai.chat.completions.create({
messages: [
{
"role": "system",
"content": "Kamu adalah asisten yang pandai dalam membuat cerita wayang fiksi dan menjelaskan konsep pemrograman menggunakan media kreatif berupa cerita wayang fiksi."
},
{
"role": "user",
"content": "Buatlah cerita wayang yang menjelaskan konsep infinite loop."
}
],
model: "Meta-Llama-3-8B-Instruct",
});
console.log(completion.choices[0]);
}
main();