Agents
Agent guide
An agent with a Kinoseed key can spend real credits, so it should find the API on its own, price before it spends, and wait for video without hammering the server. Here is how.
Discovery
Everything an agent or a tool needs to find and describe the API, at fixed public URLs:
| File | What it is |
|---|---|
| /openapi.json | OpenAPI 3.1 for the REST API, with curl, TypeScript and Python samples on every operation (x-codeSamples). |
| /api/mcp/server-card | The MCP server card (SEP-2127): name, transport, URL and the header it needs. |
| /.well-known/ai-catalog.json | The catalog that lists the server card and the OpenAPI document, for agents that look there first. |
| /llms.txt | The site and the API described in plain text for language models. |
Budgeting
- Read the balance once with
get_credits(GET /credits). - Before each run,
quote(POST /quote) the exact arguments. It is free, and the number is what the run will charge. - Keep a running total and stop, or ask the person, before it passes the budget you were given. Say prices in credits; GET /credits gives
creditUsdif the person thinks in dollars. - On
insufficient_credits, stop and hand overdetails.topUpUrl. Retrying will not help.
A failed run costs nothing: it is refunded automatically and the job shows credits.refunded. See Pricing.
Polling cadence
- Images:
generate_imageover MCP waits for you. Over REST, oneGET /jobs/{id}?wait=50after the POST is usually enough. - Videos: expect one to several minutes. Loop
GET /jobs/{id}?wait=50(orget_jobwithwait_seconds); each call returns early when the job is final. - Without
wait, poll no faster than every 3 seconds. Several videos at once: at most five in flight per account (see Rate limits). - Give up on your side after about ten minutes and report the job id; the job keeps its state on ours.
A system prompt block
Paste this into your agent's instructions. It names no prices on purpose: the agent asks quote.
You can generate images and videos with Kinoseed (https://kinoseed.app).
Use the Kinoseed MCP server at https://kinoseed.app/api/mcp if it is connected; otherwise call the REST API at https://kinoseed.app/api/v1 with the header "Authorization: Bearer $KINOSEED_API_KEY".
Rules:
- Runs cost credits from the user's balance. Before every generation, call quote (POST /api/v1/quote) with the exact arguments and tell the user the price in credits. Ask before any batch of runs, and before going past the budget the user gave you.
- Check the balance with get_credits (GET /api/v1/credits) when a quote might not fit. If a call fails with insufficient_credits, stop and give the user details.topUpUrl. Do not retry.
- Pick model ids only from list_models (GET /api/v1/models). Do not invent ids.
- Images: generate_image waits for the result. Videos take minutes: start with generate_video, then call get_job with wait_seconds (or GET /api/v1/jobs/{id}?wait=50) until status is completed or failed. Do not poll faster than every 3 seconds.
- A failed job is refunded automatically (credits.refunded). Report the error to the user; retry at most once, with changed arguments.
- Input images must be public https URLs or URLs returned by the files upload. Never send local paths.
- Send an Idempotency-Key on every REST generation so a retry after a timeout cannot start a second run.
- Return results as the output URLs. Never print the API key.
As a GPT Action
- In the GPT editor, open Configure, then Actions, then Create new action.
- Choose Import from URL and enter
https://kinoseed.app/openapi.json. - Under Authentication pick API Key, Auth Type Bearer, and paste a key that has only the scopes the GPT needs.
- Add the system prompt block above to the GPT's instructions.
This document
get/api/v1/openapi.json
PublicgetOpenApi
The OpenAPI 3.1 description of this API. Also served at the site root as /openapi.json.
curl https://kinoseed.app/openapi.json
Responses
| Status | Body | Meaning |
|---|---|---|
| 200 | object | OpenAPI 3.1 document. |
Response fields
The 200 body.
No fields.