Text Generative AI

Text focused APIs utilizing generative large language models (LLMs)

Moderates the content to ensure that the content text complies with our usage policies.

Validates the content text to ensure that it is not one of the following: sexual, hate, violence, self-harm, sexual/minors, hate/threatening, violence/graphic

Securityapi_key
Request
query Parameters
text
required
string

The text content with UTF-8 text representation

Responses
200

200 response

get/text/moderate
Request samples
Response samples
application/json
{
  • "status": {
    },
  • "result": {
    }
}

Moderates the content to ensure that the content text complies with our usage policies.

Validates the content text to ensure that it is not one of the following: sexual, hate, violence, self-harm, sexual/minors, hate/threatening, violence/graphic

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

Responses
200

200 response

post/text/moderate
Request samples
application/json
{
  • "text": "string"
}
Response samples
application/json
{
  • "status": {
    },
  • "result": {
    }
}

A text translation service.

A text translation service supporting multiple translation engine.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

target
required
string [ 2 .. 5 ] characters

Two letter language code for the target language to translate the source text into.

source
string [ 2 .. 5 ] characters

Two letter language code for the source language. If left blank, the model will try to infer the language.

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

engine
string

The generative model to use.

Enum: "genai" "deepl"
object

Configuration for the genai model.

object

Configuration for the DeepL model.

Responses
200

200 response

post/text/translate
Request samples
application/json
{
  • "text": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus.",
  • "target": "fr"
}
Response samples
application/json
{ }

PII-NER

Personally Identifiable Information (PII) Entity Recognition (ER) is an NLP task used to identify important named entities in the text such as people, places, organizations, date, or any other category.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/nlp/pii/llm
Request samples
application/json
{
  • "text": "Hello Zhang Wei, your social insurance number 888-456-2345 will be sent to you at 4 Bond Street, Toronto ON M5J 3A2. tomorrow by noon. Could you confirm that you were indeed 18 years old."
}
Response samples
application/json
{ }

NER parse

Named Entity Recognition using LLM models.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/nlp/ner/llm
Request samples
application/json
{
  • "text": "Mark Zuckerberg is one of the founders of Facebook, a company from the United States"
}
Response samples
application/json
{ }

Sentiment classification

Multilingual sentiment classification using LLM models..

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/enrichment/sentiment/llm
Request samples
application/json
{
  • "text": "We're so happy to see you, and we will be delighted to extend a warm welcome."
}
Response samples
application/json
{ }

A classifier that measures the accuracy of the translated text.

Given a text pair [text1, text2], the classifier outputs 't' if the translation is faithful and accurate, 'f' otherwise.

Securityapi_key
Request
Request Body schema: application/json
required
text1
required
string non-empty

The text content with UTF-8 text representation

text2
required
string non-empty

The text content with UTF-8 text representation

lang1
string [ 2 .. 5 ] characters

The language code for the text1.

lang2
string [ 2 .. 5 ] characters

The language code for the text2.

string or string
Default: "general"

The content domain to be used for additional context.

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

explain
boolean
Default: false

A boolean flag that should be set to true if an explanation for the label is required.

cache
boolean
Default: true

A boolean flag that utilizes a simple caching scheme as an optimization for duplicates in input..

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/translate/accuracy
Request samples
application/json
{
  • "text1": "You owe me 200 dollars, and I am here till today.",
  • "text2": "Vous me devez 200 dollars, et je suis là jusqu'à aujourd'hui.",
  • "explain": true
}
Response samples
application/json
{ }

Plain Language Rewrite (EXPERIMENTAL)

Rewrite the given text to be more easier to read and comprehend.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/enrichment/plainlang/rewrite
Request samples
application/json
{
  • "text": "Quantum mechanics is a basic theory in physics that explains how things work at the tiny scale of atoms and subatomic particles. It is the basis for all quantum physics, like quantum chemistry, quantum field theory, quantum technology, and quantum information science."
}
Response samples
application/json
{ }

Readability Rewrite (EXPERIMENTAL)

Rewrite the given text to be suitable for an 8th Grader.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

target
required
string

The target grade level.

Enum: "5" "6" "7" "8-9" "10-12" "college student" "college graduate"
random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/enrichment/readability/rewrite
Request samples
application/json
{
  • "text": "These methods still require supervised training in order to perform a task. When only minimal or no supervised data is available, another line of work has demonstrated the promise of language models to perform specific tasks, such as common sense reasoning (Schwartz et al., 2017) and sentiment analysis (Radford et al., 2017). In this paper, we connect these two lines of work and continue the trend of more general methods of transfer. We demonstrate language models can perform down-stream tasks in a zero-shot setting – without any parameter or architecture modification. We demonstrate this approach shows potential by highlighting the ability of language models to perform a wide range of tasks in a zero-shot setting. We achieve promising, competitive, and state of the art results depending on the task.",
  • "target": "5"
}
Response samples
application/json
{ }

Text Summary (EXPERIMENTAL)

Perform text summarization.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

limit
integer >= 1

Attempt to restrict the summary to these many words or less.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/summary
Request samples
application/json
{
  • "text": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus."
}
Response samples
application/json
{ }

Multilingual Text Translation (EXPERIMENTAL)

Perform text translation to and from any core languages.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

target
required
string [ 2 .. 5 ] characters

Two letter language code for the target language to translate the source text into.

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/translation
Request samples
application/json
{
  • "text": "Jupiter is the fifth planet from the Sun and the largest in the Solar System. It is a gas giant with a mass one-thousandth that of the Sun, but two-and-a-half times that of all the other planets in the Solar System combined. Jupiter is one of the brightest objects visible to the naked eye in the night sky, and has been known to ancient civilizations since before recorded history. It is named after the Roman god Jupiter.[19] When viewed from Earth, Jupiter can be bright enough for its reflected light to cast visible shadows,[20] and is on average the third-brightest natural object in the night sky after the Moon and Venus.",
  • "target": "fr"
}
Response samples
application/json
{ }

Tone classification

Multilingual tone classification using LLM models..

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/enrichment/tone
Request samples
application/json
{
  • "text": "I am afraid I will have to report you. I wish you had behaved better than this."
}
Response samples
application/json
{ }

Sentiment Rewrite (EXPERIMENTAL)

Rewrite the original text to have a more positive sentiment.

Securityapi_key
Request
Request Body schema: application/json
required
text
required
string non-empty

The text content with UTF-8 text representation

ishtml
boolean
Default: false

A boolean flag that should be set to true if text is in HTML markup.

random
number [ 0 .. 1 ]
Default: 0

Controls the amount of randomness in the generated text. Lowering this will result in the output to be more deterministic.

model
string
Default: "gpt4-o"

The generative model to use.

Enum: "gpt4-o" "gpt4-o-mini" "gpt4" "gpt4-t" "o1" "o1-mini"
Responses
200

200 response

post/text/enrichment/sentiment/rewrite
Request samples
application/json
{
  • "text": "If you guys don't make your monthly quotas this month, I will be forced to report you and file an official letter of complaint."
}
Response samples
application/json
{ }