Quickstart

This guide walks you through making your first API request.

Prerequisites

  • A Quantized API key (sk-quantized-...) or JWT token from your institution

Your first request

cURL
Python (httpx)
OpenAI SDK
curl -X POST https://api.quantized.us/v1/chat/completions \
  -H "Authorization: Bearer sk-quantized-YOUR-KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4.1-mini",
    "messages": [{"role": "user", "content": "What is the capital of France?"}],
    "max_tokens": 128
  }'
import httpx

response = httpx.post(
    "https://api.quantized.us/v1/chat/completions",
    headers={"Authorization": "Bearer sk-quantized-YOUR-KEY"},
    json={
        "model": "openai/gpt-4.1-mini",
        "messages": [{"role": "user", "content": "What is the capital of France?"}],
        "max_tokens": 128,
    },
)
data = response.json()
print(data["choices"][0]["message"]["content"])
from openai import OpenAI

client = OpenAI(
    api_key="sk-quantized-YOUR-KEY",
    base_url="https://api.quantized.us/v1",
)

response = client.chat.completions.create(
    model="openai/gpt-4.1-mini",
    messages=[{"role": "user", "content": "What is the capital of France?"}],
    max_tokens=128,
)
print(response.choices[0].message.content)

Response

{
  "id": "gen-abc123",
  "object": "chat.completion",
  "model": "openai/gpt-4.1-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The capital of France is Paris."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 14,
    "completion_tokens": 7,
    "total_tokens": 21,
    "credits_used": 150,
    "credits_remaining": 999850
  }
}

Every response includes credits_used and credits_remaining in the usage object so you always know your balance.

Check your balance

curl https://api.quantized.us/v1/license \
  -H "Authorization: Bearer sk-quantized-YOUR-KEY"
{
  "institution_id": "...",
  "license_id": "...",
  "used_micro_credits": 150,
  "available_micro_credits": 999850
}

Search the web

curl -X POST https://api.quantized.us/v1/web-search \
  -H "Authorization: Bearer sk-quantized-YOUR-KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "latest Python release", "num_results": 3}'

Next steps