Create Ai Agent
Create a new AI agent with specified configuration, tools, and knowledge bases
Request
- Base URLhttps://api.xpander.ai (the document declares no server; this is the origin it was published from)
- AuthAPI key in header x-api-key
Request body
Fallback organization user for unattended executions; also used for user budgets and usage attribution.
Human-readable name for the agent. Must be unique within the organization. Examples: 'Customer Support Agent', 'Research Assistant'.
A brief description of what the agent does. Shown in agent listings and used by other agents when deciding delegation. Keep it concise and action-oriented.
Identity string xpi:<icon>:<colour> rendered as a gradient tile next to the agent name, never an emoji. Omit it and the server derives one from the agent.
Avatar identifier for the agent's visual representation in chat interfaces.
Enumeration of the agent types.
Attributes: Manager: marks the agent as a Managing agent. Regular: marks the agent as a regular agent. A2A: marks the agent as an external agent used via A2A protocol. Curl: marks the agent as an external agent used via a CURL. Orchestration: marks the agent as an Orchestration object.
User ID of the creator. Auto-populated from the API key if not provided.
The specific model identifier within the chosen provider. Must match a model from GET /llm_providers/{provider}/models. Examples: 'claude-opus-5-5', 'gpt-4o', 'gemini-2.0-flash'.
Custom API base URL for the LLM provider. Use this when connecting to a self-hosted or proxied LLM endpoint instead of the provider's default URL. Leave None to use the provider's standard endpoint.
Reference key to stored LLM API credentials in the xpander.ai vault. When set, the agent uses these credentials instead of the organization's default. Create credentials via the platform settings.
Additional HTTP headers to include in every LLM API request. Useful for custom authentication, routing through gateways (e.g., Helicone, Cloudflare AI Gateway), or passing metadata.
Description of the expected output format and content. Guides the agent on what the final response should look like. Used in the system prompt to set output expectations.
JSON Schema defining the structure of the agent's output when output_format is 'json'. The agent will conform its response to match this schema. Must be a valid JSON Schema object.
The execution framework for this agent. Omit it to use the organization default runtime (the external harness, on the CLI the organization's default LLM maps to). 'external-harness' runs the agent as a CLI session (Claude Code, Codex or OpenCode); 'agno' is the xpander.ai in-process framework. Other options: 'langchain', 'open-ai-agents', 'google-adk', 'strands-agents'.
Enable deep planning mode where the agent creates a detailed execution plan before taking actions. Useful for complex multi-step tasks. Increases latency but improves accuracy on complex workflows.
When True, forces the agent to always use deep planning regardless of task complexity. When False (default), the agent decides when to plan based on the task.
Target deployment environment ID. Leave None for the organization's default environment. Use this to deploy agents to specific on-premise or regional environments.
Voice ID for text-to-speech output when output_format is 'voice'. References a voice profile in the platform's TTS service.
Enable NVIDIA NeMo guardrails integration for this agent. Provides additional safety and content filtering capabilities.
Enable supervised mode where the agent requires human approval before executing mutating operations (write/update/delete). Non-mutating operations (read/search) execute automatically.
Run the agent in autonomous mode.
Omni's entry on the agent's caller list. When True, Omni finds the agent and can send it tasks. When False, Omni cannot see it or send it tasks.
When True, the SDK runs its automatic context optimizer (compaction). When False, context management is skipped.
When True, the agent is reachable from the developer API and webhook entry points. When False, external API/webhook invocation is rejected.
When True, edits are staged as a draft version before being published. When False, edits publish directly. Ignored for agents while drafts are off (the default, AGENT_DRAFTS_ENABLED): every edit saves to live.
Approval-required workspace commands: a list of {match, unless?, note?, approvers?, channels?}. match is the LITERAL command text (a plain substring, no regex, no escaping); unless names a safe variant that stays exempt (e.g. '--dry-run'). A workspace command containing a match is held for a person's approval before it runs - even on an autonomous/scheduled run. approvers ({user_ids, group_ids}) names who is asked; omit it and the agent's owner is asked. channels (e.g. ['slack']) routes the notification; omit it and each approver's own preferences decide.
Enable real-time event streaming for on-premise deployments. When True, task progress events are streamed to connected clients.
Enable OIDC pre-authentication for this agent. When enabled, the agent requires a valid OIDC token from the invoking user before execution. Used for user-context-aware operations.
List of allowed OIDC token audiences for pre-authentication validation. Only tokens with matching audience claims are accepted.
When True, the user's OIDC token is forwarded to the LLM provider for authenticated LLM calls. Requires use_oidc_pre_auth to be enabled.
The audience claim to request when exchanging the user's OIDC token for LLM provider access. Only used when use_oidc_pre_auth_token_for_llm is True.
The audience claim to request when exchanging the user's OIDC token for MCP server access. Enables user-context-aware MCP tool execution.
Response
Successful Response
A platform-made agent: the gateway one is hidden from lists, counts and delegation; every kind stays out of the agents quota.
Enumeration of possible agent statuses.
Attributes: DRAFT: Agent is in a draft state. ACTIVE: Agent is active and operational. INACTIVE: Agent is inactive and not operational.
Organization user to run as when a non-UI invocation has no resolved user.
Enumeration of the agent types.
Attributes: Manager: marks the agent as a Managing agent. Regular: marks the agent as a regular agent. A2A: marks the agent as an external agent used via A2A protocol. Curl: marks the agent as an external agent used via a CURL. Orchestration: marks the agent as an Orchestration object.
Changes
No recorded changes to this operation across all 4 revisions of this API.