Riferimento API Morfran
URL di base https://api.morfran.com. Ogni richiesta invia la tua chiave nell'header X-API-Key. Crea le chiavi nella tua dashboard. Lo schema completo è su /openapi.json (OpenAPI 3).
Autenticazione con X-API-Key
curl https://api.morfran.com/v1/effects \ -H "X-API-Key: $MORFRAN_KEY"
Crediti ed errori
I crediti vengono scalati solo per le immagini completate. Gli errori tornano come JSON con un codice di stato e un messaggio.
| Stato | Significato | Cosa fare |
|---|---|---|
401 | Chiave API mancante o errata | Controlla l'header X-API-Key |
402 | Crediti insufficienti | Acquista un pacchetto di crediti |
422 | Nessun volto trovato nella foto | Invia una foto con un volto ben visibile |
GET /v1/effects
Elenca gli effetti che puoi applicare: slug, nome, categoria e immagine di copertina. Gratuito.
curl https://api.morfran.com/v1/effects \ -H "X-API-Key: $MORFRAN_KEY"
POST /v1/effects/{slug}
Applica un effetto a una foto e restituisce un link CDN. 11 crediti con "quality": "standard", 29 con "pro".
| Campo | Tipo | Note |
|---|---|---|
slug | path | Da GET /v1/effects, ad esempio 80s-yearbook |
image_url | string | JPG, PNG o WebP pubblico |
quality | string | standard (predefinito) o pro |
curl -X POST https://api.morfran.com/v1/effects/80s-yearbook \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url":"https://…/me.jpg","quality":"standard"}'
{ "status": "done",
"result_url": "https://cdn.morfran.com/…",
"credits_used": 11,
"credits_left": 39 }
POST /v1/face-swap
Inserisce il volto di SourceImageUrl in TargetImageUrl. 5 crediti. La versione di gruppo, /v1/face-swap/group, cambia fino a otto volti (MaxFaces) per 10 crediti. I lavori lunghi restituiscono un task id; leggi il risultato da GET /v1/face-swap/{taskId}.
curl -X POST https://api.morfran.com/v1/face-swap \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"SourceImageUrl":"https://…/face.jpg","TargetImageUrl":"https://…/photo.jpg"}'
POST /v1/transcribe
Trasforma il parlato di un file audio o video in testo con segmenti con timestamp. Invia media_url (oppure media_base64 con media_type). Facoltativi: language come suggerimento (ISO 639-1), translate_to per una traduzione nella stessa chiamata, timestamps (predefinito true).
2 crediti per ogni minuto iniziato, minimo un minuto; una traduzione aggiunge 1 credito al minuto. File fino a 10 minuti e 50 MB. Nessun parlato trovato: 422 e nessun addebito.
curl -X POST https://api.morfran.com/v1/transcribe \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"media_url":"https://…/interview.mp3","translate_to":"en"}'
{ "success": true,
"language": "de",
"duration_seconds": 184,
"billed_minutes": 4,
"credits_used": 12,
"text": "…",
"segments": [{ "start": 0.0, "end": 4.2, "text": "…" }],
"translation": { "language": "en", "text": "…", "segments": [ … ] } }
POST /v1/tts
Trasforma un testo (fino a 4.000 caratteri, lingua rilevata automaticamente) in voce naturale e restituisce un link WAV. Scegli una voice da GET /v1/tts/voices (30 voci, gratis), la quality standard o pro e, se vuoi, uno style di lettura come "allegramente".
5 crediti per ogni blocco di 1.000 caratteri iniziato in Standard, 7 in Pro. Le richieste non riuscite non vengono addebitate. Il file audio viene conservato per un'ora.
curl -X POST https://api.morfran.com/v1/tts \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Welcome to Morfran.","voice":"Kore","quality":"standard"}'
{ "success": true,
"audio_url": "https://cdn.morfran.com/…/speech.wav",
"duration_seconds": 2.1,
"characters": 19,
"billed_units": 1,
"credits_used": 5 }
POST /v1/ocr
Legge il testo di un'immagine o di un PDF (fino a 20 pagine e 20 MB). Invia image_url o image_base64; JPEG, PNG, WebP, HEIC e PDF vengono riconosciuti dal file stesso. format è text (predefinito) o markdown, che mantiene le tabelle. language è un suggerimento facoltativo.
1 credito ogni 10 pagine iniziate; un'immagine conta come una pagina. Le pagine di un PDF sono separate da una riga ---. Le richieste non riuscite non vengono addebitate.
curl -X POST https://api.morfran.com/v1/ocr \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url":"https://…/invoice.pdf","format":"markdown"}'
{ "success": true,
"format": "markdown",
"pages": 3,
"text": "…",
"credits_used": 1 }
POST /v1/background-removal
Rimuove lo sfondo da una foto e restituisce un PNG trasparente delle dimensioni della tua immagine (lato più lungo fino a 4.096 px). Invia image_url o image_base64 (JPEG, PNG, WebP o HEIC, fino a 20 MB).
1 credito per immagine. Le richieste non riuscite non vengono addebitate. Il file del risultato viene conservato per un'ora.
curl -X POST https://api.morfran.com/v1/background-removal \
-H "X-API-Key: $MORFRAN_KEY" \
-H "Content-Type: application/json" \
-d '{"image_url":"https://…/product.jpg"}'
{ "success": true,
"image_url": "https://cdn.morfran.com/…/cutout.png",
"width": 2048,
"height": 1536,
"credits_used": 1 }
GET /v1/credits/balance
Il tuo saldo crediti attuale. Gratuito.
curl https://api.morfran.com/v1/credits/balance \ -H "X-API-Key: $MORFRAN_KEY"
Server MCP per agenti IA
Usa Morfran da Claude, Cursor o qualsiasi agente che parli il Model Context Protocol. Il server è su https://api.morfran.com/mcp (Streamable HTTP) e usa la stessa chiave API e gli stessi prezzi in crediti dell'API REST; i lavori non riusciti non vengono addebitati.
Strumenti: list_effects, apply_effect (slug, image_url, quality), get_effect_task, face_swap (source_image_url, target_image_url), get_face_swap_result, detect_faces, get_credit_balance.
claude mcp add --transport http morfran https://api.morfran.com/mcp \ --header "X-API-Key: $MORFRAN_KEY"
Altri client: aggiungi un server MCP HTTP con quell'URL e l'header X-API-Key (oppure Authorization: Bearer <key>).
Presente nel registro MCP ufficiale come com.morfran/morfran.
Immobiliare (prossimamente)
L'home staging virtuale e i video per annunci da 8 secondi (118 crediti a video) non sono ancora nell'API. Compariranno nello schema OpenAPI quando saranno attivi.