Quickstart
From zero to compressed API response in about two minutes. We'll create an account, generate an API key, and make your first call from Python, TypeScript, or cURL.
1. Create a mintoken account
Head to mintoken.in/signup and sign up with an email and password. No credit card, no email verification — you land on the dashboard immediately with the free plan active (100,000 tokens per month).
2. Create an API key
From the dashboard, navigate to API Keys and click New key. Give it a name and pick a compression intensity:
- lite — ~40% savings. Conservative; keeps articles and natural-sounding prose. Good default for customer-facing output.
- full — ~65% savings. Drops filler words, fragment-style. Good for technical / internal workloads. This is the default.
- ultra — ~75% savings. Maximally abbreviated, uses arrows and symbols for causality. Best for logs, pipelines, agent-to-agent messages.
What a mintoken key looks like
All keys start with mt_live_ followed by 64 hexadecimal characters. Example: mt_live_9c59e9081b12db9c5c79…. Treat it like a password — do not commit it to source, do not paste it in Slack, do not put it in client-side code.
3. Make your first call
The mintoken API is a drop-in replacement for the OpenAI API — you use the OpenAI SDK exactly as you always would, but with two tweaks:
- Change
base_urltohttps://api.mintoken.in/v1 - Set
api_keyto yourmt_live_…key - Add a new
X-Provider-Keyheader carrying your OpenAI key
from openai import OpenAI
client = OpenAI(
base_url="https://api.mintoken.in/v1",
api_key="mt_live_xxxxx", # your mintoken key
default_headers={
"X-Provider-Key": "sk-proj-...", # your own OpenAI key
},
)
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Explain connection pooling"}],
)
print(response.choices[0].message.content)
print(f"Tokens: {response.usage.completion_tokens}")
Run it. You'll see a compressed response — probably ~30-50 tokens for a three-sentence answer that would normally cost 80-150 tokens. In the response headers, look for X-Mintoken-Intensity: full to confirm mintoken ran on the request.
mt_live_ key identifies you on mintoken — we use it to track your usage, enforce quotas, and scope your analytics. The X-Provider-Key is your OpenAI / Anthropic / Google key — mintoken uses it to make the upstream call on your behalf. We never store it.4. Store keys in environment variables
Don't hard-code either key into your source files. Put them in .env (and make sure .env is in your .gitignore):
MINTOKEN_API_KEY=mt_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OPENAI_API_KEY=sk-proj-...
Then load them in your app — with python-dotenv, dotenv, or your framework's built-in env handling.
5. Verify the savings
After a few calls, head to /dashboard. You'll see:
- The total dollars saved this month (estimated against a no-mintoken baseline).
- Total tokens compressed and request count.
- A usage bar showing how much of your plan quota you've used.
If you prefer numbers in code, call the analytics endpoint — see the Analytics page.
What's next
- Authentication — the full story on both key types and how headers flow through.
- Streaming — mintoken passes SSE streams through transparently.
- Anthropic proxy / Google Gemini proxy — identical pattern, different endpoints.
- Intensity levels — override per-request or on the API key.