API Overview
PolarGrid provides an OpenAI-compatible REST API, making it easy to migrate existing applications or use familiar patterns.Base URL
yvr-01— Vancouverymq-01— Montrealwas-01— Washington
Authentication
All requests require an API key in the Authorization header: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 |
| POST | /v1/audio/translations | Translate audio to English |
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 |
| 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 details:| 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:
