> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diagramkit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Make, change, animate and download diagrams from your own code. Every endpoint, parameter, response and error, with examples in curl, JavaScript and Python.

The same reference as plain Markdown, for coding agents: [https://diagramkit.ai/docs/api.md](https://diagramkit.ai/docs/api.md).

![Sequence diagram: your app posts a prompt to the diagramkit API, gets a job id, waits until the status is succeeded, then downloads the diagram as PNG, SVG, PDF, MP4 or GIF.](https://mintcdn.com/diagramkit/ebykF4nswR7v4CBJ/images/api-flow.png?fit=max\&auto=format\&n=ebykF4nswR7v4CBJ\&q=85\&s=777c779864aaf753c00c4c7034cc999b)

Send a prompt, wait for the agent to finish, then download the file.

## Before you start

* The base URL is `https://app.diagramkit.ai/api/v1`. Requests and responses are JSON, except downloads, which are the file itself.
* Create a key at [https://app.diagramkit.ai/settings/api](https://app.diagramkit.ai/settings/api) and send it on every request, downloads included: `Authorization: Bearer aid_…`. A key is shown once; store it as a secret and revoke it there if it leaks.
* Call the API from your server or a script. Browsers are not allowed to call it from other sites, and a key in a web page is a leaked key.
* Diagrams made with the API appear in your diagrams in the app and use your brand kit and writing style.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.