Developers

Director API & MCP

One HTTP call turns a brief and some material into a shot-by-shot production plan — as a document a person can read, and as a machine plan with every scene pinned to a second range. Same director as the done-for-you service; you are just calling it yourself.

Three steps

1

Get a key

Sign in, open your account page, create an API key. It is shown once — save it. A verified email gets 100 credits on the house, enough for ten short plans.

2

Top up

Credits are prepaid on the same page: $10 / $30 / $100. 1 credit = $0.01. Nothing expires.

3

Call it

Submit material, poll for the result. Or add the MCP server and the tools appear in your client.

Go to my account

What it costs

Priced by finished-video duration — the length of the film you are making, not how long we spend on it. Upload music and the audio length is measured and used; without music you declare it.

Finished videoCreditsRoughly
Up to 60 seconds10 credits$0.10
Up to 5 minutes20 credits$0.20
Each further 5 minutes+20 credits+$0.20

Launch pricing. Questions and failures cost nothing: if the director needs more information, or generation fails, the hold is released in full.

Submit a plan

curl -X POST https://spaceskills.shop/v1/plans \
  -H "Authorization: Bearer $DIRECTOR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brief": "4-minute MV, a courier riding through the city at night, lonely turning to free",
    "lang": "en",
    "materials": {
      "music": { "name": "song.mp3", "url": "https://example.com/song.mp3" },
      "characters": [{ "name": "courier.jpg", "url": "https://example.com/courier.jpg" }]
    }
  }'

Returns immediately with a plan_id. Generation takes two to four minutes; poll the plan until status leaves running.

curl https://spaceskills.shop/v1/plans/pl_xxx \
  -H "Authorization: Bearer $DIRECTOR_API_KEY"

status is one of running, need_info, succeeded, failed. On succeeded you get the plan document and the machine plan; on need_info you get questions to answer.

Endpoints

EndpointWhat it does
POST /v1/quotePrice a duration before committing. Free.
POST /v1/plansSubmit brief and material. Holds credits, returns plan_id.
GET /v1/plans/{id}Status, and the plan once it is ready.
POST /v1/plans/{id}/answersAnswer the director questions and continue. Charged as a fresh run.
GET /v1/creditsBalance, price list and the last 50 ledger entries.
GET /v1/vocabularyThe camera and lighting vocabulary the plans are written in. Free, no key needed.

Sending material

Everything goes in one JSON body. Files are either inline base64 or an https URL we fetch. Up to 40 MB per file, 120 MB per request, at most 12 characters and 12 stills.

FieldTypeNotes
briefstringWhat you are making, in plain prose. The more concrete, the fewer questions come back.
duration_secnumberFinished-video length. Required when you send no music — it is the pricing basis.
lang"en" | "zh"Language the plan is written in. Defaults to English.
materials.musicfileAudio. Its measured length overrides duration_sec and becomes the timeline.
materials.lyricsstringLRC with timestamps. Given one, section boundaries come from the lyrics instead of from energy detection.
materials.scriptstringAn existing script or treatment, as Markdown.
materials.characters[]file[]Reference stills of the people. Named files are easier for the director to refer to.
materials.images[]file[]Location, prop and mood references.
materials.answersstringAnswers to earlier questions, if you already know what will be asked.

A file is { "name": "hero.jpg", "url": "https://…" } or { "name": "hero.jpg", "data_base64": "…" }. URLs must be https and must not resolve to a private address.

What comes back

Two representations of the same plan. The document is for people; the machine plan is for whatever you feed it into next.

{
  "schema": "director.plan/1",
  "media": { "aspect_ratio": "9:16", "fps": 24, "duration_sec": 270.59 },
  "timeline": [
    { "scene": 1, "title": "…", "start_sec": 0, "end_sec": 30,
      "shots": [{ "id": "1a", "intent": "…", "terms": ["push-in"],
                  "start_sec": 0, "end_sec": 15 }] }
  ],
  "characters": [
    { "id": "c1", "name": "…", "asset": "a1",
      "states": [{ "from_sec": 0, "to_sec": 44, "state": "…" }] }
  ],
  "vocabulary": [{ "id": "push-in", "zh": "推镜头", "definition": "…" }],
  "assets": [{ "id": "a1", "file": "courier.jpg", "sha256": "…" }],
  "warnings": []
}

The machine plan declares schema: "director.plan/1". Seconds everywhere, aspect ratio from a fixed enum.

MCP

The same six operations as tools, for clients that speak MCP. Your key goes in the environment; nothing else to configure.

claude mcp add director -e DIRECTOR_API_KEY=sk_live_… -- npx -y @spaceskills/director-mcp

quote_plan · create_plan · get_plan · answer_questions · get_credits · get_vocabulary

When things go wrong

CodeMeans
unauthorizedMissing or wrong key. Use Authorization: Bearer sk_live_…
insufficient_creditsBalance below the price. Top up on your account page.
duration_requiredNo music, and no duration_sec — we cannot price it.
bad_materialA file was too large, unreachable, or not https.
busyAnother plan is generating. Retry in a minute.
daily_quotaDaily generation limit reached. Topping up raises it.
rate_limitedToo many requests. Retry-After says how long to wait.
not_waitingYou answered questions on a plan that is not asking any.

Limits

Questions, or something behaving oddly? Tell us