GETTING STARTEDImage

Quick Start

Generate your first image with a single authenticated API call to the PicX Studio API.

POST/v1/images/generateRun in playground

PicX Studio gives you image generation, image editing, and asynchronous video generation through a single REST API. Every request is authenticated with an API key and billed in credits.

This guide gets you from zero to your first generated image in a couple of minutes.

The API base URL is https://api.picxstudio.com/v1. Every endpoint in these docs is relative to it.

From key to first image

  1. Create an API key

    Open the API dashboard, sign in, and create a new key. Give it a name and pick the scopes you need. Copy the key immediately — the full value (pxsk_…) is shown only once.

  2. Make your first request

    Send a POST request to /v1/images/generate with your prompt, passing the key as a Bearer token in the Authorization header.

  3. Read the response

    A successful call returns JSON with a hosted image url plus the model, size, and credits_used for that request.

Generate your first image

JavaScript SDK

npm install picx-ai
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",
  size: "2K",
  aspectRatio: "16:9",
});

console.log("Image URL:", asset.url);
console.log("Credits used:", asset.creditsUsed);

Python SDK

pip install picx-ai
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",
    size="2K",
    aspect_ratio="16:9",
)

print("Image URL:", asset.url)
print("Credits used:", asset.credits_used)

curl

curl -X POST https://api.picxstudio.com/v1/images/generate \
  -H "Authorization: Bearer pxsk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"a beautiful sunset over the ocean, cinematic lighting","size":"2K","aspect_ratio":"16:9"}'

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"
}

That is it — you generated your first image. Next, set up authentication properly, explore the full image API, and try asynchronous video generation.

GET /v1/models

List all available models. This endpoint is public and requires no authentication — handy for confirming connectivity before you add a key.

Auth: Public

Parameter Type Required Description
type string No Filter by model type: image, video, or audio.