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:
pipinstallrequests
/api/stealthify Example:
import requestsapi_token ='{API TOKEN}'prompt ='<PROMPT>'rephrase =True# or Falsetone ='<TONE>'# Optionalmode ='<MODE>'# Optionalbusiness =True# or False, Optionalurl ='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 requestsapi_token ='{API TOKEN}'prompt ='tell me something about modern backend architecture'withImages =True# Optionalsize ='medium'# Optionalurl ='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}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:
npminstallaxios
/api/stealthify Example:
constaxios=require('axios');constapiToken='{API TOKEN}';constprompt='<PROMPT>';constrephrase=true; // or falseconsttone='<TONE>'; // Optionalconstmode='<MODE>'; // Optionalconstbusiness=true; // or false, Optionalaxios.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:
constaxios=require('axios');constapiToken='{API TOKEN}';constprompt='tell me something about modern backend architecture';constwithImages=true; // Optionalconstsize='medium'; // Optionalaxios.post('https://stealthgpt.ai/api/stealthify/articles', { prompt: prompt, withImages: withImages,// Include only if needed size: size // Include only if needed}, { 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 falsetone ='<TONE>'# Optionalmode ='<MODE>'# Optionalbusiness =true# or false, Optionalurl =URI.parse('https://stealthgpt.ai/api/stealthify')http =Net::HTTP.new(url.host, url.port)http.use_ssl =truerequest =Net::HTTP::Post.new(url.request_uri)request['api-token'] = api_tokenrequest['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'putsJSON.parse(response.body)elseputs"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'withImages =true# Optionalsize ='medium'# Optionalurl =URI.parse('https://stealthgpt.ai/api/stealthify/articles')http =Net::HTTP.new(url.host, url.port)http.use_ssl =truerequest =Net::HTTP::Post.new(url.request_uri)request['api-token'] = api_tokenrequest['Content-Type'] ='application/json'request.body =JSON.generate({ prompt: prompt, withImages: withImages,# Include only if needed size: size # Include only if needed})response = http.request(request)if response.code =='200'putsJSON.parse(response.body)elseputs"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.