> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/platform/api-and-integrations/api-reference.md).

# API reference

Every AutoGPT API v2 endpoint with its parameters, request body, responses and required permissions, generated from the OpenAPI specification.

The pages in this section are generated from the API's OpenAPI 3.1 specification, one page per endpoint, grouped by area. Each page lists the endpoint's parameters, request body, responses and required permission, and its Markdown version (append `.md` to the URL) contains a complete OpenAPI description of that endpoint, ready for code generators and AI agents.

## Base URL and authentication

All paths are relative to your instance's base URL:

| Where AutoGPT runs              | Base URL                             |
| ------------------------------- | ------------------------------------ |
| AutoGPT Cloud                   | `https://backend.agpt.co/api/v2`     |
| Self-hosted with Docker Compose | `http://localhost:8006/api/v2`       |
| Self-hosted single container    | `http://localhost:3000/_agpt/api/v2` |

Authenticate every request with an API key in the `X-API-Key` header, or with `Authorization: Bearer` and an API key or OAuth access token. Each endpoint's page names the permission it needs. See [Authentication and permissions](/docs/platform/api-and-integrations/api-guide/authentication.md).

## The specification

Download the specification your code will talk to from the instance itself, since each instance serves the version it runs:

* `$AUTOGPT_API_URL/openapi.json`, which needs no key. AutoGPT Cloud: [backend.agpt.co/api/v2/openapi.json](https://backend.agpt.co/api/v2/openapi.json).
* `$AUTOGPT_API_URL/docs` is an interactive explorer (Swagger UI), and `$AUTOGPT_API_URL/redoc` a readable one.

Generate a typed client from it with any OpenAPI generator, and give the client your `$AUTOGPT_API_URL` as its base URL. Don't rely on the spec's `servers` list: it names AutoGPT Cloud and the default self-hosted addresses in the table above, not necessarily your instance's. For example:

{% tabs %}
{% tab title="TypeScript" %}

```bash
npx openapi-typescript "$AUTOGPT_API_URL/openapi.json" -o autogpt-api.d.ts
```

{% endtab %}

{% tab title="Python" %}

```bash
pipx run openapi-python-client generate --url "$AUTOGPT_API_URL/openapi.json"
```

{% endtab %}
{% endtabs %}

## Areas

| Area         | What it covers                                                            |
| ------------ | ------------------------------------------------------------------------- |
| Graphs       | Create, read and version agent graphs; graph settings.                    |
| Schedules    | Run graphs on a cron schedule.                                            |
| Blocks       | The building blocks agents are made from.                                 |
| Search       | Search marketplace agents, blocks, docs, your library and your files.     |
| Marketplace  | Browse agents and creators; manage your submissions and profile.          |
| Library      | Your agents and folders; start runs.                                      |
| Presets      | Saved inputs for running an agent, and the webhook triggers that run one. |
| Runs         | Run status, outputs, stopping, sharing and human-in-the-loop reviews.     |
| Credits      | Balance, transactions, invoices, subscription and cost summaries.         |
| Integrations | Third-party credentials your agents use.                                  |
| Files        | Upload, list, download and delete workspace files.                        |
| Identity     | Who a credential acts as: `GET /me`.                                      |

The conventions every endpoint shares, such as errors, pagination, rate limits and idempotency, are on [Errors, rate limits, and pagination](/docs/platform/api-and-integrations/api-guide/api-conventions.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://agpt.co/docs/platform/api-and-integrations/api-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
