Add LLM access to your SaaS in 15 minutes
This guide walks you through adding LLM access to your SaaS platform. By the end, your users will each have their own API key with independent rate limits and usage tracking.
What you’ll build
Section titled “What you’ll build”- A management key to control your platform’s keys
- Per-user API keys with individual plans
- Your users calling our API with their own keys
- Usage monitoring per user
Prerequisites
Section titled “Prerequisites”- A CheapestInference account (create one)
- An active subscription (Standard or Pro)
Step 1: Get your management key (2 min)
Section titled “Step 1: Get your management key (2 min)”Log into your dashboard and navigate to Keys. Create a Management Key — this authenticates all platform operations.
mgmt_your_management_key_hereKeep this key secure. It can create, delete, and manage all your consumption keys.
Step 2: Create a key for a user (3 min)
Section titled “Step 2: Create a key for a user (3 min)”Use the management API to create a consumption key for one of your users:
curl -X POST https://api.cheapestinference.com/api/keys \ -H "Authorization: Bearer mgmt_your_management_key" \ -H "Content-Type: application/json" \ -d '{ "name": "user-alice", "plan": "pro" }'Response:
{ "key": "sk-alice-a8f3e2...", "name": "user-alice", "plan": "pro", "rpm": 200, "tpm": 100000}Each key gets its own rate limits based on the plan you assign.
Step 3: Your user makes a request (5 min)
Section titled “Step 3: Your user makes a request (5 min)”Your user hits our API with their key. It’s a standard OpenAI-compatible endpoint — just change the base URL:
Python:
from openai import OpenAI
client = OpenAI( api_key="sk-alice-a8f3e2...", base_url="https://api.cheapestinference.com/v1")
response = client.chat.completions.create( model="Qwen/Qwen3-235B-A22B-Instruct-2507", messages=[{"role": "user", "content": "Hello!"}])
print(response.choices[0].message.content)Node.js:
import OpenAI from 'openai';
const client = new OpenAI({ apiKey: 'sk-alice-a8f3e2...', baseURL: 'https://api.cheapestinference.com/v1',});
const response = await client.chat.completions.create({ model: 'Qwen/Qwen3-235B-A22B-Instruct-2507', messages: [{ role: 'user', content: 'Hello!' }],});
console.log(response.choices[0].message.content);Any OpenAI-compatible SDK works. Python, Node.js, Go, Rust, Java — just change base_url.
Step 4: Monitor usage (5 min)
Section titled “Step 4: Monitor usage (5 min)”Check how much each key is consuming:
curl https://api.cheapestinference.com/api/keys/sk-alice-a8f3e2.../usage \ -H "Authorization: Bearer mgmt_your_management_key"You can also see per-key usage in your dashboard.
Step 5: Scale to more users
Section titled “Step 5: Scale to more users”Repeat step 2 for each user. There’s no limit on how many keys you can create.
# Create keys for your whole teamfor user in alice bob charlie dana; do curl -X POST https://api.cheapestinference.com/api/keys \ -H "Authorization: Bearer mgmt_your_management_key" \ -H "Content-Type: application/json" \ -d "{\"name\": \"user-$user\", \"plan\": \"standard\"}"doneEach key has independent:
- Rate limits (RPM, TPM per plan)
- Usage tracking (tokens, requests, cost)
- Budget (shared from your subscription)
What’s next
Section titled “What’s next”- Per-key plans — customize rate limits per key
- Management API — full API reference
- Models — see all available models
- Pricing — plan details and limits
Questions? Contact [email protected].