Skip to main content
The API is paid in credits, from the same balance as the app and the MCP connector: Most diagrams are one page. A diagram with several pages is priced by its pages: a new three-page diagram is 15 credits, and a change that redraws two of its pages is 4. A request is charged once, when its result is kept; a retry with the same Idempotency-Key is not charged again. Your plan’s credits are used first, then bought credits. Buy credits or turn on automatic top-up at https://app.diagramkit.ai/settings/api, where you also see your balance and this month’s use. When the balance cannot pay for a request, it is refused with 402 no_credits before any work starts, and nothing is charged.
Flowchart of a request's credits: edits without the AI, downloads, reading and listing are free. An AI request that reuses an Idempotency-Key returns the earlier job with no repeat charge. Otherwise all pages are planned: more than max_pages (default 30) fails with too_many_pages, and a balance that cannot cover every page fails with no_credits (402), with nothing drawn or charged in either case. Otherwise it is drawn and, when the result is kept, charged once from plan credits first, then bought credits. A new three-page diagram is 15 credits; a change to two pages is 4.

A request is checked before anything is drawn, and charged once, when its result is kept.

A set of pages (slides, a carousel, “one page per step”) has as many pages as the prompt asks for. It is planned first, and its whole cost is checked before any page is drawn: a set the balance cannot pay for fails with error.type no_credits, a message saying how many pages were planned, the credits they need and the balance, and nothing drawn or charged. The API never asks before drawing, so a set of more than 30 pages needs your yes: send max_pages with the most pages you accept. Without it, a longer set fails with error.type too_many_pages and a message naming its page count and cost; send the request again with max_pages. A job’s time limit grows with its pages.