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

# Get Started with the Dify API

> Get an API key, make your first call, and find the endpoints for your app type

Every app you publish in Dify doubles as a REST API, and so do your knowledge bases. You call the same app your end users interact with, from your own backend, with an API key.

## Get an API Key

<Warning>
  Call the API from your backend only. A key embedded in frontend code or a client app can be extracted and abused.
</Warning>

* For an app, create an API key from inside the app itself. The key is scoped to that one app, and one key serves all your end users.

  <Info>
    Your calls tell people apart with a per-person `user` value. See [End User Identity](/en/3.11.x/develop/api/guides/end-user-identity) for details.
  </Info>

* For knowledge bases, go to **Knowledge** and click **Service API** in the top-right corner.

  A knowledge API key is broader: it can reach every knowledge base visible to the account that created the key, so treat it with extra care. See [Knowledge API](/en/3.11.x/develop/api/guides/knowledge) for details.

## Make Your First Call

Every request carries the key as a Bearer token. The base URL is your deployment's API endpoint, such as `https://api.example.com/v1`; you can copy it from the app's API access page.

The fastest first call needs no code: open [Get App Info](/en/3.11.x/develop/api/applications/get-app-info), click **Try it**, paste your key into the **Authorization** field, and press **Send**. It works for every app type.

The same call from a terminal:

```bash theme={null}
curl https://api.example.com/v1/info \
  -H "Authorization: Bearer $DIFY_API_KEY"
```

A response like this confirms the key works and shows which app it belongs to:

```json theme={null}
{
  "name": "My Chat App",
  "description": "A helpful assistant",
  "tags": ["assistant"],
  "mode": "chat",
  "author_name": "Dify Team"
}
```

Using a knowledge API key? Its endpoints are a separate family: start with [List Knowledge Bases](/en/3.11.x/develop/api/knowledge-bases/list-knowledge-bases) instead.

## Find Your App Type's Endpoints

See each app type's own overview page for its full API surface:

* [Chatflow](/en/3.11.x/develop/api/guides/chatflow) (`advanced-chat`)
* [Workflow](/en/3.11.x/develop/api/guides/workflow) (`workflow`)
* [Chatbot and Agent](/en/3.11.x/develop/api/guides/chat) (`chat`, `agent-chat`)
* [Text Generator](/en/3.11.x/develop/api/guides/completion) (`completion`)
* [Knowledge](/en/3.11.x/develop/api/guides/knowledge)
