How to Create Agents on DigitalOcean Gradient™ AI Platform

Validated on 28 Aug 2025 • Last edited on 19 Feb 2026

DigitalOcean Gradient™ AI Platform lets you build fully-managed AI agents with knowledge bases for retrieval-augmented generation, multi-agent routing, guardrails, and more, or use serverless inference to make direct requests to popular foundation models.

You can create agents using the DigitalOcean API or CLI, control panel, or Agent Development Kit.

Create an Agent Using Automation

To create an agent with the DigitalOcean API or CLI, provide a name, a foundation model, instructions, the project identifier, and the datacenter region. We strongly recommend adding a knowledge base so your agent can ground its responses in your own domain data, reducing hallucinations and improving accuracy.

You can use the API or CLI to get available options for these parameters:

How to Create an Agent Using the DigitalOcean CLI
  1. Install doctl, the official DigitalOcean CLI.
  2. Create a personal access token and save it for use with doctl.
  3. Use the token to grant doctl access to your DigitalOcean account.
    doctl auth init
  4. Finally, run doctl genai agent create. Basic usage looks like this, but you can read the usage docs for more details:
    doctl genai agent create <agent-name>... [flags]
    The following example creates an agent:
    doctl genai agent create --name "My Agent" --project-id "12345678-1234-1234-1234-123456789012" --model-id "12345678-1234-1234-1234-123456789013" --region "tor1" --instruction "You are an agent who thinks deeply about the world"
How to Create an Agent Using the DigitalOcean API
  1. Create a personal access token and save it for use with the API.
  2. Send a POST request to https://api.digitalocean.com/v2/gen-ai/agents.

cURL

Using cURL:

curl -X POST \
    -H "Content-Type: application/json"  \
    -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
    "https://api.digitalocean.com/v2/gen-ai/agents" \
    -d '{
      "name": "api-create",
      "model_uuid": "95ea6652-75ed-11ef-bf8f-4e013e2ddde4",
      "instruction": "be a weather reporter",
      "description": "weather-agent",
      "project_id": "37455431-84bd-4fa2-94cf-e8486f8f8c5e",
      "tags": [
        "tag1"
      ],
      "region": "tor1",
      "knowledge_base_uuid": [
        "9758a232-b351-11ef-bf8f-4e013e2ddde4"
      ]
    }'

Create an Agent Using the Control Panel

You can create an agent with a custom configuration by defining the agent’s objective, model, and settings. You can add also a knowledge base.

To create an agent from the DigitalOcean Control Panel, in the left menu, click Agent Platform to go to the Agent Workspaces tab. Click the workspace where you want to create an agent. In the Agents tab, click Create Agent to open the Create an agent page, where you can choose a custom configuration.

Give Your Agent a Name

Choose a descriptive name in the Agent name field that reflects the agent’s role or expertise.

Define Agent Instructions

Provide clear instructions that define your agent’s identity, objectives, expertise, and boundaries. These instructions help the agent understand what role it plays, what tasks it should prioritize, and which resources it can use.

You are a travel agent. You help find airline tickets and car rentals, compare prices, schedules, and find the best deals.
You also suggest hotel, resort, or vacation rentals that cost less than $5,000 for a week.
Make sure that the recommendations you make are clear, actionable, and customized to the financial situation.

See Write Effective Agent Instructions for best practices. You can also use the agent instruction templates as-is or adapt them to your needs.

Select a Model

Agents use foundation models to interpret prompts and generate responses.

Choose a model provider from the Select a model provider drop-down list, and then from the Select model drop-down list, select the foundation model you want to use. To test models before choosing, use the Model Playground by clicking Model Playground.

Select model section showing a select a model provider sub-section, a drop-down menu for selecting a model from the provider with token pricing information and a link to add or use an API key.

OpenAI GPT-5 is the model selected by default. You can also choose models from other providers such as Anthropic Claude, Mistral Nemo, or Meta Llama, and change the foundation model at any time after creating the agent.

Bring Your Own Model Provider API Key

For commercial models like OpenAI or Anthropic Claude models, you can bring your own API key. We bill usage directly to your model account.

Click Add or use own key above the model dropdown to open the Use or Add API Key window. If your team already has keys, choose one from the Select key or add new key dropdown menu and click Verify and Save.

Use or Add OpenAI API Key window showing a drop-down menu with multiple saved API keys and an option to add a new key.

If you need to add a new key, select Add a new key. In the API key field, paste the key you copied from your OpenAI or Anthropic account. In Key name field, type a unique name without using the key itself. Names can include lowercase letters, numbers, hyphens, and periods. Then, click Verify and Save to validate the API key. After verification, we automatically select the API key in the dropdown.

Select or add a new key section showing a selected API key, and a select model sub-section with a model selected.

In the Model Keys page, you can view, add, edit, or delete model keys.

Choose a Workspace

Workspaces group related agents together under a single space to help you organize your AI agents, share them across your team, and run evaluations to test and compare their performance in a structured way. Every agent you create exists in a workspace. By default, you have one workspace called My Agent Workspace (Created by Default).

In the Where should your agent live? section, choose a workspace for your agent. You can select an existing workspace by clicking Use Existing and choosing one from the drop-down list, or create a new workspace by clicking Create New and providing the new workspace a name and description.

Add Knowledge Bases

A knowledge base is a mixture of unstructured text files in Spaces buckets and web pages. Knowledge bases provide context to the prompt for your agent’s foundation model. Your agent uses knowledge bases to augment prompts to the foundation model, answer questions, and analyze documents. Examples of knowledge bases include product documentation, pricing, and product catalogs.

We strongly recommend adding one or more knowledge bases when creating your agent to ground its responses in your data and improve accuracy, either by selecting an existing one from the Knowledge Bases drop-down list or creating a new one.

To keep your knowledge base up to date automatically, you can also enable auto-indexing.

Finalize and Create

By default, the new agent belongs to your default project. You can choose a different project from the Select a project drop-down list.

Optionally, you can tags your agents. Tags organize related resources. Tags must be single words with letters, numbers, colons, dashes, or underscores.

At the bottom of this section, review the chosen agent resources and model token rate.

Click Create Agent to complete creating the agent. Your agent appears in the Projects section of the control panel’s main menu.

Next Steps

After creating your agent, you can:

We can't find any results for your search.

Try using different keywords or simplifying your search terms.