Docs
Connect to Pixly via MCP or API.
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 ID | Channel | Credits / image |
|---|---|---|
| gemini-2.5-flash-image | 5 |
Text to image
POST /v1/images/generations
| Field | Type | Description |
|---|---|---|
| model | string | Model ID (see table above), required |
| prompt | string | Text prompt, required |
| size | string | e.g. 1024x1024, default 1024x1024 |
| n | number | Number 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.pngSDK 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
| Status | Meaning |
|---|---|
| 400 | Bad request (missing model/prompt, etc.) |
| 401 | Missing or invalid API key |
| 402 | Insufficient credits |
| 429 | Rate limited — retry later |
| 500 | Server 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>"
}
}
}
}| Tool | Description |
|---|---|
| text_to_image | Generate from a prompt; optional style preset (any style-library id) + size |
| search_styles | Search ~10k style presets by keyword/tag; returns style ids |
| image_to_image | Transform an image (by URL) per an instruction |
| upscale | Upscale / enhance detail |
| remove_background | Remove the background |