Skip to content

API reference

Everything Claude does with Folio Gen Studio, your own code can do over HTTP: start video and picture jobs, read their results, and check your credits.

Basics

Address
Every path below starts at https://….
Your key
Send Authorization: Bearer fgs_… with every call. Create a key on the API keys page; it is shown once. Assistants connected over MCP send their own token instead.
Price first
A call that spends credits takes "price_only": true, which answers with the price and starts nothing. Send max_credits with the real call, and it is refused if the price has gone up.
Safe repeats
Send an Idempotency-Key header when you start a job. A repeat with the same key returns the first job and charges nothing more.
Answers
JSON. Every answer carries a request_id for support. A field that does not apply is null, never left out. Status 202 means a new job is still running; every other success is 200.
Lists
Newest first. limit is 20 unless you ask for up to 100. Pass next_cursor back as cursor until it is null.
Limits
60 calls a minute for each key or assistant connection. Past that, calls are refused with rate_limited and how long to wait.

Quick start

A 5-second video, from price to result, with curl.

# Your key, from the API keys page, and the API's address
FGS_KEY=fgs_…
BASE=https://…/api/v1

# 1. Ask the price. Nothing starts and nothing is charged.
curl -s "$BASE/generations" \
  -H "Authorization: Bearer $FGS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "seedance-2.5",
    "mode": "text_to_video",
    "prompt": "A lighthouse keeper climbs the stairs in a storm",
    "resolution": "480p",
    "duration": 5,
    "price_only": true
  }'

# 2. Start it. Sending the same Idempotency-Key again never charges twice.
curl -s "$BASE/generations" \
  -H "Authorization: Bearer $FGS_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: lighthouse-1" \
  -d '{
    "model": "seedance-2.5",
    "mode": "text_to_video",
    "prompt": "A lighthouse keeper climbs the stairs in a storm",
    "resolution": "480p",
    "duration": 5
  }'

# 3. Read the job. Each call waits up to 25 seconds for a change.
curl -s "$BASE/generations/<job id>?wait=25" \
  -H "Authorization: Bearer $FGS_KEY"

When the job's status is succeeded, its results hold a download_url that works for an hour and a page_url that lasts.

Generations

Start a video or picture job, see its price first, and read it until it is done.

POST /api/v1/generations

Start a video or image job and hold its credits, or with price_only, return the price and start nothing.

Changes somethingMCP tools: generate_video, generate_image
  • Idempotency-Keyheader
    text, up to 255 characters. Optional.
  • modelbody
    text. Optional.
  • kindbody
    one of video, image. Optional.
  • modebody
    text. Required.
  • promptbody
    text, up to 5,000 characters. Default "".
  • mediasbody
    list of objects with role, media_id, up to 50. Default [].
  • resolutionbody
    text. Optional.
  • durationbody
    whole number, at least 1, or "auto". Optional.
  • aspect_ratiobody
    text. Optional.
  • generate_audiobody
    true or false. Optional.
  • countbody
    whole number, at least 1. Optional.
  • draftbody
    true or false. Optional.
  • price_onlybody
    true or false. Default false.
  • max_creditsbody
    whole number, at least 0. Optional.
  • project_idbody
    ID starting prj_. Optional.

Other model settings go at the top level too. Each model lists the settings and values it takes in GET /api/v1/models; any other name or value is refused with the allowed values.

Answer: { job, balance, request_id } or { price, balance, request_id }

GET /api/v1/generations/{id}

One job. With wait, holds the answer up to that many seconds (at most 25) for a change.

Reads onlyMCP tool: job_status
  • idin the path
    ID starting job_. Required.
  • waitquery
    whole number, 0 to 25. Default 0.

Answer: { job, request_id }

POST /api/v1/generations/wait

Wait up to 15 seconds for up to 12 jobs, and answer with their latest state.

Reads onlyMCP tool: jobs_wait
  • idsbody
    list of ID starting job_, up to 12. Required.
  • waitbody
    whole number, 0 to 15. Default 15.

Answer: { jobs, request_id }

GET /api/v1/generations

My jobs, newest first, in pages.

Reads onlyMCP tool: show_generations
  • cursorquery
    text. Optional.
  • limitquery
    whole number, 1 to 100. Default 20.
  • kindquery
    one of video, image. Optional.
  • statusquery
    one of submitting, queued, running, succeeded, failed. Optional.
  • project_idquery
    ID starting prj_. Optional.

Answer: { items, next_cursor, request_id }

Models

What each model can make, the settings it takes and what it costs today.

GET /api/v1/models

Every live model with its modes, allowed settings, limits and current prices.

Reads onlyMCP tool: models_explore
  • kindquery
    one of video, image. Optional.

Answer: { items, next_cursor, request_id }

GET /api/v1/models/{id}

One model with its modes, allowed settings, limits and current prices.

Reads only
  • idin the path
    text. Required.

Answer: { model, request_id }

Files

Send your own pictures, clips and audio, or copy them in from the web.

POST /api/v1/media/uploads

Signed links for sending files straight to storage, plus a link to the upload page.

Changes somethingMCP tool: media_upload
  • filesbody
    list of objects with name, mime, bytes, up to 10. Default [].
  • project_idbody
    ID starting prj_. Optional.

Answer: { uploads, upload_page_url, expires_at, request_id }

POST /api/v1/media/confirm

Check uploaded files and mark them ready, or rejected with the reason.

Changes somethingMCP tool: media_confirm
  • media_idsbody
    list of ID starting med_, up to 20. Required.

Answer: { media, request_id }

POST /api/v1/media/import

Copy a file in from a public HTTPS address.

Changes somethingMCP tool: media_import_url
  • urlbody
    web address. Required.
  • namebody
    text, up to 255 characters. Optional.
  • project_idbody
    ID starting prj_. Optional.

Answer: { media, request_id }

GET /api/v1/media

My files, newest first, in pages. Items in Trash are left out.

Reads only
  • cursorquery
    text. Optional.
  • limitquery
    whole number, 1 to 100. Default 20.
  • kindquery
    one of image, video, audio. Optional.
  • statusquery
    one of pending, ready, rejected. Optional.

Answer: { items, next_cursor, request_id }

PATCH /api/v1/media/{id}

Star a file, move it to a project, rename it, or save it as an element. null clears a project or an element.

Changes somethingMCP tool: element_save
  • idin the path
    ID starting med_. Required.
  • favoritebody
    true or false. Optional.
  • project_idbody
    ID starting prj_, or null. Optional.
  • elementbody
    object with name, type, or null. Optional.
  • namebody
    text, up to 255 characters. Optional.

Answer: { media, request_id }

DELETE /api/v1/media/{id}

Move a file to Trash. It is removed for good after 30 days.

Changes something
  • idin the path
    ID starting med_. Required.

Answer: { media, request_id }

POST /api/v1/media/{id}/restore

Bring a file back from Trash.

Changes something
  • idin the path
    ID starting med_. Required.

Answer: { media, request_id }

Library and projects

Everything you made or uploaded, starred items, saved characters and places, and folders.

GET /api/v1/library

Assets, favorites, elements or trash, newest first, with filters for kind, origin, project and element type.

Reads onlyMCP tool: element_list
  • viewquery
    one of assets, favorites, elements, trash. Default "assets".
  • kindquery
    one of image, video, audio. Optional.
  • originquery
    one of upload, import, result. Optional.
  • project_idquery
    ID starting prj_. Optional.
  • element_typequery
    one of character, place, prop. Optional.
  • cursorquery
    text. Optional.
  • limitquery
    whole number, 1 to 100. Default 20.

Answer: { items, next_cursor, request_id }

GET /api/v1/projects

My projects, newest first.

Reads only
  • cursorquery
    text. Optional.
  • limitquery
    whole number, 1 to 100. Default 20.

Answer: { items, next_cursor, request_id }

POST /api/v1/projects

Make a project: a personal folder.

Changes something
  • namebody
    text, up to 80 characters. Required.

Answer: { project, request_id }

PATCH /api/v1/projects/{id}

Rename a project or set its cover picture.

Changes something
  • idin the path
    ID starting prj_. Required.
  • namebody
    text, up to 80 characters. Optional.
  • cover_media_idbody
    ID starting med_, or null. Optional.

Answer: { project, request_id }

DELETE /api/v1/projects/{id}

Delete a project. Its files stay in Assets, outside any project.

Changes something
  • idin the path
    ID starting prj_. Required.

Answer: { id, deleted, request_id }

Credits

Credits left, every credit added or spent, and totals by day.

GET /api/v1/balance

Credits left, plan, and when it renews.

Reads onlyMCP tool: balance

No fields.

Answer: { credits, plan, request_id }

GET /api/v1/transactions

Every credit added or spent, newest first, in pages, optionally only one assistant's, one API key's or the studio's.

Reads onlyMCP tool: transactions
  • sourcequery
    one of assistant, api_key, web. Optional.
  • source_namequery
    text, up to 100 characters. Optional.
  • cursorquery
    text. Optional.
  • limitquery
    whole number, 1 to 100. Default 20.

Answer: { items, next_cursor, request_id }

GET /api/v1/usage

Credits per day and per mode between two dates. The last 30 days when no dates are given.

Reads only
  • fromquery
    date, YYYY-MM-DD. Optional.
  • toquery
    date, YYYY-MM-DD. Optional.

Answer: { from, to, days, request_id }

Skills

Step-by-step plans an assistant follows for a bigger job, such as a short drama.

GET /api/v1/skills

The list of skills.

Reads onlyMCP tool: skill_list

No fields.

Answer: { items, next_cursor, request_id }

GET /api/v1/skills/{name}

One skill's steps, in Markdown.

Reads onlyMCP tool: skill_get
  • namein the path
    text. Required.

Answer: { skill, request_id }

Errors

A refused call answers { "error": { "code", "message", … }, "request_id" }. The message is written for people; the code is for your code.

  • invalid_params400

    A field is missing or not allowed. issues says which one; allowed lists the values a model takes.

  • unauthorized401

    No key or token was sent, or it was revoked or has run out.

  • insufficient_credits402

    Not enough credits. Nothing was charged. Carries needed, available and billing_url.

  • forbidden403

    This key or connection may not make this call.

  • not_found404

    There is no such item, or it is not yours.

  • duplicate_request409

    This Idempotency-Key was used before with different fields. Use a new key.

  • price_changed409

    The price is now above your max_credits. Nothing was charged. Carries the new price.

  • conflict409

    The account is not in a state that allows this call right now. The message says why.

  • media_not_ready422

    A file is unknown, not checked yet, or was rejected. Carries media_ids.

  • too_many_jobs429

    You already have as many jobs running as your plan allows. Nothing was charged. Carries limit and running.

  • rate_limited429

    Too many calls in a minute. Carries retry_after_seconds.

  • internal500

    Something went wrong on our side. Try again, and quote the request_id if it keeps happening.

  • vendor_error502

    The model refused the job or could not be reached when it started. Every credit was returned.

Used by our pages

These calls work only from our own pages, signed in with Google. An API key or an assistant's token is refused.

  • GET/api/app/keysMy API keys, newest first. Secrets are never shown again.
  • POST/api/app/keysMake an API key. The secret is in this answer only.
  • DELETE/api/app/keys/{id}Revoke an API key. Calls with it are refused from now on.
  • GET/api/app/billingPlan, credits, and which billing actions are open to me.
  • POST/api/app/billing/checkoutStart the trial or a plan on Stripe's page. Answers with the page's address.
  • POST/api/app/billing/portalOpen Stripe's page for the card, invoices and cancelling. Answers with the page's address.
  • POST/api/app/billing/upgradeMove from Plus to Ultra now: $129 today and a new month of 3,000 credits (design 8.1).