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

# Agents API Overview

> Create, manage, and chat with agents in your Langdock workspace programmatically

The Agents API lets you create, manage, and chat with agents in your Langdock workspace programmatically. The completions endpoint uses the Vercel AI SDK compatible message format, so you can use agents with the `useChat` hook and other Vercel AI SDK features.

## Before You Start

* **API key scope**: Agent endpoints require an API key with the `AGENT_API` scope. The attachment endpoints require the `KNOWLEDGE_FOLDER_API` scope.
* **Agent access**: To use an existing agent with an API key, the agent must be shared with that key. See [Sharing Agents with API Keys](/en/developer/agents-api/agent-api-guide).
* **Legacy Assistants API**: This is the new Agents API with native Vercel AI SDK compatibility. If you're using the legacy Assistants API, see the [migration guide](/en/developer/assistants-api/assistant-to-agent-migration).

## Base URL

```
https://api.langdock.com
```

<Warning>
  **Dedicated deployments**

  Replace `api.langdock.com` with `<your-deployment-url>/api/public` in all requests.
</Warning>

## Available Endpoints

### Agents

| Method  | Endpoint                     | Description                                                            |
| ------- | ---------------------------- | ---------------------------------------------------------------------- |
| `POST`  | `/agent/v1/chat/completions` | [Create a model response for an agent](/en/developer/agents-api/agent) |
| `GET`   | `/agent/v1/get`              | [Get agent details](/en/developer/agents-api/agent-get)                |
| `POST`  | `/agent/v1/create`           | [Create a new agent](/en/developer/agents-api/agent-create)            |
| `PATCH` | `/agent/v1/update`           | [Update an agent](/en/developer/agents-api/agent-update)               |
| `POST`  | `/agent/v1/publish`          | [Publish an agent's draft](/en/developer/agents-api/agent-publish)     |
| `PATCH` | `/agent/v1/disable`          | [Enable or disable an agent](/en/developer/agents-api/agent-disable)   |
| `GET`   | `/agent/v1/models`           | [List available models](/en/developer/agents-api/agent-models)         |

### Attachments

| Method   | Endpoint                | Description                                                                  |
| -------- | ----------------------- | ---------------------------------------------------------------------------- |
| `POST`   | `/attachment/v1/upload` | [Upload files for agents](/en/developer/agents-api/upload-attachments)       |
| `DELETE` | `/attachment/v1/delete` | [Delete an uploaded attachment](/en/developer/agents-api/delete-attachments) |

## Guides

* [Sharing Agents with API Keys](/en/developer/agents-api/agent-api-guide): create an API key and share an agent with it
* [Agent Migration Guide](/en/developer/agents-api/agent-migration): migrate agents between workspaces using the Agents API
