pydo.genai.create_agent()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.genai.create_agent(
body={
"anthropic_key_uuid": "\"12345678-1234-1234-1234-123456789012\"",
"description": "\"My Agent Description\"",
"instruction": "\"You are an agent who thinks deeply about the world\"",
...,
},
)Description
To create a new agent, send a POST request to /v2/gen-ai/agents. The response body contains a JSON object with the newly created agent object.
Parameters
anthropic_key_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"Optional Anthropic API key ID to use with Anthropic models
descriptionstring optionalExample:
"My Agent Description"A text description of the agent, not used in inference
instructionstring optionalExample:
"You are an agent who thinks deeply about the world"Agent instruction. Instructions help your agent to perform its job effectively. See Write Effective Agent Instructions for best practices.
knowledge_base_uuidarray of strings optionalExample:
['example string']Ids of the knowledge base(s) to attach to the agent
mcp_serversarray of objects optionalMCP (Model Context Protocol) servers to attach to the agent
Show child properties
allowed_toolsarray of strings optionalExample:
['example string']Optional list of allowed tool names to expose from this server
authorizationstring optionalExample:
example stringOptional authorization header value for the MCP server
headersobject optionalOptional additional headers to send to the MCP server
server_labelstring optionalExample:
example stringA label identifying this MCP server
server_urlstring optionalExample:
example stringThe URL of the MCP server
model_provider_key_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"model_router_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"model_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"Identifier for the foundation model.
namestring optionalExample:
"My Agent"Agent name
open_ai_key_uuidstring optionalExample:
"12345678-1234-1234-1234-123456789012"Optional OpenAI API key ID to use with OpenAI models
project_idstring optionalExample:
"12345678-1234-1234-1234-123456789012"The id of the DigitalOcean project this agent will belong to
reasoning_effortstring optionalExample:
"low"regionstring optionalExample:
"tor1"The DigitalOcean region to deploy your agent in
router_preset_slugstring optionalExample:
"general"tagsarray of strings optionalExample:
['example string']Agent tag to organize related resources
thinking_token_budgetinteger optionalExample:
123web_fetch_enabledboolean optionalExample:
TrueWhether the agent can use the built-in web_fetch tool to retrieve content from public web pages.
web_search_enabledboolean optionalExample:
TrueWhether the agent can use the built-in web_search tool to search the public web for current information.
workspace_uuidstring optionalExample:
123e4567-e89b-12d3-a456-426614174000Identifier for the workspace
Request Sample
Response Example
More Information
See /v2/gen-ai/agents in the API reference for additional detail on responses, headers, parameters, and more.