API Access

AutoComplete's API was built to be straightforward and easy to implement into your software.

Requests to the API require an API key. API keys can be managed from the Account Page.


Billing

You can purchase credits from the Billing Page. Credits will be deducted from your account for every successful API call. Credits cost $0.05 USD per-thousand.

Account credits are valid for up to one year after purchase.

Send an email to [email protected] to request free trial credits.


Making Requests

See the examples below for you preferred environment.

cURL Example
curl https://api.autocomplete.sh/v1/engines/textgen/completion \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "Once upon a time, there was",
      "output_tokens": 16,
      "optimize_readability": true,
      "temperature": 0.7
    }'
Python Example
import json, requests

headers = {"Authorization": "Bearer YOUR_API_KEY"}
payload = {"input": "Once upon a time, there was",
			"output_tokens": 16,
			"optimize_readability": True,
			"temperature": 0.7}

data = json.dumps(payload)
response = requests.request("POST", "https://api.autocomplete.sh/v1/engines/textgen/completion", headers=headers, data=data)

# Do something with the response...
print(response.content.decode("utf-8"))
Golang Example
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

// job represents a submission to the job server
type job struct {
	Input               string  `json:"input"`
	OutputTokens        uint16  `json:"output_tokens"`
	OptimizeReadability bool    `json:"optimize_readability,omitempty"`
	Temperature         float32 `json:"temperature,omitempty"`
}

func main() {
	// Setup payload
	payload := &job{
		Input:               "Once upon a time, there was",
		OutputTokens:        16,
		OptimizeReadability: true,
		Temperature:         0.7,
	}

	// Serialize
	serialized, err := json.Marshal(payload)
	if err != nil {
		log.Fatal(err)
	}

	// Setup request
	req, err := http.NewRequest("POST",
		"https://api.autocomplete.sh/v1/engines/textgen/completion",
		bytes.NewBuffer(serialized))
	if err != nil {
		log.Fatal(err)
	}

	// Add header
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")

	// Do request
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	// Read response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}

	// Do something with the response...
	fmt.Println(string(body))
}
Javascript Example
fetch("https://api.autocomplete.sh/v1/engines/textgen/completion", {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
    Authorization: `Bearer YOUR_API_KEY`,
  },
  body: JSON.stringify({
    input: "Once upon a time, there was",
    output_tokens: 16,
    optimize_readability: true,
    temperature: 0.7
  }),
}).then(response => response.json())
.then(json => console.log(json));
C# Example
using System;
using System.Text;
using System.Net;
using System.IO;

public class Program {
  public static void Main() {
    const string endpoint = "https://api.autocomplete.sh/v1/engines/textgen/completion";
    const string apiKey = "YOUR_API_KEY";
    var payload = @"{
		  ""input"": ""Once upon a time, there was"",
		  ""output_tokens"": 16,
		  ""optimize_readability"": true,
		  ""temperature"": 0.7
		}";
    WebRequest request = WebRequest.Create(endpoint);
    request.Method = "POST";
    request.Headers.Add("Authorization", "Bearer " + apiKey);
    string postData = payload;
    byte[] byteArray = Encoding.UTF8.GetBytes(postData);
    request.ContentLength = byteArray.Length;
    Stream dataStream = request.GetRequestStream();
    dataStream.Write(byteArray, 0, byteArray.Length);
    dataStream.Close();
    using(var resp = request.GetResponse()) {
      var output = new StreamReader(resp.GetResponseStream()).ReadToEnd();
      Console.Write(output);
    }
  }
}

WordPress Plugin

The AutoComplete.sh WordPress Plugin enables AutoComplete.sh functionality in WordPress.


Beta Access

The AutoComplete.sh WordPress plugin beta is available on GitHub.

Account Information

The account information endpoint is available at https://api.autocomplete.sh/v1/account


Sample Request

curl https://api.autocomplete.sh/v1/account \
  -H 'Authorization: Bearer YOUR_API_KEY'
Sample Response
{
  "status": 200,
  "username": "user1234",
  "balance": 100000
}

Text Completion

The text completion endpoint is available at https://api.autocomplete.sh/v1/engines/textgen/completion


POST Parameters
  • input (required, string)
    is the prompt used for text completion.
  • output_tokens (optional, integer between 1 and 2048, default: 16)
    controls the length of the generated text. The length of a token varies, but is generally around 0.75 words.
  • optimize_readability (optional, boolean, default: true)
    runs the output through a natural language processor algorithm that attempts to make the result look more natural by removing sentence fragments.
  • temperature (optional, decimal between 0.1 and 1.00, default: 0.7)
    controls the predictability of the output. Higher values let the model take more risks for a more creative output. Lower values are better for applications with a more well-defined answer.

Sample Request
curl https://api.autocomplete.sh/v1/engines/textgen/completion \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "Once upon a time, there was",
      "output_tokens": 16,
      "optimize_readability": true,
      "temperature": 0.7
    }'
Sample Response

The server may take some time to send a response, depending on the complexity of the job. When your result is ready, the server will respond with a JSON object similar to this:

{
  "status": 200,
  "input_tokens": 7,
  "output_tokens": 10,
  "input": "Once upon a time, there was",
  "output": " a man named Edward Scissorhands.",
  "combined": "Once upon a time, there was a man named Edward Scissorhands.",
  "optimize_readability": true,
  "temperature": 0.7,
  "cost": 17,
  "remaining_balance": 99983
}

Pricing

The amount of credits deducted from your account is equal to input_tokens+output_tokens. One token generally represents around 0.75 words. This paragraph is 48 tokens and would cost roughly $0.0024 to generate.


Best Practices

You can tell the model what type of output you're expecting, but you'll generally receive better results by providing concrete examples rather than just describing what you want.

When providing input, consider doing the following:

Provide examples - this steers the model to generate the type of response and format that you're expecting.

Provide quality data - if your input has a lot of grammatical/spelling/format errors the model may output a similarly poorly-written response. For some use-cases like a chat bot this might be ok.

Test different job options - for creative writing, a higher temperature value may be preferred. For use-cases like sentiment analysis where there may only be one correct response, a very low temperature value is generally better.

Some examples of good and bad input prompts:


Bad:
Analyze the sentiment for this tweet: I love my dog!

Good:
Tweet: Paris is beautiful! Sentiment: Positive Tweet: Paris is too crowded. Sentiment: Negative Tweet: The fries at MegaBurger are delicious. Sentiment: Positive Tweet: My burger at MegaBurger was dry and gross. Sentiment: Negative Tweet: I love my dog. Sentiment:

Bad:
Write a review for a restaurant called MegaBurger.

Good:
Write a restaurant review based on these notes: Name: MegaBurger Burger great, trendy, service polite, prices good. Review:

Bad:
How do I cook beef brisket?

Good:
How to cook beef brisket: 1.

Blog Article Writing

Programmatic access for blog article writing is unavailable at this time.

Visit the Dashboard Access Page to use the blog article writing tool through our web interface.


Pricing

The amount of credits deducted from your account is equal to input_tokens+output_tokens. One token generally represents around 0.75 words. This paragraph is 48 tokens and would cost roughly $0.0024 to generate.

Text-to-Image

The text-to-image endpoint is available at https://api.autocomplete.sh/v1/engines/imagegen/texttoimage


POST Parameters
  • input (required, string)
    is a description of the image you want to generate.
  • seed (optional, integer between 1 and 65,536)
    is a seed for generating deterministic results. A seed of 0 will generate randomized results.
  • width (optional, integer [384|512|640|768])
    is the width of the image you want to generate.
  • height (optional, integer [384|512|640|768])
    is the height of the image you want to generate.

Notes
  • Maximum image size is 393216 pixels (768x512 or 512x768)
  • Output is a base64 encoded JPEG image.

Sample Request

curl https://api.autocomplete.sh/v1/engines/imagegen/texttoimage \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "A digital illustration of a cat in a hat, 4k, detailed, trending in artstation, fantasy, vivid colors"
    }'
Sample Response
{
  "status": 200,
  "input": "A digital illustration of a cat in a hat, 4k, detailed, trending in artstation, fantasy, vivid colors",
  "output": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDREND...",
  "cost": 200,
  "remaining_balance": 99800
}

Pricing

This endpoint charges 200 credits for every image generated. 200 credits is $0.01 USD.

Sentiment Analysis

The sentiment analysis endpoint is available at https://api.autocomplete.sh/v1/engines/textclassify/sentiment


POST Parameters
  • input (required, string)
    is the content that you want to analyze for sentiment.

Sample Request

curl https://api.autocomplete.sh/v1/engines/textclassify/sentiment \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "#Bitcoin is bouncing back strong!"
    }'
Sample Response
{
  "status": 200,
  "input": "#Bitcoin is bouncing back strong!",
  "negative": 0,
  "neutral": 0.527,
  "positive": 0.473,
  "compound": 0.5561865003587446,
  "sentiment": "positive",
  "cost": 1,
  "remaining_balance": 99999
}

Pricing

This endpoint charges 1 credit for every 100 characters processed, rounded up to the nearest whole credit. This paragraph is 181 characters and would cost roughly $0.00001 to parse.

Profanity Detection

The profanity detection endpoint is available at https://api.autocomplete.sh/v1/engines/textclassify/profanity


POST Parameters
  • input (required, string)
    is the content that you want to analyze for profanity.

Sample Request

curl https://api.autocomplete.sh/v1/engines/textclassify/profanity \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "Fuck this shit!"
    }'
Sample Response
{
  "status": 200,
  "input_tokens": 4,
  "input": "Fuck this shit!",
  "is_profane": true,
  "censored": "F*** this s***!",
  "cost": 4,
  "remaining_balance": 99996
}

Pricing

The amount of credits deducted from your account is equal to input_tokens. One token generally represents around 0.75 words. This paragraph is 43 tokens and would cost roughly $0.00215 to analyze.

Toxicity Detection (Beta)

The toxicity detection endpoint is available at https://api.autocomplete.sh/v1/engines/textclassify/toxicity

This endpoint is experimental. Input & output formats may change.


POST Parameters
  • input (required, string)
    is the content that you want to analyze for toxicity.

Sample Request

curl https://api.autocomplete.sh/v1/engines/textclassify/toxicity \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "Shut up, you are a liar."
    }'
Sample Response
{
  "status": 200,
  "input_tokens": 8,
  "input": "Shut up, you are a liar.",
  "cost": 9,
  "toxic": 0.9857778549194336,
  "severe_toxic": 0.012730825692415237,
  "obscene": 0.32465213537216187,
  "threat": 0.002214352134615183,
  "insult": 0.8319717645645142,
  "identity_hate": 0.0068039181642234325,
  "remaining_balance": 99992
}

Pricing

The amount of credits deducted from your account is equal to input_tokens. One token generally represents around 0.75 words. This paragraph is 43 tokens and would cost roughly $0.00215 to analyze.

Language Parsing

The language parsing endpoint is available at https://api.autocomplete.sh/v1/engines/textprocess/parse


POST Parameters
  • input (required, string)
    is the content that you want to parse.

Sample Request

curl https://api.autocomplete.sh/v1/engines/textprocess/parse \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
      "input": "George Washington (February 22, 1732 – December 14, 1799) was the first president of the United States from 1789 to 1797. Before he became president, he was the commander in chief of the Continental Army during the American Revolutionary War, and one of the Founding Fathers of the United States."
    }'
Sample Response
{
  "status": 200,
  "input": "George Washington (February 22, 1732 – December 14, 1799) was the first president of the United States from 1789 to 1797. Before he became president, he was the commander in chief of the Continental Army during the American Revolutionary War, and one of the Founding Fathers of the United States.",
  "sentences": [
    "George Washington (February 22, 1732 – December 14, 1799) was the first president of the United States from 1789 to 1797.",
    "Before he became president, he was the commander in chief of the Continental Army during the American Revolutionary War, and one of the Founding Fathers of the United States."
  ],
  "entities": [
    {
      "text": "George Washington",
      "label": "PER"
    },
    {
      "text": "United States",
      "label": "GPE"
    },
    {
      "text": "Continental Army",
      "label": "ORG"
    },
    {
      "text": "American Revolutionary War",
      "label": "GPE"
    },
    {
      "text": "United States",
      "label": "GPE"
    }
  ],
  "tokens": [
    {
      "text": "George",
      "tag": "NNP"
    },
    {
      "text": "Washington",
      "tag": "NNP"
    },
    {
      "text": "(",
      "tag": "("
    },
    {
      "text": "February",
      "tag": "NNP"
    },
    {
      "text": "22",
      "tag": "CD"
    },
    {
      "text": ",",
      "tag": ","
    },
    {
      "text": "1732",
      "tag": "CD"
    },
    {
      "text": "–",
      "tag": "NNP"
    },
    {
      "text": "December",
      "tag": "NNP"
    },
    {
      "text": "14",
      "tag": "CD"
    },
    {
      "text": ",",
      "tag": ","
    },
    {
      "text": "1799",
      "tag": "CD"
    },
    {
      "text": ")",
      "tag": ")"
    },
    {
      "text": "was",
      "tag": "VBD"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "first",
      "tag": "JJ"
    },
    {
      "text": "president",
      "tag": "NN"
    },
    {
      "text": "of",
      "tag": "IN"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "United",
      "tag": "NNP"
    },
    {
      "text": "States",
      "tag": "NNPS"
    },
    {
      "text": "from",
      "tag": "IN"
    },
    {
      "text": "1789",
      "tag": "CD"
    },
    {
      "text": "to",
      "tag": "TO"
    },
    {
      "text": "1797",
      "tag": "CD"
    },
    {
      "text": ".",
      "tag": "."
    },
    {
      "text": "Before",
      "tag": "IN"
    },
    {
      "text": "he",
      "tag": "PRP"
    },
    {
      "text": "became",
      "tag": "VBD"
    },
    {
      "text": "president",
      "tag": "NN"
    },
    {
      "text": ",",
      "tag": ","
    },
    {
      "text": "he",
      "tag": "PRP"
    },
    {
      "text": "was",
      "tag": "VBD"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "commander",
      "tag": "NN"
    },
    {
      "text": "in",
      "tag": "IN"
    },
    {
      "text": "chief",
      "tag": "NN"
    },
    {
      "text": "of",
      "tag": "IN"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "Continental",
      "tag": "NNP"
    },
    {
      "text": "Army",
      "tag": "NNP"
    },
    {
      "text": "during",
      "tag": "IN"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "American",
      "tag": "NNP"
    },
    {
      "text": "Revolutionary",
      "tag": "NNP"
    },
    {
      "text": "War",
      "tag": "NNP"
    },
    {
      "text": ",",
      "tag": ","
    },
    {
      "text": "and",
      "tag": "CC"
    },
    {
      "text": "one",
      "tag": "CD"
    },
    {
      "text": "of",
      "tag": "IN"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "Founding",
      "tag": "VBG"
    },
    {
      "text": "Fathers",
      "tag": "NNS"
    },
    {
      "text": "of",
      "tag": "IN"
    },
    {
      "text": "the",
      "tag": "DT"
    },
    {
      "text": "United",
      "tag": "NNP"
    },
    {
      "text": "States",
      "tag": "NNPS"
    },
    {
      "text": ".",
      "tag": "."
    }
  ],
  "cost": 3,
  "remaining_balance": 89620
}

Entities

Entities is a list of persons, organizations & geopolitical entities found in the provided input text.

  • GPE represents a geographical/political entity.
  • PER represents a person.
  • ORG represents an organization.

Tokens

Tokens is a list of POS tags as described below.

  • ( left round bracket
  • ) right round bracket
  • , comma
  • : colon
  • . period
  • '' closing quotation mark
  • `` opening quotation mark
  • # number sign
  • $ currency
  • CC conjunction, coordinating
  • CD cardinal number
  • DT determiner
  • EX existential there
  • FW foreign word
  • IN conjunction, subordinating or preposition
  • JJ adjective
  • JJR adjective, comparative
  • JJS adjective, superlative
  • LS list item marker
  • MD verb, modal auxiliary
  • NN noun, singular or mass
  • NNP noun, proper singular
  • NNPS noun, proper plural
  • NNS noun, plural
  • PDT predeterminer
  • POS possessive ending
  • PRP pronoun, personal
  • PRP$ pronoun, possessive
  • RB adverb
  • RBR adverb, comparative
  • RBS adverb, superlative
  • RP adverb, particle
  • SYM symbol
  • TO infinitival to
  • UH interjection
  • VB verb, base form
  • VBD verb, past tense
  • VBG verb, gerund or present participle
  • VBN verb, past participle
  • VBP verb, non-3rd person singular present
  • VBZ verb, 3rd person singular present
  • WDT wh-determiner
  • WP wh-pronoun, personal
  • WP$ wh-pronoun, possessive
  • WRB wh-adverb

Pricing

This endpoint charges 1 credit for every 100 characters processed, rounded up to the nearest whole credit. This paragraph is 181 characters and would cost roughly $0.00001 to parse.

FAQ

Email [email protected] to reach out to our team.


What is AutoComplete.sh?

AutoComplete.sh is a fully managed AI content generation tooling service. Our tools allow you to generate content and work with trained machine learning NLP text generation models. We offer both programmatic REST API access and no-code, web-based tooling.

How do I use AutoComplete.sh?

You can use our web-based tooling in the dashboard for quick access. For technical users, we offer a programmatic REST API for integrating AutoComplete.sh's AI tooling into your application or automation workflow.

Why should I use AI content generation vs. hiring writers?

AI content generation tooling is a great asset for rapid iteration and coming up with new content ideas quickly and cheaply. Using AI tooling for content generation saves time and money, and can greatly increase your writing productivity. You can choose use AutoComplete.sh for fully automated content generation, or integrate it into a broader content writing strategy that still employs human editors.

Do I need technical skills to get started?

No technical skills are required. We have web-based tooling for no-code access.

How much does AutoComplete.sh cost?

We charge $0.05 USD for 1000 credits. Usage pricing varies depending on the model being used. Refer to our documentation for cost breakdowns for your use-cases.

Do account credits expire?

Account credits are valid for up to one year after purchase.

What payment methods are available?

You can pay with credit card, debit card, or cryptocurrency.

What's the minimum purchase amount?

You can deposit as little as $5.00 USD for credit card payments, or $0.01 USD for cryptocurrency payments.

Can I request a refund?

Refunds are available on unused credits within 24h of purchase. Please request a free trial if you need to test the service.

How do I get started?

Sign up for an account to get started.

Can I try AutoComplete.sh before I make a purchase?

Check out the demo examples on our home page or send us an email to request trial credits.


Note: This FAQ was generated with help from our Text Completion tooling!