Skip to content

OpenAI Assistants API

The ai CLI allows you to create, manage, and interact with OpenAI's Assistants API.

Prerequisites

Before you begin, you'll need to install the ai CLI and set up Azure OpenAI.

Install the ai CLI
Setup Azure OpenAI

Listing, creating, updating, and deleting assistants

List all assistants
ai chat assistant list
Create an assistant
ai chat assistant create --name MyAssistant
Update an assistant
ai chat assistant update --instructions @instructions.txt
Delete an assistant
ai chat assistant delete --id ID

See the persisted config from ai chat assistant create/update

View assistant configuration
ai config @assistant.id

Picking a new assistant

List all assistants
ai chat assistant list
Set assistant by ID
ai config --set assistant.id ID

Clearing the assistant ID from the config

Clear assistant ID
ai config --clear assistant.id