AI Image & Video API for Indie Developers
Call image and video models from your own code or your AI agent. One API key and one credit balance across the REST API, MCP server, CLI and SDKs.
API calls need credits. Packs from $5.
curl -X POST https://api.picxstudio.com/v1/images/generate \
-H "Authorization: Bearer $PICX_API_KEY" \
-H "Content-Type: application/json" \
-d '{"prompt":"a beautiful sunset over the ocean, cinematic lighting","model":"gemini-3.1-flash-image-preview","size":"2K","aspect_ratio":"16:9"}'Example response
{
"id": "img_abc123def456",
"url": "https://cdn.picxstudio.com/generated/abc123.png",
"model": "gemini-3.1-flash-image-preview",
"size": "2K",
"aspect_ratio": "16:9",
"credits_used": 53,
"created_at": "2026-06-17T20:00:00Z"
}import { PicX } from "picx-ai";
const picx = new PicX(process.env.PICX_API_KEY);
const asset = await picx.images.generate({
prompt: "a beautiful sunset over the ocean, cinematic lighting",
model: "gemini-3.1-flash-image-preview",
size: "2K",
aspect_ratio: "16:9",
});
console.log("Image URL:", asset.url);
console.log("Credits used:", asset.credits_used);Example response
{
"id": "img_abc123def456",
"url": "https://cdn.picxstudio.com/generated/abc123.png",
"model": "gemini-3.1-flash-image-preview",
"size": "2K",
"aspect_ratio": "16:9",
"credits_used": 53,
"created_at": "2026-06-17T20:00:00Z"
}import os
from picx import PicX
picx = PicX(os.environ["PICX_API_KEY"])
asset = picx.images.generate(
prompt="a beautiful sunset over the ocean, cinematic lighting",
model="gemini-3.1-flash-image-preview",
size="2K",
aspect_ratio="16:9",
)
print("Image URL:", asset.url)
print("Credits used:", asset.credits_used)Example response
{
"id": "img_abc123def456",
"url": "https://cdn.picxstudio.com/generated/abc123.png",
"model": "gemini-3.1-flash-image-preview",
"size": "2K",
"aspect_ratio": "16:9",
"credits_used": 53,
"created_at": "2026-06-17T20:00:00Z"
}https://mcp.picxstudio.com/
# from the terminal, once the CLI is installed
picx mcp install
picx mcp doctor- Credits never expire
- Failed generations refunded automatically
- Commercial use on every plan
- No auto-renew on crypto
An example result, and what it costs
Every response tells you the credits used, and agents can list each model鈥檚 price before spending anything.
Get API key
Ways to integrate
One key and one balance across all four.
REST API
Generate and edit images and video over HTTPS. Sync by default, webhooks when you want them.
QuickstartMCP server
Let Claude, ChatGPT, Cursor, VS Code or Codex call PicX tools directly, signed in with your account.
Connect a clientCLI
picx-cli for the terminal and for agents that shell out. Every command speaks --json.
Install the CLISDKs
Typed clients for JavaScript/TypeScript (picx-ai on npm) and Python (picx-ai on PyPI).
SDK examples
Run the code
Have credits? Run it in the playground. No credits yet? Read what a call returns first.
With credits
The playground sends a real request with your key and spends real credits. A new key starts with 0 credits, so buy a pack from $5 first.
Run in the playgroundUsing a coding agent? Agent setup gives you one line to paste into Claude Code, Cursor or Codex. Or use the Add to your AI tool button above.
Without credits
This is the shape of a successful response. The id, URL and date are placeholders, and credits_used is the current price for this model at 2K.
POST /v1/images/generate, example response
{
"id": "img_abc123def456",
"url": "https://cdn.picxstudio.com/generated/abc123.png",
"model": "gemini-3.1-flash-image-preview",
"size": "2K",
"aspect_ratio": "16:9",
"credits_used": 53,
"created_at": "2026-06-17T20:00:00Z"
}Documentation
All docsGetting Started
Code Examples
Pick a model
Live from GET /v1/models. Credits are for one generation; video is priced per second.
Built for production
Webhooks
Register an endpoint, or bind one to a single job, and get a POST when it finishes.
Webhooks docsAsync polling and SSE
Video returns a job id at once. Poll GET /v1/generations/{id} or stream its events_url.
Video referenceidempotency_key
Retry a request safely. A replay returns the original generation and charges nothing.
QuickstartRefunds on failure
When a generation fails, its credits go back to your balance automatically.
Credit pricing
Rate limits
Limits apply per key. Read your exact values from GET /v1/account/tier, and honor Retry-After on a 429. Rate limit docs
What you can build
What the terms allow, in plain English.
| Use | Status | Details |
|---|---|---|
| Ads, listings and client work made with outputs | Allowed | On every plan |
| Selling prints or merchandise made with outputs | Allowed | Terms section 5 |
| An AI feature inside a different product, through the API | Allowed | Use your own key on your own backend |
| Reselling raw capacity | Allowed | See the partners page |
| A substantially similar generator built on PicX | Allowed | See the partners page |
| Sharing or reselling API keys, or transferring credits | Not allowed | Terms sections 3 and 4.1 |
Full wording in the Terms of Service.
Start at the price of a coffee
Credit packs from $5 with no plan needed, or plans from $11.99/month. Crypto accepted.
$5
500 credits
$9
1,000 credits
$29
3,200 credits
$59
6,500 credits
The API and MCP spend the same credits as the app. See all prices 路 How paying with crypto works
Developer FAQ
Do I need a subscription?
No. Credit packs start at $5 and need no plan. Credits never expire. Plans start at $11.99/month if you would rather have a monthly refill.
What happens to credits when a generation fails?
Credits are taken when you submit, and they go back to your balance automatically if the generation fails. The failed generation's error_message tells you why.
Can I use this inside my own app?
Yes. An AI feature inside a different product, through the API, is allowed. Use your own key on your own backend. Sharing or reselling API keys, or transferring credits, is not allowed.
Which models can I call, and how do I pick?
GET /v1/models lists every model id with its credit price, and it needs no key. Pass the id as model. Pick by the price at your size and by the output you want. The playground is a quick way to compare them once you have credits.
Can my agent see prices before spending?
Yes. GET /v1/models returns each model's credit price without a key, and the MCP server has the same list as the picx_list_models tool. An agent can read the price and your balance before it spends anything.
How do I pay without a card?
Choose crypto at checkout. 18 coins are accepted, including BTC, USDT, ETH and SOL, and a crypto payment never renews by itself.
Can I try the API without paying?
You can read every model and price without a key, using GET /v1/models. Generating needs credits: a new key has 0, and packs start at $5.
Is the API synchronous?
Images are by default: the request returns when the image exists. Add callback_url and it returns a job id instead. Video is always asynchronous, so you poll, stream events or take a webhook.

Build with PicX
One API key and one credit balance across the REST API, MCP server, CLI and SDKs.