{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "yi1108-printfilm--call-generation-api-from-script-or-agent",
 "repo": "yi1108/printfilm",
 "repo_url": "https://github.com/yi1108/printfilm",
 "repo_slug": "yi1108-printfilm",
 "title": "Call the open API to generate images or videos from a script",
 "page_title": "How to call the open API to generate images or videos from a script with Printfilm",
 "summary": "Use the /api/v1 endpoints with a Bearer token or X-Api-Key header to run generation from your own code.",
 "who": "A developer or automation agent that needs to generate images or videos as one step in a larger workflow.",
 "problem": "Generation through the web interface does not fit into scripts, batch jobs, or other tools.",
 "outcome": "A script or agent that submits image or video generation through PRINTFILM and receives results from the API.",
 "steps": [
  "Start PRINTFILM and confirm the API is up with `http://localhost:8000/api/health`.",
  "Open the API docs at http://localhost:8000/docs and find the /api/v1 image and video generation routes.",
  "Obtain an API credential for your account, since the README names Bearer tokens and X-Api-Key headers but does not describe how to create one.",
  "Send a request to the image or video route with either an `Authorization: Bearer <token>` header or an `X-Api-Key: <key>` header. (inferred, check the README)",
  "Poll the task status through the API until the output is ready, then save the returned file."
 ],
 "agent_prompt": "Using the PRINTFILM API at http://localhost:8000/api/v1 and the route listed at http://localhost:8000/docs, submit one image generation request with the prompt <prompt> using the credential in <env var>. Return the task ID and the final result, and verify the response status is successful.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "90 minutes",
 "basis": "readme",
 "caveat": "The README documents the /api/v1 paths and auth methods only in summary form, so confirm the exact request format in the /docs page before writing code against it.",
 "category": "Content",
 "tags": [
  "Content"
 ],
 "lang": "python",
 "requirements": [
  "Docker Desktop, or Docker Engine with Compose",
  "A TokenFree API key (sk-...), or set ARK_MOCK=true to try the interface without real generation",
  "Ports 8000, 8080, and 8081 free on the host machine"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "API credentials and TokenFree keys grant access to paid generation, so store them in environment variables and never place them in prompts or committed files."
  }
 ],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/yi1108-printfilm/call-generation-api-from-script-or-agent/",
 "md": "https://dedupedai.com/use-cases/yi1108-printfilm/call-generation-api-from-script-or-agent/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/yi1108-printfilm--call-generation-api-from-script-or-agent.json",
 "api_version": "v1"
}
