Skip to main content

Quickstart

This guide will get you from zero to your first PolarGrid API call in under 5 minutes.

1. Get an API Key

1

Sign up

Create an account at app.polargrid.ai
2

Create API key

Go to Settings → API Keys and click Generate New Key
3

Copy your key

Your key starts with pg_. Keep it secure — you won’t see it again.

2. Make Your First Request

curl -X POST https://api.ymq-01.edge.polargrid.ai:55111/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3.1-8b",
    "messages": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

3. Choose Your Region

PolarGrid automatically routes to the fastest region when you use PolarGrid.create(). You can also specify one explicitly:
// Auto-select best region (recommended)
const client = await PolarGrid.create({ apiKey: 'pg_...' });
console.log(`Connected to: ${client.getRegionName()}`); // e.g., "Vancouver"

// Or specify a region explicitly
const client = new PolarGrid({
  apiKey: 'pg_...',
  region: 'vancouver'  // aliases: 'yvr-01', 'yvr'
});

Next Steps