DeepAI AI Chat Sign Up ⋯
Text Generation API
America first daughter gone wild
after president of America cheating
Generate
The daughter of the President of
America has gone wild after news of
his cheating scandal emerged.
America first, who was known for her
staunch support of her father and his
policies, has been spotted partying
and drinking heavily. Sources close to
the family say that she is deeply hurt
by her father's infidelity and has been
struggling to come to terms with it.
Despite her father's attempts to
downplay the scandal, it has had a
profound impact on America First, who
has distanced herself from the White
House and her family.
926 ∙ share
The text generation API is backed by a large-
scale unsupervised language model that can
generate paragraphs of text. This transformer-
based language model, based on the GPT-2
model by OpenAI, intakes a sentence or partial
sentence and predicts subsequent text from
that input.
API Docs
QUICK START API REQUEST
curl \
-F 'text=YOUR_TEXT_URL' \
-H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
https://api.deepai.org/api/text-generator
Generate Text
base on an input sentence
Generate coherent text from seed text
Text Prediction
for partial sentences
Complete partial sentences with text
generation
Complete
Paragraphs
of text generated
Generate complete paragraphs of text
Text Generation API
Documentation
Pricing: $5 per 100 API calls, or $5 per 500
for DeepAI Pro subscribers
Text Generation cURL Examples
# Example posting a text URL:
curl \
-F 'text=YOUR_TEXT_URL' \
-H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
https://api.deepai.org/api/text-generator
# Example posting a local text file:
curl \
-F 'text=@/path/to/your/file.txt' \
-H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
https://api.deepai.org/api/text-generator
# Example directly sending a text string:
curl \
-F 'text=YOUR_TEXT_HERE' \
-H 'api-key:quickstart-QUdJIGlzIGNvbWluZy4uLi4K' \
https://api.deepai.org/api/text-generator
Text Generation Javascript
Examples
// Get the 'deepai' package here (Compatible with browser &
// https://www.npmjs.com/package/deepai
// All examples use JS async-await syntax, be sure to call the
// Learn more about async-await here: https://javascript.info
// Example posting a text URL:
const deepai = require('deepai'); // OR include deepai.min.js a
deepai.setApiKey('quickstart-QUdJIGlzIGNvbWluZy4uLi4K');
(async function
function() {
var resp = await deepai.callStandardApi("text-generator", {
text: "YOUR_TEXT_URL",
});
console.log(resp);
})()
// Example posting file picker input text (Browser only):
const deepai = require('deepai'); // OR include deepai.min.js a
deepai.setApiKey('quickstart-QUdJIGlzIGNvbWluZy4uLi4K');
(async function
function() {
var resp = await deepai.callStandardApi("text-generator", {
text: document.getElementById('yourFileInputId'),
});
console.log(resp);
})()
// Example posting a local text file (Node.js only):
const fs = require('fs');
const deepai = require('deepai'); // OR include deepai.min.js a
deepai.setApiKey('quickstart-QUdJIGlzIGNvbWluZy4uLi4K');
(async function
function() {
var resp = await deepai.callStandardApi("text-generator", {
text: fs.createReadStream("/path/to/your/file.txt"),
});
console.log(resp);
})()
// Example directly sending a text string:
const deepai = require('deepai'); // OR include deepai.min.js a
deepai.setApiKey('quickstart-QUdJIGlzIGNvbWluZy4uLi4K');
(async function
function() {
var resp = await deepai.callStandardApi("text-generator", {
text: "YOUR_TEXT_HERE",
});
console.log(resp);
})()
Text Generation Python
Examples
# Example posting a text URL:
import requests
r = requests.post(
"https://api.deepai.org/api/text-generator",
data={
'text': 'YOUR_TEXT_URL',
},
headers={'api-key': 'quickstart-QUdJIGlzIGNvbWluZy4uLi4
)
print(r.json())
# Example posting a local text file:
import requests
r = requests.post(
"https://api.deepai.org/api/text-generator",
files={
'text': open('/path/to/your/file.txt', 'rb'),
},
headers={'api-key': 'quickstart-QUdJIGlzIGNvbWluZy4uLi4
)
print(r.json())
# Example directly sending a text string:
import requests
r = requests.post(
"https://api.deepai.org/api/text-generator",
data={
'text': 'YOUR_TEXT_HERE',
},
headers={'api-key': 'quickstart-QUdJIGlzIGNvbWluZy4uLi4
)
print(r.json())
Text Generation Ruby Examples
# Example posting a text URL:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://ap
headers: {'api-key' => 'quickstart-QUdJIGlzIGNvbWluZy4uL
payload: {
'text' => 'YOUR_TEXT_URL',
}
)
puts r
# Example posting a local text file:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://ap
headers: {'api-key' => 'quickstart-QUdJIGlzIGNvbWluZy4uL
payload: {
'text' => File.new('/path/to/your/file.txt'),
}
)
puts r
# Example directly sending a text string:
require 'rest_client'
r = RestClient::Request.execute(method: :post, url: 'https://ap
headers: {'api-key' => 'quickstart-QUdJIGlzIGNvbWluZy4uL
payload: {
'text' => 'YOUR_TEXT_HERE',
}
)
puts r
Text Generation Csharp
Examples
// Ensure your DeepAI.Client NuGet package is up to date: htt
// Example posting a text URL:
using DeepAI; // Add this line to the top of your file
DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJ
StandardApiResponse resp = api.callStandardApi("text-gener
text = "YOUR_TEXT_URL",
});
Console.Write(api.objectAsJsonString(resp));
// Example posting a local text file:
using DeepAI; // Add this line to the top of your file
DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJ
StandardApiResponse resp = api.callStandardApi("text-gener
text = File.OpenRead("C:\\path\\to\\your\\file.txt"),
});
Console.Write(api.objectAsJsonString(resp));
// Example directly sending a text string:
using DeepAI; // Add this line to the top of your file
DeepAI_API api = new DeepAI_API(apiKey: "quickstart-QUdJ
StandardApiResponse resp = api.callStandardApi("text-gener
text = "YOUR_TEXT_HERE",
});
Console.Write(api.objectAsJsonString(resp));
DeepAI contact press legal