promptr

Get the same LLM output while saving up to 40% on LLM costs. Compress your prompts with one simple REST API call. Added in 5 minutes.

Example

Imagine an AI agent is designing a website for a vibrant toy company. The site should be colorful and inviting, reflecting the joy and imagination toys bring into children's lives. It needs to be user-friendly for both kids exploring the latest toys and parents looking for quality playthings. The homepage should showcase a rotating selection of featured toys and promotions, while interactive elements like games or puzzles keep visitors engaged. The AI must incorporate SEO strategies to appear prominently in toy-related search results and include a blog with articles on play, developmental milestones, and new toy releases. The website should also adapt seamlessly to mobile devices, ensuring a convenient shopping experience with a secure checkout process for customers on the move.
AI agent designing website for vibrant toy company. site colorful inviting reflecting joy imagination toys children lives. user - friendly for kids exploring latest toys parents quality playthings. homepage rotating selection toys promotions interactive elements games puzzles visitors engaged. AI incorporate SEO strategies toy - search results include blog articles on play developmental milestones new toy releases. website adapt to mobile devices convenient shopping experience secure checkout process.
Promptr PRICING
Pay-as-you-go pricing. No hidden costs.
$ 1 / 1M input tokens

Savings

When using a prompt only once:


without promptr
with promptr
savings
gpt-4-turbo
$ 10
($ 10 for 1M input tokens)
$ 7
($ 6 for 600k input tokens + $ 1 for promptr)
30%
gpt-4
$ 30
($ 30 for 1M input tokens)
$ 19
($ 18 for 600k input tokens + $ 1 for promptr)
37%

When reusing a prompt 100x times:


without promptr
with promptr
savings
gpt-4-turbo
$ 1,000
(100x $ 10 for 1M input tokens)
$ 601
($ 600 for 100x 600k input tokens + $ 1 for promptr)
40%
gpt-4
$ 3,000
(100x $ 30 for 1M input tokens)
$ 1,801
($ 1,800 for 100x 600k input tokens + $ 1 for promptr)
40%

API

One API call.

curl -X 'POST' \
  'http://promptr.me/compress-prompt' \
  -H 'accept: text/plain' \
  -H 'token: YOUR-API-TOKEN' \
  -H 'Content-Type: application/json' \
  -d '"YOUR PROMPT"'

Replace the API token and prompt.


import requests

url = 'http://promptr.me/compress-prompt'
headers = {
    'accept''text/plain',
    'token''YOUR-API-TOKEN',  # Replace with your actual API token
    'Content-Type''application/json',
}
data = '"YOUR PROMPT"'  # Replace with your actual prompt

response = requests.post(urlheaders=headersdata=data)

print(response.text)

Run "pip install requests" and replace the API token and prompt.


const url = 'http://promptr.me/compress-prompt';
const headers = {
  'accept': 'text/plain',
  'token': 'YOUR-API-TOKEN',  // Replace with your actual API token
  'Content-Type': 'application/json'
};
const data = '"YOUR PROMPT"';  // Replace with your actual prompt

fetch(url, {
  method: 'POST',
  headers: headers,
  body: data})
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.error('Error:'error));

Replace the API token and prompt.


using System.Text;

string url    = "http://promptr.me/compress-prompt";
string token  = "YOUR-API-TOKEN"// Replace with your actual API token
string prompt = "YOUR PROMPT";    // Replace with your actual prompt

using HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(
    new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("text/plain"));
client.DefaultRequestHeaders.Add("token"token);

StringContent       content        = new StringContent(promptEncoding.UTF8"application/json");
HttpResponseMessage response       = await client.PostAsync(urlcontent);
string              responseString = await response.Content.ReadAsStringAsync();

Console.WriteLine(responseString);

Replace the API token and prompt.


Customize your prompt by defining the compression ratio and uncompressed sections. Uncompressed sections are not billed.


<promptr compress="false">This text will not be compressed.</promptr>
<promptr ratio="0.5">This text will be compressed by 50%.</promptr>
This text will be compressed by 40%, using the default ratio of 0.6.
<promptr ratio="0.8">This text will be compressed by 20%.</promptr>