Skip to main content

Regions

PolarGrid runs GPU infrastructure at edge locations to minimize latency.

Available Regions

IDNameLocation
yto-01TorontoCanada Central
yvr-02VancouverCanada West
yul-01MontrealCanada East

Endpoint URLs

https://api.{region-id}.edge.polargrid.ai
Examples:
  • https://api.yto-01.edge.polargrid.ai
  • https://api.yvr-02.edge.polargrid.ai
  • https://api.yul-01.edge.polargrid.ai

Auto-Routing

The SDKs can automatically select the fastest region:
// Async factory tests all regions and picks fastest
const client = await PolarGrid.create({
  apiKey: "pg_your_api_key",
  debug: true, // See latency results
});

// [PolarGrid] Auto-routing: latency results: yto-01=32ms, yvr-02=45ms, yul-01=82ms
// [PolarGrid] Auto-routing: selected Toronto (yto-01) with 32ms latency

console.log(client.getRegionId()); // 'yto-01'
console.log(client.getRegionName()); // 'Toronto'

Explicit Region Selection

You can specify a region by ID or alias:
// By alias (case-insensitive)
const client = new PolarGrid({
  apiKey: "pg_...",
  region: "toronto", // or 'vancouver', 'montreal'
});

// By ID
const client = new PolarGrid({
  apiKey: "pg_...",
  region: "yto-01", // or 'yvr-02', 'yul-01'
});

Region Aliases

For convenience, these aliases are supported:
AliasRegion ID
toronto, ytoyto-01
vancouver, yvryvr-02
montreal, yulyul-01

Checking Latency

CLI

# List regions with current latency
polargrid regions list

# Detailed ping test
polargrid regions ping --count 5

SDK

Auto-routing logs latency when debug is enabled:
const client = await PolarGrid.create({
  apiKey: "pg_...",
  debug: true,
});
// [PolarGrid] Auto-routing: latency results: yto-01=32ms, yvr-02=45ms, yul-01=82ms

Default Region

If you don’t specify a region and don’t use auto-routing, the SDKs default to Toronto (yto-01). For CLI, you can set a default:
polargrid config set default_region yvr-02

Direct API Access

For raw HTTP requests, use the full endpoint:
curl https://api.yto-01.edge.polargrid.ai/v1/chat/completions \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model": "Meta-Llama-3.1-8B-Instruct", "messages": [...]}'