Language Support and Examples
Python
If you don't have the requests
library installed, run the following command:
pip install requests
/api/stealthify
Example
/api/stealthify
Exampleimport requests
api_token = '{API TOKEN}'
prompt = '<PROMPT>'
rephrase = True # or False
tone = '<TONE>' # Optional
mode = '<MODE>' # Optional
business = True # or False, Optional
is_multilingual = True # or False, Optional (default is True)
url = 'https://stealthgpt.ai/api/stealthify'
headers = {
'api-token': api_token,
'Content-Type': 'application/json'
}
data = {
'prompt': prompt,
'rephrase': rephrase,
'tone': tone, # Include only if needed
'mode': mode, # Include only if needed
'business': business, # Include only if needed
'isMultilingual': is_multilingual # Include only if needed
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print(response.json())
else:
print(f"Error {response.status_code}: {response.text}")
/api/stealthify/articles
Example
/api/stealthify/articles
Exampleimport requests
api_token = '{API TOKEN}'
prompt = 'tell me something about modern backend architecture'
withImages = True # Optional
size = 'medium' # Optional
is_multilingual = True # or False, Optional (default is True)
url = 'https://stealthgpt.ai/api/stealthify/articles'
headers = {
'api-token': api_token,
'Content-Type': 'application/json'
}
data = {
'prompt': prompt,
'withImages': withImages, # Include only if needed
'size': size, # Include only if needed
'isMultilingual': is_multilingual # Include only if needed
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print(response.json())
else:
print(f"Error {response.status_code}: {response.text}")
Node.js
First, install the axios
package:
npm install axios
/api/stealthify
Example
/api/stealthify
Exampleconst axios = require('axios');
const apiToken = '{API TOKEN}';
const prompt = '<PROMPT>';
const rephrase = true; // or false
const tone = '<TONE>'; // Optional
const mode = '<MODE>'; // Optional
const business = true; // or false, Optional
const isMultilingual = true; // or false, Optional (default is true)
axios.post('https://stealthgpt.ai/api/stealthify', {
prompt: prompt,
rephrase: rephrase,
tone: tone, // Include only if needed
mode: mode, // Include only if needed
business: business, // Include only if needed
isMultilingual: isMultilingual // Include only if needed
}, {
headers: {
'api-token': apiToken,
'Content-Type': 'application/json'
}
}).then(response => {
console.log(response.data);
}).catch(error => {
console.error(`Error ${error.response?.status || ''}: ${error.response?.data || error.message}`);
});
/api/stealthify/articles
Example
/api/stealthify/articles
Exampleconst axios = require('axios');
const apiToken = '{API TOKEN}';
const prompt = 'tell me something about modern backend architecture';
const withImages = true; // Optional
const size = 'medium'; // Optional
const isMultilingual = true; // or false, Optional (default is true)
axios.post('https://stealthgpt.ai/api/stealthify/articles', {
prompt: prompt,
withImages: withImages, // Include only if needed
size: size, // Include only if needed
isMultilingual: isMultilingual // Include only if needed
}, {
headers: {
'api-token': apiToken,
'Content-Type': 'application/json'
}
}).then(response => {
console.log(response.data);
}).catch(error => {
console.error(`Error ${error.response?.status || ''}: ${error.response?.data || error.message}`);
});
Ruby
/api/stealthify
Example
/api/stealthify
Examplerequire 'net/http'
require 'uri'
require 'json'
api_token = '{API TOKEN}'
prompt = '<PROMPT>'
rephrase = true # or false
tone = '<TONE>' # Optional
mode = '<MODE>' # Optional
business = true # or false, Optional
is_multilingual = true # or false, Optional (default is true)
url = URI.parse('https://stealthgpt.ai/api/stealthify')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.request_uri)
request['api-token'] = api_token
request['Content-Type'] = 'application/json'
request.body = JSON.generate({
prompt: prompt,
rephrase: rephrase,
tone: tone, # Include only if needed
mode: mode, # Include only if needed
business: business, # Include only if needed
isMultilingual: is_multilingual # Include only if needed
})
response = http.request(request)
if response.code == '200'
puts JSON.parse(response.body)
else
puts "Error #{response.code}: #{response.body}"
end
/api/stealthify/articles
Example
/api/stealthify/articles
Examplerequire 'net/http'
require 'uri'
require 'json'
api_token = '{API TOKEN}'
prompt = 'tell me something about modern backend architecture'
withImages = true # Optional
size = 'medium' # Optional
is_multilingual = true # or false, Optional (default is true)
url = URI.parse('https://stealthgpt.ai/api/stealthify/articles')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url.request_uri)
request['api-token'] = api_token
request['Content-Type'] = 'application/json'
request.body = JSON.generate({
prompt: prompt,
withImages: withImages, # Include only if needed
size: size, # Include only if needed
isMultilingual: is_multilingual # Include only if needed
})
response = http.request(request)
if response.code == '200'
puts JSON.parse(response.body)
else
puts "Error #{response.code}: #{response.body}"
end
These examples demonstrate how to integrate both the /api/stealthify
and /api/stealthify/articles
endpoints in Python, Node.js, and Ruby, while also incorporating the isMultilingual parameter. This parameter (default true
) allows for multilingual output when true
and monolingual output when false
.
Last updated