Immerse yourself in meaningful conversations with multiple iterations of ChatGPT, from the versatile GPT-3 to the evolved GPT-4. Explore a range of skills spanning from contextual analysis to advanced response generation, providing a fascinating journey through different levels of artificial intelligence and knowledge.
Usage with cURL
Use the cURL command for a quick and effective demonstration of the API with this simple command.
curl -X POST https://nexra.aryahcr.cc/api/chat/gpt
-H 'Content-Type: application/json'
-d '{
"messages": [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
}
],
"prompt": "Can you repeat my name?",
"model": "GPT-4",
"markdown": false
}'
Usage with JavaScript
You can use the fetch method to efficiently make requests to the API and retrieve the necessary data.
fetch("https://nexra.aryahcr.cc/api/chat/gpt", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
messages: [
{
role: "assistant",
content: "Hello! How are you today?"
},
{
role: "user",
content: "Hello, my name is Yandri."
},
{
role: "assistant",
content: "Hello, Yandri! How are you today?"
}
],
prompt: "Can you repeat my name?",
model: "GPT-4",
markdown: false
})
}).then((response) => {
response.text().then((result) => {
// Modify your code to remove the '_' at the end of the output
console.log(result);
}).catch((err) => {
console.log(err);
});
}).catch((err) => {
console.log(err);
});
Usage with NodeJS
Utilize the Axios npm library to efficiently and easily make requests to the API.
const axios = require('axios');
axios.post('https://nexra.aryahcr.cc/api/chat/gpt', {
messages: [
{
role: "assistant",
content: "Hello! How are you today?"
},
{
role: "user",
content: "Hello, my name is Yandri."
},
{
role: "assistant",
content: "Hello, Yandri! How are you today?"
}
],
prompt: "Can you repeat my name?",
model: "GPT-4",
markdown: false
}, {
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if(response.status === 200){
// Modify your code to remove the '_' at the end of the output
console.log(response.data);
} else {
console.log("Error");
}
}).catch(error => {
console.error('Error:', error);
});
Usage with PHP
You can use the curl function in PHP to make requests through the API.
Usage with Python
Assistant
The text provides information about the Nexra ChatGPT API and how to use it with different programming languages such as cURL, JavaScript, NodeJS, PHP, and Python. It also discusses different models available in the API and the different versions of ChatGPT. Additionally, it includes JSON responses, error codes, and terms and conditions of use.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
data = {
"messages": [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
}
],
"prompt": "Can you repeat my name?",
"model": "GPT-4",
"markdown": False
}
try:
response = requests.post(url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
# Modify your code to remove the '_' at the end of the output
print(response.text)
else:
print(f"Error: {response.status_code}")
except Exception as e:
print(e)
JSON Response
The following is the final result in JSON format obtained after making a call to the API.
{
"code": 200,
"status": true,
"model": "gpt-4",
"gpt": "Hello, Yandri! How can I assist you today?",
"original": null
}
Modelos
Select one of these available models in the API to enhance your experience.
This enhanced version of the language model, GPT-4, has been fine-tuned and refined with significant improvements through my work. However, it is important to note that, as with any system, errors or limitations may arise in certain internet searches due to the complex and constantly evolving nature of technology. Therefore, while this model has been improved with my intervention, I recommend exercising caution when relying entirely on its accuracy for certain queries or online tasks.
Usage with cURL
Use the cURL command for a quick and effective demonstration of the API with this simple command.
curl -X POST https://nexra.aryahcr.cc/api/chat/gptweb
-H 'Content-Type: application/json'
-d '{
"prompt": "¿What is DALLE-3 and how does it create images?",
"markdown": false
}'
Usage with JavaScript
You can use the fetch method to efficiently make requests to the API and retrieve the necessary data.
fetch("https://nexra.aryahcr.cc/api/chat/gptweb", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
prompt: "¿What is DALLE-3 and how does it create images?",
markdown: false
})
}).then((response) => {
response.text().then((result) => {
// Modify your code to remove the '_' at the end of the output
console.log(result);
}).catch((err) => {
console.log(err);
});
}).catch((err) => {
console.log(err);
});
Usage with NodeJS
Utilize the Axios npm library to efficiently and easily make requests to the API.
const axios = require('axios');
axios.post('https://nexra.aryahcr.cc/api/chat/gptweb', {
prompt: "¿What is DALLE-3 and how does it create images?",
markdown: false
}, {
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if(response.status === 200){
// Modify your code to remove the '_' at the end of the output
console.log(response.data);
} else {
console.log("Error");
}
}).catch(error => {
console.error('Error:', error);
});
Usage with PHP
You can use the curl function in PHP to make requests through the API.
Usage with Python
You can use Python along with the requests library to make the request to the API.
data = {
"prompt": "¿What is DALLE-3 and how does it create images?",
"markdown": False
}
try:
response = requests.post(url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
# Modify your code to remove the '_' at the end of the output
print(response.text)
else:
print(f"Error: {response.status_code}")
except Exception as e:
print(e)
JSON Response
The following is the final result in JSON format obtained after making a call to the API.
{
"code": 200,
"status": true,
"gpt": "DALLE-3 is an AI model developed by OpenAI that is capable of generating images based on text descriptions. It is an advanced version of the DALL-E model, which was first launched in January 2021. DALLE-3 has been trained using a huge dataset of text-image pairs and is capable of generating images that closely adhere to the provided text prompts.\n\nTo create an image using DALLE-3, users can provide a text description as input, and the model will generate an image that corresponds to that description. The model has been trained with a large number of images and text descriptions, allowing it to understand and capture the nuances and details of the text prompts to create visually accurate and appealing images.\n\nDALLE-3 represents a significant improvement in the field of generative AI technology and has the potential to be used for various applications, including concept art, illustrations, visualizing ideas, and creating memes. It combines the power of deep learning with image generation, allowing users to generate images based on their textual descriptions.",
"original": null
}
ChatGPT v2
It's quite similar, with the difference that it has the capability to generate real-time responses via streaming using GPT-3.5 Turbo.
Usage with cURL
Use the cURL command for a quick and effective demonstration of the API with this simple command.
curl -X POST https://nexra.aryahcr.cc/api/chat/complements
-H 'Content-Type: application/json'
-d '{
"messages": [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
},
{
"role": "user",
"content": "Can you repeat my name?"
}
],
"stream": false,
"markdown": false,
"model": "chatgpt"
}'
Usage with JavaScript
You can use the fetch method to efficiently make requests to the API and retrieve the necessary data.
let messages = [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
},
{
"role": "user",
"content": "Can you repeat my name?"
}
]
// Normal
fetch("https://nexra.aryahcr.cc/api/chat/complements", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
messages: messages,
stream: false,
markdown: false,
model: "chatgpt"
})
}).then((response) => {
response.text().then((result) => {
// Modify your code to remove the '_' at the end of the output
console.log(result);
}).catch((err) => {
console.log(err);
});
}).catch((err) => {
console.log(err);
});
Utilize the Axios npm library to efficiently and easily make requests to the API.
let messages = [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
},
{
"role": "user",
"content": "Can you repeat my name?"
}
]
// Normal
const axios = require('axios');
axios.post('https://nexra.aryahcr.cc/api/chat/complements', {
messages: messages,
stream: false,
markdown: false,
model: "chatgpt"
}, {
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
if(response.status === 200){
// Modify your code to remove the '_' at the end of the output
console.log(response.data);
} else {
console.log("Error");
}
}).catch(error => {
console.error('Error:', error);
});
messages = [
{
"role": "assistant",
"content": "Hello! How are you today?"
},
{
"role": "user",
"content": "Hello, my name is Yandri."
},
{
"role": "assistant",
"content": "Hello, Yandri! How are you today?"
},
{
"role": "user",
"content": "Can you repeat my name?"
}
]
try:
response = requests.post(url, headers=headers, data=json.dumps(data))
if response.status_code == 200:
# Modify your code to remove the '_' at the end of the output
print(response.text)
else:
print(f"Error: {response.status_code}")
except Exception as e:
print(e)
try:
response = requests.post(url, json=payload, stream=True)
if response.status_code == 200:
tmp = None
err = None
for chunk in response.iter_content(chunk_size=1024):
if err == None:
if chunk:
chk = chunk.decode()
chk = chk.split("")
for data in chk:
result = None
try:
convert = json.loads(data)
result = data
tmp = None
except Exception as e:
if tmp == None:
tmp = data
else:
try:
convert = json.loads(tmp)
result = tmp
tmp = None
except Exception as e:
tmp = tmp + data
try:
convert = json.loads(tmp)
result = tmp
tmp = None
except Exception as e:
tmp = tmp
if result != None:
if "code" not in result and "status" not in result:
print(result)
else:
err = result
print(err)
else:
print("Error")
except requests.exceptions.RequestException as e:
print(e)
JSON Response
The following is the final result in JSON format obtained after making a call to the API.
{
"code": 200,
"status": true,
"model": "ChatGPT",
"message": "Of course, Yandri! How can I assist you today?",
"original": null
}
Transmisión de la respuesta JSON
Lo siguiente es el resultado final obtenido en formato JSON a través de transmisión después de realizar una llamada a la API.
{"message":"Hello! How are you today?","original":null,"finish":false,"error":false}
{"message":"","original":null,"finish":false,"error":false}
{"message":"Of","original":null,"finish":false,"error":false}
{"message":"Of course","original":null,"finish":false,"error":false}
{"message":"Of course,","original":null,"finish":false,"error":false}
{"message":"Of course, Yand","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri!","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist you","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist you today","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist you today?","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist you today?","original":null,"finish":false,"error":false}
{"message":"Of course, Yandri! How can I assist you today?","original":null,"finish":false,"error":false}
{"message":null,"original":null,"finish":true,"error":false}
Error Codes
These are the error codes that will be presented in case the API fails.
Code Error Description
400 BAD_REQUEST Not all parameters have been entered correctly
500 INTERNAL_SERVER_ERROR The server has experienced failures
200 The API worked without issues