Integrations
Use Phantasia from the AI apps and tools you already work in. Agents connect over MCP; automations and code use the REST API and webhooks.
- MCP server
https://phantasia.pics/api/mcpSign in as a connector, or send a key - REST API
https://phantasia.pics/api/v1OpenAPI file · reference - Webhooks
creation.doneSigned, how to verify - For AI tools
/llms.txtA map of Phantasia for agents
Claude (claude.ai and the desktop app)
Add Phantasia as a connector. You sign in once; no key to copy.
- Open Claude’s settings, find Connectors and choose to add a custom connector.
- Name it Phantasia and paste this address:
https://phantasia.pics/api/mcp
- Choose Connect. A Phantasia page opens: sign in and press Allow.
- Ask Claude: “make a picture of a lighthouse at dawn”.
ChatGPT
Add Phantasia as a custom connector (MCP). Custom connectors may need developer mode, depending on your plan.
- In ChatGPT’s settings, open Connectors (or Apps) and create a new one.
- Use this MCP address and choose OAuth sign-in:
https://phantasia.pics/api/mcp
- Sign in to Phantasia when asked and press Allow.
- Turn the connector on in a chat and ask for a song, a voice or a clip.
Claude Code
Add the server, then sign in from Claude Code’s /mcp menu, or pass a key.
claude mcp add --transport http phantasia https://phantasia.pics/api/mcp
Or with a key from API keys:
claude mcp add --transport http phantasia https://phantasia.pics/api/mcp --header "Authorization: Bearer phk_…"
Cursor
Add this to mcp.json (Cursor settings → MCP). Leave out headers to sign in instead.
{
"mcpServers": {
"phantasia": {
"url": "https://phantasia.pics/api/mcp",
"headers": {
"Authorization": "Bearer phk_…"
}
}
}
}VS Code
Add to .vscode/mcp.json, then start the server from the MCP view.
{
"servers": {
"phantasia": {
"type": "http",
"url": "https://phantasia.pics/api/mcp"
}
}
}n8n
Start a creation with an HTTP Request node, get the result with a Webhook node.
- Add a Webhook trigger to a second workflow and copy its production address.
- In your main workflow add an HTTP Request node: POST to the address below, header
Authorization: Bearer phk_…, JSON body with your webhook:
POST https://phantasia.pics/api/v1/creations
{ "kind": "image", "prompt": "{{ $json.idea }}", "webhook": "https://your-n8n…/webhook/…" }- When it’s done, the Webhook workflow receives
creation.url. Check the signature with your secret (how).
You can also import the whole API: openapi.json.
Make
An HTTP “Make a request” module starts it; a Custom webhook scenario receives it.
- Create a scenario that starts with Webhooks → Custom webhook; copy its address.
- In your scenario add HTTP → Make a request: POST, JSON, header
Authorization: Bearer phk_…:
https://phantasia.pics/api/v1/creations
{ "kind": "music", "prompt": "lo-fi beat for a study playlist", "webhook": "https://hook.make.com/…" }Zapier
Webhooks by Zapier: a POST step starts it, a Catch Hook Zap receives it.
- Make a Zap that starts with Webhooks by Zapier → Catch Hook; copy its address.
- In another Zap add Webhooks by Zapier → Custom Request: POST to
https://phantasia.pics/api/v1/creations, headerAuthorization: Bearer phk_…, data:
{ "kind": "voice", "prompt": "Your order has shipped!", "webhook": "https://hooks.zapier.com/…" }Python
Plain requests; no SDK needed.
import os, time, requests
KEY = {"Authorization": f"Bearer {os.environ['PHANTASIA_KEY']}"}
API = "https://phantasia.pics/api/v1"
def make(kind, prompt, **options):
c = requests.post(f"{API}/creations", headers=KEY, json={"kind": kind, "prompt": prompt, "options": options}).json()
while c.get("status") not in ("done", "failed", "blocked"):
time.sleep(3)
c = requests.get(f"{API}/creations/{c['id']}", headers=KEY).json()
return c
print(make("image", "a paper boat on a puddle, morning light", aspect="landscape")["url"])Node.js
Built-in fetch, Node 18 or newer.
const API = "https://phantasia.pics/api/v1";
const headers = { Authorization: `Bearer ${process.env.PHANTASIA_KEY}`, "Content-Type": "application/json" };
async function make(kind, prompt, options = {}) {
let c = await (await fetch(`${API}/creations`, { method: "POST", headers, body: JSON.stringify({ kind, prompt, options }) })).json();
while (!["done", "failed", "blocked"].includes(c.status)) {
await new Promise((r) => setTimeout(r, 3000));
c = await (await fetch(`${API}/creations/${c.id}`, { headers })).json();
}
return c;
}
console.log((await make("music", "warm bossa nova, nylon guitar", { seconds: 20 })).url);