文档

通过 MCP 或 API 接入 Pixly。

Prerequisites

  • Create a Pixly account (100 free credits on sign-up).
  • Grab your API key from the API keys page.

Core configuration

Every endpoint is OpenAI-images compatible and uses Bearer auth.

Base URL:  https://api.genframeai.com
Header:    Authorization: Bearer <YOUR_API_KEY>

Models

Models currently enabled:

Model IDChannelCredits / image
gemini-2.5-flash-imagegoogle5

Text to image

POST /v1/images/generations

FieldTypeDescription
modelstringModel ID (see table above), required
promptstringText prompt, required
sizestringe.g. 1024x1024, default 1024x1024
nnumberNumber of images, default 1
curl https://api.genframeai.com/v1/images/generations \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash-image",
    "prompt": "a serene mountain lake at dawn",
    "size": "1024x1024",
    "n": 1
  }'

Response:

{
  "created": 1718352000,
  "data": [
    { "url": "https://.../image.png" }
  ]
}

Image to image / edit

POST /v1/images/edits (multipart/form-data, image = source image)

curl https://api.genframeai.com/v1/images/edits \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -F model="gemini-2.5-flash-image" \
  -F prompt="replace the background with snowy mountains" \
  -F size="1024x1024" \
  -F image=@./source.png

SDK examples

Because the API is OpenAI-images compatible, any OpenAI SDK works — just point its base URL at Pixly.

Python (openai)

from openai import OpenAI

client = OpenAI(
    api_key="<YOUR_API_KEY>",
    base_url="https://api.genframeai.com/v1",
)

# text to image
res = client.images.generate(
    model="gemini-2.5-flash-image",
    prompt="a serene mountain lake at dawn",
    size="1024x1024",
)
print(res.data[0].url)

# image to image / edit
edit = client.images.edit(
    model="gemini-2.5-flash-image",
    prompt="replace the background with snowy mountains",
    image=open("source.png", "rb"),
    size="1024x1024",
)
print(edit.data[0].url)

Node.js (openai)

import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({
  apiKey: "<YOUR_API_KEY>",
  baseURL: "https://api.genframeai.com/v1",
});

// text to image
const res = await client.images.generate({
  model: "gemini-2.5-flash-image",
  prompt: "a serene mountain lake at dawn",
  size: "1024x1024",
});
console.log(res.data[0].url);

// image to image / edit
const edit = await client.images.edit({
  model: "gemini-2.5-flash-image",
  prompt: "replace the background with snowy mountains",
  image: fs.createReadStream("source.png"),
  size: "1024x1024",
});
console.log(edit.data[0].url);

Note: the base URL must include /v1. Images come back as data[].url (some models return b64_json).

Credits & billing

  • Calls are billed in credits, deducted from your balance.
  • gemini-2.5-flash-image costs 5 credits/image; the actual deduction is authoritative.
  • Credits are deducted after a successful generation.
  • Insufficient balance returns 402. Top up on the pricing page.

Rate limits

Each API key is rate-limited. On a 429, back off exponentially and retry.

Error handling

StatusMeaning
400Bad request (missing model/prompt, etc.)
401Missing or invalid API key
402Insufficient credits
429Rate limited — retry later
500Server error

Error response shape:

{ "error": { "message": "insufficient credits", "type": "invalid_request_error" } }

MCP integration

Pixly exposes a Streamable HTTP MCP server. Add the config below in Cherry Studio / ChatWise / Claude and generate images in natural language.

{
  "mcpServers": {
    "pixly": {
      "type": "streamableHttp",
      "url": "https://mcp.genframeai.com/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_API_KEY>"
      }
    }
  }
}
ToolDescription
text_to_imageGenerate from a prompt; optional style preset (any style-library id) + size
search_stylesSearch ~10k style presets by keyword/tag; returns style ids
image_to_imageTransform an image (by URL) per an instruction
upscaleUpscale / enhance detail
remove_backgroundRemove the background