Skip to content
ajan.io

Docs menu

On this page

Agents API Overview

Create, manage, and chat with agents in your ajan workspace programmatically

The Agents API lets you create, manage, and chat with agents in your ajan 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.
  • 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.

Base URL

https://api.ajan.io

Available Endpoints

Agents

MethodEndpointDescription
POST/agent/v1/chat/completionsCreate a model response for an agent
GET/agent/v1/getGet agent details
POST/agent/v1/createCreate a new agent
PATCH/agent/v1/updateUpdate an agent
POST/agent/v1/publishPublish an agent's draft
PATCH/agent/v1/disableEnable or disable an agent
GET/agent/v1/modelsList available models

Attachments

MethodEndpointDescription
POST/attachment/v1/uploadUpload files for agents
DELETE/attachment/v1/deleteDelete an uploaded attachment

Guides