Skip to content

Your first request ​

📝 TODO — this English page is a skeleton. The structure mirrors the Chinese page, which is fully written.

bash
export API_BASE="https://ai.modelfold.online/v1"
export MODELFOLD_API_KEY="mf-..."

Image generation ​

bash
curl -X POST "$API_BASE/images/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"nano-banana-2","prompt":"a paper boat drifting down a rainy street","resolution":"1K"}'
FieldRequiredNotes
modelyesAn image model ID
promptyesUp to 2000 characters
image_urlnoReference image for edit models
resolutionnoResolution preset

Video generation ​

bash
curl -X POST "$API_BASE/videos/generations" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"kling-2.6/text-to-video","prompt":"a paper boat in the rain","duration":5,"resolution":"720p"}'

Chat completions ​

bash
curl -X POST "$API_BASE/chat/completions" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"hello"}],"max_tokens":512}'

Errors ​

json
{ "ok": false, "error": { "type": "insufficient_credits", "message": "..." } }
HTTPerror.typeMeaning
400unsupported_modelUnknown model, or modality does not match the endpoint
402insufficient_creditsNot enough credits; nothing was charged
429rate_limitedRate limit exceeded
502upstream_failedUpstream failed — refunded automatically
503upstream_unavailableUpstream not configured for this model

See also ​

ModelFold — one API for all the best AI models.