Meet the Text Generation API and learn how to Integrate with TextCortex

Learn how text generation APIs work with AI writing assistants such as TextCortex, and what benefits you can get from it.
Ivana Vidakovic
November 9, 2022

Did you know that 83% of all internet traffic belongs to API-based services?

Application Programming Interface (API) is a software middleman that allows two applications to communicate with one another.

Each time you use an application like Facebook, send a text, or check the weather on your telephone, you utilize an API.

In today’s world, many things depend on applications, and in order to keep your step with the competition and grow, it is important to develop sometimes with the help of external API architectures.

Today, we will talk about how text generation APIs work with AI writing assistants such as TextCortex, and what benefits you can get from it.

Let’s get started! 

How API Integration Works?

Imagine yourself in a coffee place, trying to order an espresso. 

The API is your waiter that communicates your order with the bartender

Whenever you utilize an application on your cell phone, the application interfaces with the Internet and sends information to a server. 

how-api-integration-works

The server then recovers that information, deciphers it, performs the fundamental activities, and sends it back to your telephone. 

The application then deciphers that information and presents you with the information you need in a meaningful manner —  all of this happens through API.

An API adds another layer of security by keeping data shared on a need-to-know basis for completing specific tasks.

Information from your devices will never be completely presented to the server, and vice versa.

Instead, API uses only necessary packets of data, to complete a requested action — like a takeout order.

An API goes a few steps further and allows you to have full control of the data you want to share — they provide you with flexibility, simplicity of design, and opportunities for innovation.

Integrate the Text Generation API With TextCortex

Implementing the TextCortex API in your workflow gives you the flexibility to run a business in a manner that does not weigh on your day-to-day routine.

Our API is easy to integrate with base functionalities in as little as 3 lines of code. With that, you can integrate a whole world of unique and compelling text content generation in seconds at the click of a button in your interface. Offering a massive time saver for you and your end-users.

Furthermore, you will be able to:

  • Save up to 70% of the writing time
  • Customize text generation AIs to match your user, industry, and niche
  • Add an unbeatable timesaver to your value proposition
  • Bring AI assistance to the comfort of your own interface 

Let’s check how you can do that! 

1. How to get started with the TextCortex API

To start offering and leveraging the generation capabilities using the TextCortex Enterprise Text Generation API, follow these 4 steps:

1. Sign up for the TextCortex Platform

2. Sign in and click on "account settings" on the top right.

3. Go to the API Key section and copy your key.

4. Make a POST request to https://api.textcortex.com/hemingwai/generate_text_v2/

To shorten your development and integration cycle, we have published packages you can install with the following commands:

To access the API, you need an authentication key. You need to send this key whenever you send a request to our servers. After the signup, you can find your token under the API menu.

The authentication key looks like this:

2. Creation of automation templates for the API

There are different kinds of texts that you can generate using TextCortex AI. 

Whether on our frontend products or API, the functionalities are the same.

 Here is a list of categories you can use:

  • AutoComplete: Expands, continues, and completes the instructed sentence.
  • Blog Body: Generates blog articles on selected blog titles and keywords.
  • Ads: Generates ads based on the product that you are selling. This model is instructed with a product and a target segment for generating texts.
  • Instagram Caption: Generates Instagram captions to promote a product from a user's perspective.
  • Email Body: Generates email bodies. This model takes an email subject and a target segment for generating the main body text.
  • Email Subject: Build an email subject using your keywords as core to deliver the right message from the beginning of communication.
  • Paraphrase:  Returns multiple variations of selected sentences while keeping original context intact.

If you want, for example, to generate an email body you should send the Email Body as a category inside the post request JSON.

3. Make a request to the API

Generating text content is as easy as making a POST request in your terminal to the Enterprise Text Generation API to this URL:

In each request, you need to send your authorization token inside the JSON.

An example POST request would look like this:

4. Generating social media captions with the API

Generating multiple Instagram, Facebook, Pinterest or TikTok captions programmatically is pretty simple. 

Just give the name of the product that you want to promote and your audience as input like the following:

Product example: ‘q10 energy face cream’

Audience example: ‘Mid-aged people’

Social media: Instagram

If you are using TextCortex python library, you can generate Instagram captions with 3 lines of code:

Here is how the post request looks like using Axios NodeJS library:

As you can see, there are some parameters that you can use to fine-tune the generated content. 

Here is the list of those parameters and what they do:

  • Prompt: Prompting is a way to instruct the Enterprise API to start writing on a specific subject
  • Parameters: Used for setting the tone of the generated copy text. It can be anything, but please keep it plausible. For the social media captions use case, you should enter a specific type of target audience as a parameter.
  • Category: This defines which type of content needs to be generated.
  • Creativity: Floating number between 0-1. 0 being the lowest creativity and 1 being the highest. Default is 0.7
  • Character_length: The integer that defines the maximum number of characters that it can produce.
  • Source_language: Represents source language code for the written prompt.

For example, 'en' for English and 'de' for German. 

We support 72 languages. If you don't know the language code, you can also use 'auto' for this field. 

Our system will recognize the language of the instructed prompt and follow through with it in returned content.

5. Generating Ad Copy for Facebook, Google, Instagram, etc with the API. 

Using only the product name and a target group as parameters for the prompt will return unique and creative ad copies.

For example:

Product to promote example: 'Pink Geometric Bag'

Audience example:Young women’

If you are using the TextCortex python library, you can generate blog articles with 3 lines of code:

Here is what the post request looks like using the TextCortex JS library:

Here is the list of those parameters and what they do:

  • Prompt: Prompting is a way to instruct the Enterprise API to start writing on a specific subject
  • Parameters: Used for setting the tone of the generated copy text. It can be anything, but please keep it plausible. 

For the social media captions use case, you should enter a specific type of target audience as a parameter.

  • Blog_categories: This defines which type of content needs to be generated.
  • Creativity: Floating number between 0-1. 0 being the lowest creativity and 1 being the highest. Default is 0.7
  • Character_length: The integer that defines the maximum number of characters that it can produce.
  • Source_language: Represents source language code for the written prompt.

For example, 'en' for English and 'de' for German. 

We support 72 languages. If you don't know the language code, you can also use 'auto' for this field. 

Our system will recognize the language of the instructed prompt and follow through with it in its generation.

To Sum Up

Web-based APIs have a long history, dating back to the late 1990s when Salesforce introduced its web-based sales automation tool.

Today, you can see how versatile and the valuable tool is becoming through each development.

The concept is broad and well known in the IT sector that influential companies are making whole new segments of products based on solely APIs.

Development and standardization of API tools are a constant process that improves security, governance, performance, and scale of implementation. 

More and more platforms are getting under the API communication umbrella, and further implementation of AI tools are just some of the grantees that are here to stay.

By making your APIs available to partners or the general public, you can:

  • Create new channels and expand the ones you already have.
  • Extend the reach of your brand
  • Facilitate open innovation or increased efficiency by collaborating and developing externally.

TextCortex has a significant competitive edge over its competitors: our use-case modules are 10x-100x smaller and  therefore require far less energy in production than GPT-3.

As a result, it can produce 3x the amount of text as GPT-3, with varying levels of complexity that generate SEO-optimized, error-free, and human-sounding content.

It is going to be very interesting to see which benefits and innovations future developments of these module-based AI technologies can bring us.

Get Started with the Enterprise API and let TextCortex handle your bulk content generation and save massive amounts of time while expanding your business options.

Your AI partner is ready to (re)write content.

Save time and grow business using TextCortex. Generate marketing and website content in seconds using AI today.

Start writing with AI

Final Phase: Cyber Nicholaus Countdown

Save up to $180 (30%!) on your yearly plans!

GET YOUR DEAL

You already missed the best deal of the year. You don’t want to lose this one till 06th of December

Join the writing
revolution.
Unlimited creations
More features
No professional experiences required
Your writing assistant saving 70% of your time
Jeff Barnette

“This tool is amazing and makes overcoming writers block a breeze. (...) This is certainly an extension worth trying out because it may just save you hours of work and frustration.”

Cyphas Solutions Ltd

“Initially I thought it was like the others tested, Jasper, CopyAI,GaryAi etc. But the way Dominik explained it and testing things one can truly see the approach is much better...”

Christine Lee

“Impressive tool! Love the rewrite feature. Easy to use. Great support from the team. Thank you team TextCortex!”

4.9 out of 5 stars in 150+ Reviews
Weekly newsletter
We send one email per week with helpful information to help you grow your business.
Create posts, reels and stories.
Business tips
Productivity tools