Quickstart
Get started with Quota in 5 minutes. This guide will walk you through making your first API call with credit tracking.
1. Get your API key
Sign up at usequota.app to get your API key. Your key will look like:
sk-quota-xxxxxxxxxxxxx2. Install the OpenAI SDK
Quota is OpenAI-compatible, so you can use the official OpenAI SDK:
npm install openai3. Make your first request
Create a new file and add the following code:
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.usequota.app/v1",
apiKey: process.env.QUOTA_API_KEY,
});
const response = await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);4. Check your balance
You can check your remaining credits at any time:
curl -H "Authorization: Bearer $QUOTA_API_KEY" \
https://api.usequota.app/v1/balanceResponse:
{
"balance": 9850,
"currency": "credits"
}