For Developers
Build on The Grid. Access text, image, video, and audio generation across a distributed GPU network through familiar APIs.
Quick Start
- Get an API key at console.aipowergrid.io
- Call the generation API — it’s OpenAI compatible
from openai import OpenAI
client = OpenAI(
base_url="https://api.aipowergrid.io/v1",
api_key="your-grid-api-key",
)
stream = client.chat.completions.create(
model="gpt-oss-120b",
messages=[{"role": "user", "content": "What is AI Power Grid?"}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="")That’s it. Any tool that works with OpenAI works with The Grid.
API Endpoints
Generation API
Text streams token-by-token; image and video jobs return generated media. Full docs →
| Endpoint | Format | Description |
|---|---|---|
POST /v1/chat/completions | OpenAI | Text gen with streaming |
POST /v1/responses | OpenAI Responses | Text gen (Responses API) |
POST /v1/messages | Anthropic | Text gen with streaming |
POST /v1/images/generations | OpenAI | Image generation |
POST /v1/videos/generations | OpenAI | Video generation (LTX-2.3) |
GET /v1/models | OpenAI | List models currently online |
Authentication: Authorization: Bearer YOUR_KEY or apikey: YOUR_KEY
Legacy API (v2) — Retired
The poll-based /api/v2/ horde endpoints have been retired. Use the
OpenAI-compatible /v1/ endpoints above for all integrations.
API reference: OpenAI-compatible generation API at https://api.aipowergrid.io/v1 — see docs.aipowergrid.io
SDK
See Use AIPG in 60 seconds for copy-paste OpenAI SDK, LiteLLM, Open WebUI, Cline, Continue, LangChain, Vercel AI SDK, and n8n setup, plus the publication status of native provider work.
Use the standard OpenAI SDK
The API is OpenAI-compatible, so you don’t need a custom SDK — point the
official openai package (or any OpenAI client in any language) at the Grid
base URL. Query /v1/models for the
list of models currently online and use one of those names.
Python:
pip install openaifrom openai import OpenAI
client = OpenAI(base_url="https://api.aipowergrid.io/v1", api_key="your-key")JavaScript/TypeScript:
npm install openaiimport OpenAI from 'openai';
const client = new OpenAI({ baseURL: 'https://api.aipowergrid.io/v1', apiKey: 'your-key' });curl:
curl -N https://api.aipowergrid.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-oss-120b","messages":[{"role":"user","content":"Hi"}],"stream":true}'Discord Agents
Current Discord agents powered by The Grid.
| Bot | Purpose | Repo |
|---|---|---|
| News Bot | AI-powered news summaries | grid-discord-news-bot |
| Aigarth | Natural chat, Grid tools, and image generation | grid-discord-agent |
Smart Contracts
All contracts on Base Mainnet (Chain ID: 8453).
Core
| Contract | Address |
|---|---|
| AIPG Token | 0xa1c0deCaFE3E9Bf06A5F29B7015CD373a9854608 |
| StakingVault | 0x3ED14A6D5A48614D77f313389611410d38fd8277 |
| Grid Proxy | 0x79F39f2a0eA476f53994812e6a8f3C8CFe08c609 |
Grid Modules (via Proxy)
| Module | Address |
|---|---|
| ModelVault | 0xf2A3bA5C4b56E85e022c5079B645120CE7B6d199 |
| RecipeVault | 0x58Dc9939FA30C6DE76776eCF24517721D53A9eA0 |
| JobAnchor | 0x1aee3a3e4F2C05814d86cF2426Cf20Ed5c1bfa32 |
| WorkerRegistry | 0x0a3075b1787070210483d3e4845fE58d41c28438 |
| RoleManager | 0x59144e0730638f652B9717379c5CA634da7CE926 |
Network
| Property | Value |
|---|---|
| Chain | Base Mainnet |
| Chain ID | 8453 |
| RPC | https://mainnet.base.org |
| Explorer | basescan.org |
Repositories
| Repo | Purpose |
|---|---|
| grid-core | Grid API server and coordinator |
| grid-text-worker | Text/LLM worker |
| grid-media-worker | Image/video worker (ComfyUI) |
| grid-validator | Evidence-only validator preview |
| aipg-documentation | These docs |
Support
- Discord: discord.gg/W9D8j6HCtC
- GitHub Issues: Open issues on the relevant repo
- Models online: api.aipowergrid.io/v1/models