MORGANE · API
Generate images and text from your code… or a simple link
A simple HTTP API: a prompt gives a PNG (50 points, free while your worker is connected) or an answer from the text model (paid per token, in points).
Quick start
- Sign in and create a key on /workers (3 keys max). It starts with
ma_and is shown only once: keep it safe. - Send
POST /imageswith your prompt. The response gives anid(status202). - Poll
GET /images/{id}every 2 to 5 seconds untilcompletedorfailed. - Download the PNG with
GET /images/{id}/file.
Base URL: https://aiworkerinfo.com/api/v1/public
Simple links (no code)
Paste these addresses into a browser, a Discord bot, an iPhone shortcut or a spreadsheet: replace ma_YOUR_KEY with your key and the text after = with your request (spaces become +).
| For | Link | Response |
|---|---|---|
| Ask a question | https://aiworkerinfo.com/api/v1/public/ask?q=Hello+Morgane&key=ma_YOUR_KEY | The answer text. Add &format=json for details (tokens, cost). |
| Create an image | https://aiworkerinfo.com/api/v1/public/image?prompt=a+ginger+cat&key=ma_YOUR_KEY | The PNG, within 2 minutes. Longer: an id to follow with /images/{id}. |
| See my balance | https://aiworkerinfo.com/api/v1/public/me?key=ma_YOUR_KEY | JSON |
Options: max_tokens, temperature, system for /ask; width, height, seed, model, negative for /image. Same prices and rules as the other endpoints.
⚠️ A link with your key gives access to your points: do not publish it. If it leaked, regenerate the key on /workers/api. In code, prefer the Authorization header.
Pricing and free use
Active worker = free API. While one of your workers is connected and ready on /workers, your API images cost no points. As soon as it disconnects, normal pricing applies again.
Without an active worker: 50 points per image, debited at launch and refunded automatically if generation fails.
Earn points: /points quotidien (10 to 30 a day), time in the voice channels your server picked (/economie, up to 20 an hour), /bump, generating on Discord, or lending your PC to the network (40 to 900 per generation).
GET /me tells you live whether you generate for free (workerActive) and the price applied (cost).
Authentication
Send your key in every request header. It is personal: never publish it (Git repository, browser code…). If it leaks, delete it on /workers and create a new one.
Authorization: Bearer ma_…
Endpoints
| Method | URL | Purpose |
|---|---|---|
| GET | /me | Balance, applied price and worker state |
| GET | /models | Available models and default model |
| POST | /images | Start an image (−50 pts, free with an active worker) |
| GET | /images/{id} | Image status |
| GET | /images/{id}/file | Download the PNG |
| GET | /ask?q=… | Simple link: text answer from the model |
| GET | /image?prompt=… | Simple link: waits and returns the PNG |
| POST | /chat | Text model answer (2 pts / 1000 input tokens, 8 pts / 1000 output tokens), live with stream |
| GET | /conversations | Conversations kept by Morgane |
| GET · DELETE | /conversations/{id} | Read or delete a conversation |
GET /me
{"points": 340, "imageCost": 50, "workerActive": true, "cost": 0,
"textPrice": {"input": 2, "output": 8, "per": 1000}, "key": "mon-script"}
GET /models
{"default": "…safetensors", "models": [{"id": "…safetensors", "family": "sdxl"}]}
POST /images → 202
{"id": "4f0c…", "status": "queued", "cost": 0, "free": true, "points": 340,
"statusUrl": "/api/v1/public/images/4f0c…"}
GET /images/{id}
{"id": "4f0c…", "status": "queued" | "running"}
{"id": "4f0c…", "status": "completed", "fileUrl": "/api/v1/public/images/4f0c…/file"}
{"id": "4f0c…", "status": "failed", "refunded": true}
A key only sees images started by its own account through the API.
POST /images parameters
JSON body (Content-Type: application/json, 32 KB max).
| Field | Type | Default | Description |
|---|---|---|---|
prompt | string | required | 3 to 2000 characters, English or French. |
negative | string | — | What to avoid (1000 characters max). |
width, height | integer | 1024 | Multiples of 64 between 512 and 1536. |
seed | integer | random | Integer ≥ 0 to reproduce a result. |
model | string | default model | An id returned by GET /models. |
Text: the language model
POST /chat answers directly (no polling). Price: 2 points per 1000 input tokens and 8 points per 1000 output tokens, rounded up, 1 point minimum per answer. A token is about 3 to 4 characters.
Model: Qwen3.5 9B, running on Morgane’s server (nothing is sent to an external service). About 8,000 input tokens of context.
The maximum price (with max_tokens) is reserved first, then only the tokens really used are billed. If the model fails or you close the connection before the answer, everything is refunded. A worker does not make text free: the model runs on Morgane’s server.
| Field | Type | Default | Description |
|---|---|---|---|
messages | array | required (or prompt) | 1 to 40 messages {"role": "system" | "user" | "assistant", "content": "…"}, the last one from user. 24,000 characters max in total. |
prompt, system | string | — | Shortcut for a single question, with an optional system instruction. |
max_tokens | integer | 512 | Maximum answer length (1 to 2048). |
temperature | number | 0.7 | 0 = precise and stable, 2 = very creative. |
stream | boolean | false | true: the answer arrives live, piece by piece (see below). |
remember | boolean | false | true: Morgane keeps the conversation and returns a conversation_id. |
conversation_id | string | — | Continues a kept conversation: send only the new message. |
POST /chat → 200
{"id": "9b1e…", "model": "morgane-text",
"message": {"role": "assistant", "content": "…"}, "finish": "stop" | "length",
"usage": {"input_tokens": 41, "output_tokens": 180, "total_tokens": 221},
"cost": 2, "points": 338}
curl -X POST https://aiworkerinfo.com/api/v1/public/chat \
-H "Authorization: Bearer $MORGANE_KEY" -H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Explain DNS in two sentences"}],"max_tokens":300}'
One answer in progress at a time per account. Safe-for-work content only, as for images.
Live answer (streaming)
With "stream": true, the answer is sent as Server-Sent Events while it is written. Each data: line holds a JSON object: start (id), then delta events (a piece of text in content), then done (the same content as the normal answer: usage, cost, points) or error. The stream ends with data: [DONE]. If you hang up midway, only the part already received is billed.
curl -N -X POST https://aiworkerinfo.com/api/v1/public/chat \
-H "Authorization: Bearer $MORGANE_KEY" -H "Content-Type: application/json" \
-d '{"prompt":"Write a poem about the sea","stream":true}'
data: {"type":"start","id":"9b1e…","model":"morgane-text","conversation_id":null}
data: {"type":"delta","content":"The sea"}
data: {"type":"delta","content":" whispers…"}
data: {"type":"done","message":{…},"usage":{…},"cost":2,"points":336}
data: [DONE]
Simple link: /ask?q=…&stream=1&key=… sends the plain text as it comes (handy with curl -N).
Conversation memory
Send "remember": true with the first message: the answer contains a conversation_id. Then pass that conversation_id with only the new message, and Morgane adds the history herself. The history is sent to the model at each turn, so it counts as input tokens. Morgane keeps the last 40 messages (24,000 characters), 50 conversations per account, deleted after 30 days of inactivity. A new system message replaces the conversation’s one.
curl -X POST https://aiworkerinfo.com/api/v1/public/chat -H "Authorization: Bearer $MORGANE_KEY" -H "Content-Type: application/json" \
-d '{"prompt":"My name is Sam.","remember":true}'
→ {"conversation_id": "conv_5f2c…", "message": {…}, …}
curl -X POST https://aiworkerinfo.com/api/v1/public/chat -H "Authorization: Bearer $MORGANE_KEY" -H "Content-Type: application/json" \
-d '{"prompt":"What is my name?","conversation_id":"conv_5f2c…"}'
Simple link: /ask?q=…&remember=1&key=… returns the id in the X-Morgane-Conversation header, then /ask?q=…&c=conv_…&key=…. List, read and delete: GET /conversations, GET /conversations/{id}, DELETE /conversations/{id}.
Official libraries
A single file, no dependencies: it handles the key, waiting for the result, retries (429 / 503) and errors.
Python 3.8+
from morgane import Morgane, MorganeError
api = Morgane("ma_...") # or the MORGANE_API_KEY variable
print(api.me()) # points, price, active worker
png = api.generate("a red fox in the snow, watercolor", width=1024, height=768)
open("fox.png", "wb").write(png)
print(api.ask("Give me three name ideas for a ginger cat", max_tokens=200))
From the command line: python morgane.py "a red fox" -o fox.png
Node.js 18+
import {Morgane} from './morgane.mjs';
import fs from 'node:fs';
const api = new Morgane('ma_...');
const png = await api.generate('a red fox in the snow, watercolor', {width: 1024, height: 768});
fs.writeFileSync('fox.png', png);
const r = await api.chat([{role: 'user', content: 'Hello!'}], {maxTokens: 200});
console.log(r.message.content, r.cost);
Methods: me() · models() · submit(prompt, options) · status(id) · file(id) · wait(id) · generate(prompt, options) · chat(messages, options) · ask(prompt, options). Errors are MorganeError with status, code and message.
Examples
curl
curl -X POST https://aiworkerinfo.com/api/v1/public/images \
-H "Authorization: Bearer $MORGANE_KEY" -H "Content-Type: application/json" \
-d '{"prompt":"a ginger cat on a sunny windowsill","width":1024,"height":1024}'
curl -H "Authorization: Bearer $MORGANE_KEY" https://aiworkerinfo.com/api/v1/public/images/ID
curl -H "Authorization: Bearer $MORGANE_KEY" -o image.png https://aiworkerinfo.com/api/v1/public/images/ID/file
Python
import os, time, requests
API = "https://aiworkerinfo.com/api/v1/public"
H = {"Authorization": f"Bearer {os.environ['MORGANE_KEY']}"}
r = requests.post(f"{API}/images", headers=H, json={"prompt": "a lighthouse at dusk"})
r.raise_for_status()
job = r.json()
while True:
s = requests.get(f"{API}/images/{job['id']}", headers=H).json()
if s["status"] not in ("queued", "running"):
break
time.sleep(3)
if s["status"] == "completed":
open("image.png", "wb").write(requests.get(f"{API}/images/{job['id']}/file", headers=H).content)
JavaScript (Node 18+)
const API = "https://aiworkerinfo.com/api/v1/public";
const H = { Authorization: `Bearer ${process.env.MORGANE_KEY}`, "Content-Type": "application/json" };
const job = await (await fetch(`${API}/images`, { method: "POST", headers: H,
body: JSON.stringify({ prompt: "a lighthouse at dusk" }) })).json();
let s;
do { await new Promise(r => setTimeout(r, 3000));
s = await (await fetch(`${API}/images/${job.id}`, { headers: H })).json();
} while (s.status === "queued" || s.status === "running");
if (s.status === "completed") {
const png = Buffer.from(await (await fetch(`${API}/images/${job.id}/file`, { headers: H })).arrayBuffer());
(await import("node:fs")).writeFileSync("image.png", png);
}Errors
Every error has the same shape: {"error": "code", "message": "human-readable text"}.
| HTTP | Code | Meaning |
|---|---|---|
| 400 | invalid_prompt | Prompt empty, too short or too long. |
| 400 | invalid_size · invalid_seed · invalid_model | Parameter out of range. |
| 400 | invalid_messages · too_long · invalid_max_tokens · invalid_temperature | Invalid POST /chat body. |
| 400 | refused_prompt | Refused by the content policy (no adult content). |
| 401 | unauthorized | Key missing, invalid or deleted. |
| 402 | not_enough_points | Not enough points and no active worker. |
| 403 | blocked | Generation access suspended by staff. |
| 404 | not_found | Unknown image or owned by another account. |
| 404 | conversation_not_found | Unknown or expired conversation, or another account’s. |
| 409 | not_ready | Image not finished yet. |
| 410 | gone | File deleted. |
| 429 | rate_limited · too_many_jobs | Too many requests or too many images in progress. |
| 503 · 504 | unavailable | Generation unavailable or too slow; points refunded. Retry later. |
Limits and rules
- 30 requests per minute per key. The
RateLimitandRateLimit-Policyheaders show what is left. - At most 2 images and 1 text answer in progress per account: wait for one to finish before starting another.
- Safe-for-work content only, with the same checks as on Discord.
- Images stay private and appear in “My generations”. See the Terms.