FlexPicOpen the app

FlexPic / Tutorials / Workflow and API

Use the API and the MCP server

Create an API key, check your balance, start a generation over REST and connect an MCP client such as Claude Code or Cursor to FlexPic.

Workflow and APIBy FlexPic Team2 min read

Goal

Generate images, video and audio from a script or from an AI agent, using your own credits.

Before you start

Steps

  1. Click your avatar to open the account menu and choose API keys. Type a name in Key name (for example "Laptop") and click Create key.
  2. When Copy your new key now appears, copy the key and store it in an environment variable. It is shown once, and you can have at most five active keys. A key looks like fpk_live_ followed by 32 characters.
  3. Check your balance:
    curl -s https://flexpic.ai/api/credits -H "Authorization: Bearer $FLEXPIC_API_KEY"
  4. See which tools and models are live:
    curl -s https://flexpic.ai/api/capabilities
  5. Start an image generation. The answer contains a job id and the cost:
    curl -s https://flexpic.ai/api/generate -H "Authorization: Bearer $FLEXPIC_API_KEY" -H "Content-Type: application/json" -d '{"slug":"create-image","tool":"Create Image","kind":"image","prompt":"a red kite over a quiet beach","out":{"ar":"1:1","res":"1k"},"n":1}'
  6. Poll the job until its status is done:
    curl -s https://flexpic.ai/api/jobs/JOB_ID -H "Authorization: Bearer $FLEXPIC_API_KEY"
  7. To use MCP, add the server https://flexpic.ai/mcp to your client and send the same header. For Claude Code:
    claude mcp add --transport http flexpic https://flexpic.ai/mcp --header "Authorization: Bearer $FLEXPIC_API_KEY"
  8. Ask your agent to call list_models and estimate_cost first, then generate_image, generate_video or generate_audio. Video returns a job id; use wait_for_job until it is done.

What you should get

A finished job with signed result URLs that stay valid for about 24 hours, and credits deducted exactly as on the website. Failed jobs are refunded automatically.

Cost example

The API and MCP use the same prices as the app. The image request above costs about 8 credits with GPT Image 2.5 at Low quality, and a 5 second Seedance 2.0 video at 720p costs about 957. The estimate_cost tool returns the price without charging you.

Tips

Common mistakes

Related tutorials