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.
Promptr PRICING Pay-as-you-go pricing. No hidden costs. | $ 1 / 1M input tokens |
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% |
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(url, headers=headers, data=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(prompt, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync(url, content); 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>