PicX Studio

AI API for Indie Hackers, Packs From $5

Ship an AI feature on a small budget. Buy a pack from $5, call the API from your backend, and pay only for what you generate.

Get API key

API calls need credits. Packs from $5.

generate.sh
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"
}
  • 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’s price before spending anything.

Get API key
Top-down photo of a jar of chili tomato chutney on a stone slab with tomatoes and chilies
Top-down premium food photography of a glass jar of chili tomato chutney placed on a dark stone slab, surrounded by fresh red tomatoes, sliced tomatoes, red chili peppers, black peppercorns, and a small wooden bowl with chutney and spoon. Warm earthy background, soft directional lighting, rich shadows, high contrast, minimal styling, commercial product shoot, ultra-detailed, 4K.Nano Banana 2 · 53 credits at 2K · prompt by Kashberg

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.

    Quickstart
  • MCP server

    Let Claude, ChatGPT, Cursor, VS Code or Codex call PicX tools directly, signed in with your account.

    Connect a client
  • CLI

    picx-cli for the terminal and for agents that shell out. Every command speaks --json.

    Install the CLI
  • SDKs

    Typed clients for JavaScript/TypeScript (picx-ai on npm) and Python (picx-ai on PyPI).

    SDK examples

A weekend build, then a launch checklist

A cover image generator in Next.js with TypeScript. Paste these files into an app and it runs once your key has credits.

  1. Install the SDK

    One package. It reads the key from the environment.

    terminal
    npm install picx-ai
  2. Add your key

    Buy a pack on the credits page, then create a key on the keys page. A new key has 0 credits until you do.

    .env.local
    # .env, server only. Never send this key to the browser.
    PICX_API_KEY=pxsk_your_key
  3. Check the price before you spend

    The price comes from the live catalog, so a repricing never breaks your math.

    lib/picx.ts
    import { PicX } from "picx-ai";
    
    export const picx = new PicX(process.env.PICX_API_KEY);
    export const MODEL = "gemini-3.1-flash-image-preview";
    export const SIZE = "1K" as const;
    
    // Read the live price, and refuse early if the balance can't cover it.
    export async function canAfford() {
      const [models, account] = await Promise.all([
        picx.models.listAll({ type: "image" }),
        picx.account.me(),
      ]);
      const price = models.find((m) => m.id === MODEL)?.credits[SIZE];
      const balance = account.credits?.balance ?? 0;
      return { price, balance, ok: typeof price === "number" && balance >= price };
    }
  4. Add the backend route

    The key stays on your server. The browser only ever talks to this route.

    app/api/generate/route.ts
    import { randomUUID } from "node:crypto";
    import { PicXInsufficientCreditsError } from "picx-ai";
    import { MODEL, SIZE, canAfford, picx } from "@/lib/picx";
    
    export async function POST(req: Request) {
      const { prompt } = await req.json();
    
      const { ok, price, balance } = await canAfford();
      if (!ok) return Response.json({ error: "out_of_credits", price, balance }, { status: 402 });
    
      try {
        const image = await picx.images.generate(
          { prompt, model: MODEL, size: SIZE, aspect_ratio: "16:9" },
          // With a key, the SDK can safely retry a dropped connection.
          { idempotencyKey: randomUUID() },
        );
        return Response.json({ url: image.url, credits: image.credits_used });
      } catch (err) {
        if (err instanceof PicXInsufficientCreditsError) {
          return Response.json({ error: "out_of_credits" }, { status: 402 });
        }
        throw err;
      }
    }
  5. Add the page

    The smallest UI that works. Style it later.

    app/page.tsx
    "use client";
    
    import { useState } from "react";
    
    export default function Page() {
      const [url, setUrl] = useState<string>();
      const [busy, setBusy] = useState(false);
    
      async function submit(form: FormData) {
        setBusy(true);
        const res = await fetch("/api/generate", {
          method: "POST",
          body: JSON.stringify({ prompt: form.get("prompt") }),
        });
        const data = await res.json();
        setUrl(data.url);
        setBusy(false);
      }
    
      return (
        <form action={submit}>
          <input name="prompt" required placeholder="Describe your cover image" />
          <button disabled={busy}>{busy ? "Working..." : "Generate"}</button>
          {url && <img src={url} alt="Generated cover" />}
        </form>
      );
    }
  6. Add video when you are ready

    Video runs as a job: submit, keep the id, take a webhook or poll. The SDK page has the full example with the webhook route.

Launch checklist

Webhooks

  • Reply 2xx within 10 seconds and do slow work later. Delivery tries 3 times, waiting 1 second and then 2.
  • Deliveries can repeat. Dedupe on the X-PicX-Delivery header.
  • Save the generation id at submit, and keep GET /v1/generations/{id} as your fallback if a delivery never lands.
  • Treat the POST as a hint and read the result from the API with your key, or verify X-PicX-Signature on a webhook registered in the console.

Retries

  • The SDKs retry 429s, 5xx and dropped connections for you, but only on GETs and on POSTs that carry an idempotency key.
  • On a 429, wait for Retry-After.
  • A failed generation has already been refunded. Retry it as a new request with a new key.

Idempotency

  • Create one key per user action and store it before you call the API.
  • A replay of a finished request returns the original result and charges nothing.
  • A sync image replayed while the first call is still running gets a 503. Back off and try again.

Limits and money

  • Read your limits from GET /v1/account/tier: requests per minute and per day, concurrent jobs, and the daily credit cap.
  • Handle 402 with a clear message. The body gives your balance and the credits required.
  • Check the balance on a schedule and top up before it reaches zero.
  • Use a separate key per environment, and grant each only the scopes it needs.

Pick a model

Live from GET /v1/models. Credits are for one generation; video is priced per second.

Modelmodel idCredits
GPT Image 2openai/gpt-image-21K 53 · 2K 53 · 4K 105 per image
GPT Image 2.5 Flareopenai/gpt-image-2.5/flare1K 53 · 2K 53 · 4K 105 per image
GPT Image 2.5 Sunburstopenai/gpt-image-2.5/sunburst1K 53 · 2K 53 · 4K 105 per image
Nano Banana Progemini-3-pro-image-preview1K 53 · 2K 53 · 4K 105 per image
Nano Banana 2gemini-3.1-flash-image-preview0.5K 30 · 1K 35 · 2K 53 · 4K 105 per image
Nano Banana 2 Litegoogle/nano-banana-2-lite1K 20 · 2K 20 · 4K 20 per image
Seedream 4.5fal-ai/bytedance/seedream/v4.51K 19 · 2K 32 · 4K 35 per image
Seedream 5 Litefal-ai/bytedance/seedream/v5/lite1K 16 · 2K 16 · 4K 30 per image
Seedream 5 Profal-ai/bytedance/seedream/v5/pro1K 20 · 2K 40 per image
Ideogram V4ideogram/v4/image-to-image1K 35 · 2K 35 · 4K 35 per image
Recraft V4.1fal-ai/recraft/v4.1/text-to-image1K 18 · 2K 18 · 4K 18 per image
Imagen 4google-deepmind/imagen-41K 12 · 2K 24 · 4K 35 per image
Nano Bananagoogle/nano-banana1K 15 · 2K 15 · 4K 15 per image
Nano Banana 2.1google/nano-banana-2-11K 35 · 2K 53 · 4K 105 per image
Seedream 5.0 Flashbytedance/seedream-5-flash1K 10 · 2K 10 per image
Seedream 4.0bytedance/seedream-4-01K 15 · 2K 15 · 4K 15 per image
Seedream 3.0bytedance/seedream-3-01K 10 per image
GPT Image 2.6 Flareopenai/gpt-image-2-6-flare1K 120 · 2K 285 · 4K 1035 per image
GPT Image 2.6 Economyopenai/gpt-image-2-6-flare/economy1K 20 per image
GPT Image 2.6 Sunburstopenai/gpt-image-2-6-sunburst1K 120 · 2K 285 · 4K 1035 per image
GPT Image 1.5openai/gpt-image-1-51K 16 · 2K 88 per image
4o Imageopenai/4o-image1K 24 per image
Wan 2.7 Imagealibaba-tongyi-wan/wan-2-7-image1K 14 · 2K 14 · 4K 34 per image
Grok Imagine Imagexai/grok-imagine-image1K 16 per image
Grok Imagine Image 2.0xai/grok-imagine-image-21K 16 per image
Qwen Imagealibaba-qwen/qwen-image1K 16 per image
Qwen Image Editalibaba-qwen/qwen-image-edit1K 24 per image
Qwen Image 2.0alibaba-qwen/qwen-image-21K 24 per image
Qwen Image 2.1alibaba-qwen/qwen-image-2-11K 16 · 2K 32 per image
Qwen Image 3alibaba-qwen/qwen-image-31K 26 · 2K 26 per image
Qwen Image 3 Proalibaba-qwen/qwen-image-3/pro1K 32 · 2K 54 per image
Z-Image Turboalibaba-tongyi-mai/z-image-turbo1K 5 per image
Topaz Image Upscalertopaz-labs/topaz-image-upscaler1K 56 · 2K 56 · 4K 56 per image
Ideogram V3ideogram/v31K 20 · 2K 20 · 4K 20 per image
FLUX.2 Problack-forest-labs/flux-21K 20 · 2K 28 per image
FLUX.2 Flexblack-forest-labs/flux-2/flex1K 56 · 2K 96 per image
FLUX.3 Kleinblack-forest-labs/flux-3-klein1K 7 · 2K 10 · 4K 26 per image
FLUX.1 Kontext Problack-forest-labs/flux-kontext1K 20 per image
FLUX.1 Kontext Maxblack-forest-labs/flux-kontext/max1K 40 per image
Ideogram Characterideogram/ideogram-character1K 72 per image
Recraft Remove Backgroundrecraft/recraft-remove-background1K 5 per image
Seedance 2.0fal-ai/bytedance/seedance/v2480p 53 · 720p 115 · 1080p 285 · 4k 580 per second, with sound
Seedance 2.0 Fastfal-ai/bytedance/seedance/v2/fast480p 33 · 720p 69 per second, with sound
Seedance 2.0 Minifal-ai/bytedance/seedance/v2/mini480p 25 · 720p 50 per second, with sound
Seedance 2.5bytedance/seedance-2.5480p 78 · 720p 175 · 1080p 440 per second, with sound
Wan 3.0alibaba/wan-3.0480p 23 · 720p 45 · 1080p 89 per second, with sound
Wan 3.0 Primealibaba/wan-3.0-prime480p 34 · 720p 70 · 1080p 140 per second, with sound
Kling 3.0 Profal-ai/kling-video/v3/pro1080p 84 per second, with sound
Kling 3.0 Pro Motionfal-ai/kling-video/v3/pro/motion-control1080p 84 per second, with sound
Happy Horse 1.1alibaba/happy-horse720p 63 · 1080p 81 per second, with sound
MiniMax H3minimax/h3480p 30 · 768p 39 · 2K 55 · 4k 75 per second, with sound
MiniMax H3 Maxminimax/h3-max480p 30 · 768p 52 · 1080p 104 per second, with sound
MiniMax H3 Max Turbominimax/h3-max-turbo480p 15 · 768p 26 · 1080p 52 per second, with sound
MiniMax H3 Max Directorminimax/h3-max/director480p 52 · 768p 52 · 1080p 104 per second, with sound
FLUX.3blackforestlabs/flux-3720p 65 · 1080p 98 per second, with sound
FLUX.3 Extendblackforestlabs/flux-3/extend-video720p 157 · 1080p 179 per second, with sound
Kling 3.0 Standardfal-ai/kling-video/v3/standard720p 64 per second, with sound
Kling 3.0 Standard Motionfal-ai/kling-video/v3/standard/motion-control720p 64 per second, with sound
Grok Imaginexai/grok-imagine-video480p 32 · 720p 53 per second, with sound
Gemini Omni Flash 1.1google/gemini-omni-flash/v1.1/image-to-video720p 50 · 1080p 74 · 4k 147 per second, with sound
VEED Lip Syncveed/lipsync720p 8 per second, with sound
Veo 3.1 Fastgoogle-deepmind/veo-3-1720p 42 · 1080p 46 · 4k 125 per second, with sound
Seedance 1.0 Probytedance/seedance-1-0480p 8 · 720p 17 · 1080p 39 per second, with sound
Kling 4.0kuaishou-kling-ai/kling-4-0720p 80 · 1080p 120 per second, with sound
Kling 3.0 Turbokuaishou-kling-ai/kling-3-0-turbo720p 57 · 1080p 70 per second, with sound
Kling 3.0 Omnikuaishou-kling-ai/kling-3-0-omni720p 57 · 1080p 70 · 4k 210 per second, with sound
Kling 2.6kuaishou-kling-ai/kling-2-61080p 70 per second, with sound
Kling 2.5 Turbokuaishou-kling-ai/kling-2-5-turbo1080p 35 per second, with sound
Kling 2.1kuaishou-kling-ai/kling-2-1720p 30 · 1080p 49 per second, with sound
Wan 2.7alibaba-tongyi-wan/wan-2-7720p 45 · 1080p 67 per second, with sound
Wan 2.6alibaba-tongyi-wan/wan-2-6720p 39 · 1080p 59 per second, with sound
Wan 2.5alibaba-tongyi-wan/wan-2-5720p 34 · 1080p 56 per second, with sound
Wan 2.2 Turboalibaba-tongyi-wan/wan-2-2-turbo480p 6 · 720p 50 per second, with sound
Wan 2.2 Animatealibaba-tongyi-wan/wan-animate720p 35 per second, with sound
Grok Imagine 1.5xai/grok-imagine-1-5480p 32 · 720p 53 · 1080p 94 per second, with sound
Hailuo 2.3 Prominimax-hailuo-ai/hailuo-2-3768p 25 · 1080p 38 per second, with sound
Hailuo 2.3 Standardminimax-hailuo-ai/hailuo-2-3/standard768p 14 · 1080p 24 per second, with sound
Hailuo 02 Standardminimax-hailuo-ai/hailuo-02768p 14 · 512p 6 per second, with sound
Hailuo 02 Prominimax-hailuo-ai/hailuo-02/pro1080p 27 per second, with sound
PixVerse V6pixverse/pixverse-v6720p 27 · 360p 16 · 540p 20 · 1080p 52 per second, with sound
PixVerse V6 Maxpixverse/pixverse-v6/max720p 34 · 360p 20 · 540p 25 · 1080p 63 per second, with sound
Vidu Q4shengshu-vidu/vidu-q4720p 43 · 540p 20 · 1080p 54 · 2k 85 · 4k 175 per second, with sound
Topaz Video Upscalertopaz-labs/topaz-video-upscaler1080p 23 · 720p 23 · 4k 39 per second, with sound
Runwayrunway/runway720p 9 · 1080p 17 per second, with sound
AI Lip Syncvolcengine/lip-sync720p 23 per second, with sound
Seed Audio 1.0bytedance/seed-audio-1.0See docs
ElevenLabs TTS V3fal-ai/elevenlabs/tts/eleven-v3See docs
MiniMax Music 2.6fal-ai/minimax-music/v2.6See docs
ElevenLabs Musicfal-ai/elevenlabs/musicSee docs
Lyria2fal-ai/lyria2See docs
Sound Effects V2fal-ai/elevenlabs/sound-effects/v2See docs
Pulse STTsmallest/pulseSee docs
Talk to Agentsmallest/voice-agentSee docs
Gemini TTSgoogle/gemini-ttsSee docs
Suno V6suno/v6See docs
Suno Soundssuno/soundsSee docs

Built for production

  • Webhooks

    Register an endpoint, or bind one to a single job, and get a POST when it finishes.

    Webhooks docs
  • Async polling and SSE

    Video returns a job id at once. Poll GET /v1/generations/{id} or stream its events_url.

    Video reference
  • idempotency_key

    Retry a request safely. A replay returns the original generation and charges nothing.

    Quickstart
  • Refunds 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.

UseStatus
Ads, listings and client work made with outputsAllowed
Selling prints or merchandise made with outputsAllowed
An AI feature inside a different product, through the APIAllowed
Reselling raw capacityAllowed
A substantially similar generator built on PicXAllowed
Sharing or reselling API keys, or transferring creditsNot allowed

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 only: no card, no KYC.

  • $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. Packs start at $5 with no plan, and credits never expire, so a side project can sit idle for months without losing anything.

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 your product, through the API, is allowed. Call PicX from your backend with your own key. 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?

Pay with crypto: it is the only checkout. 18 coins are accepted, including BTC, USDT, ETH and SOL. There is no KYC and nothing renews by itself.

How do I stop a bug from draining my balance?

Packs are prepaid, so spend stops at zero and the API answers 402. Inside that, check the price and balance before each call, cap requests per user in your own app, and read the daily credit cap from GET /v1/account/tier.

Can this run on serverless?

Yes. For images on a short timeout, pass callback_url so the call returns a job id at once. Video always works that way.

Is there a startup plan?

Startups and solo builders use the same packs, plans and API. Start with a pack, and move to a plan if a monthly refill suits you better.

System status · Security policy

Ship it this weekend

Get a key, buy a pack from $5, and make your first call.

Get API key