Language Support and Examples

To incorporate both endpoints into your integration examples across Python, Node.js, and Ruby, here's how you can adjust the documentation to include the /api/stealthify and /api/stealthify/articles endpoints:

Python

If you don't have the requests library installed, run the following command:

pip install requests

/api/stealthify Example:

import requests

api_token = '{API TOKEN}'
prompt = '<PROMPT>'
rephrase = True  # or False
tone = '<TONE>'  # Optional
mode = '<MODE>'  # Optional
business = True  # or False, Optional

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
}

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:

import requests

api_token = '{API TOKEN}'
prompt = 'tell me something about modern backend architecture'

url = 'https://stealthgpt.ai/api/stealthify/articles'
headers = {
    'api-token': api_token,
    'Content-Type': 'application/json'
}
data = {
    'prompt': prompt
}

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 by running:

npm install axios

/api/stealthify Example:

const 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

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
}, {
    headers: {
        'api-token': apiToken,
        'Content-Type': 'application/json'
    }
}).then(response => {
    console.log(response.data);
}).catch(error => {
    console.error(error);
});

/api/stealthify/articles Example:

const axios = require('axios');

const apiToken = '{API TOKEN}';
const prompt = 'tell me something about modern backend architecture';

axios.post('https://stealthgpt.ai/api/stealthify/articles', {
    prompt: prompt
}, {
    headers: {
        'api-token': apiToken,
        'Content-Type': 'application/json'
    }
}).then(response => {
    console.log(response.data);
}).catch(error => {
    console.error(error);
});

Ruby

/api/stealthify Example:

require '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

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
})

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:

require 'net/http'
require 'uri'
require 'json'

api_token = '{API TOKEN}'
prompt = 'tell me something about modern backend architecture'

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
})

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, allowing you to generate or rephrase content and create undetectable blog articles with relevant images.

Last updated