API Overview
PolarGrid provides an OpenAI-compatible REST API, making it easy to migrate existing applications or use familiar patterns.Base URL
yto-01— Torontoyvr-02— Vancouveryul-01— Montreal
Authentication
Edge endpoints require a JWT. See Authentication for how to obtain one.
/v1/* requests require a JWT token obtained by exchanging your API key via POST https://app.polargrid.ai/api/auth/inference-token. The SDKs handle this automatically.
For raw HTTP access:
Endpoints
Text Inference
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/chat/completions | Chat completions (recommended) |
| POST | /v1/completions | Text completions |
Audio
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/audio/speech | Text-to-speech |
| POST | /v1/audio/transcriptions | Speech-to-text |
Models
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/models | List available models |
| POST | /v1/models/load | Load a model into GPU memory |
| POST | /v1/models/unload | Unload a model |
| POST | /v1/models/unload-all | Unload all models |
| GET | /v1/models/status | Get model loading status |
GPU
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/gpu/status | Detailed GPU status (may not be available on all regions) |
| GET | /v1/gpu/memory | GPU memory usage |
| POST | /v1/gpu/purge | Clear GPU memory |
Health
| Method | Endpoint | Description |
|---|---|---|
| GET | /health | Service health check |
Request Format
All POST requests accept JSON:Response Format
Responses are JSON with this structure:Errors
Errors return appropriate HTTP status codes with a detail string (FastAPI format):| Status | Description |
|---|---|
| 400 | Bad request (validation error) |
| 401 | Unauthorized (invalid API key) |
| 404 | Not found |
| 429 | Rate limit exceeded |
| 500 | Server error |
Streaming
For streaming responses, setstream: true:
OpenAI Compatibility
PolarGrid’s REST API follows OpenAI’s endpoint structure and request/response formats, so tools that speak the OpenAI wire protocol (e.g.,curl, LangChain, LiteLLM) can target PolarGrid with a base URL change.
The PolarGrid Python and JavaScript SDKs use their own method signatures (e.g., client.chat_completion({...}) instead of client.chat.completions.create(...)) and are not drop-in replacements for the OpenAI SDK. See the SDK docs for details.