API reference
API reference
Every endpoint, request body, and response shape.
Three endpoints cover the full generation loop.
- POST /api/ai/image/generate — submit an image generation task.
- POST /api/ai/video/generate — submit a video generation task.
- GET /api/ai/tasks/{id} — poll the current status and fetch the result.
Each endpoint page includes model-specific notes, parameter guidance, and an interactive playground. For the exact credit matrix behind those requests, see Pricing.
Base URL
- Production —
https://gptimage2api.org - Local dev —
http://localhost:3000
Conventions
- Request and response bodies are JSON.
- Authentication is
Authorization: Bearer <api-key>. See Authentication. - Task IDs, provider IDs, and user IDs are opaque strings. Don't parse them.
- Errors use a consistent shape:
{ error: string, ...details }. See Errors & refunds.