
Developer API
Call Pellux AI from your own apps, scripts or servers. Create a key on the Developer API key page — it is shown only once, so store it safely and never put it in public website code.
Base URL
https://pelluxai.com/api/public/v1
Required headers
AuthorizationBearer clk_live_… (or send x-api-key: clk_live_…)
Content-Typeapplication/json
POST/chat
Send a conversation and get Pellux AI's reply.
Request body
{
"messages": [
{ "role": "system", "content": "You are concise." },
{ "role": "user", "content": "Hello" }
]
}1–60 messages. role is system, user or assistant. content 1–16,000 characters.
Response
{ "reply": "Hi! How can I help?", "model": "pellux-chat-fast" }Example
curl -X POST https://pelluxai.com/api/public/v1/chat \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "messages": [ { "role": "system", "content": "You are concise." }, { "role": "user", "content": "Hello" } ] }'POST/images
Generate an image from a text prompt. It is also saved to your Image Studio gallery.
Request body
{
"prompt": "A neon city at night",
"size": "1024x1024",
"negativePrompt": "blurry"
}prompt 1–4,000 characters. size is optional: "1024x1024", "1536x1024" or "1024x1536".
Response
{ "id": "4c95…", "url": "data:image/png;base64,…", "model": "…" }Example
curl -X POST https://pelluxai.com/api/public/v1/images \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{ "prompt": "A neon city at night", "size": "1024x1024", "negativePrompt": "blurry" }'JavaScript
const res = await fetch("https://pelluxai.com/api/public/v1/chat", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.CLICK_AI_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ messages: [{ role: "user", content: "Hello" }] }),
});
const { reply, error } = await res.json();Errors
Errors return { "error": "message" } with one of these status codes.
400The body is not valid JSON or doesn't match the shape above.
401Missing, invalid or revoked API key.
402AI credits are used up.
413Request body is too large.
429Rate limit reached — wait a moment and retry.
502 / 503The AI service is busy or not set up. Retry later.