Create a new AI agent with custom configuration.
This endpoint creates a new agent that can be customized with specific instructions, demonstrations, and model parameters.
Request Body:
agent_name: Name of the agent (will be normalized to URL-friendly format)agent_description: Description of the agent’s purposemodel: Model ID (base model or organization’s aligned model)max_token: Maximum tokens for agent responsestemperature: Sampling temperature for response generation (0.0-1.0)instructions: System prompt/instructions (defaults to “You are a helpful AI assistant.”)demonstrations (optional): List of example interactions for few-shot learningReturns:
data: Agent data object with the following fields:
id: Unique agent identifiername: Normalized agent name (lowercase with underscores)description: Agent descriptionbase_model: Model ID used by the agentbase_model_name: Human-readable model namecreated_date: ISO 8601 timestamp of creationstatus: Agent status (e.g., “Active”)creator: Username/email of the agent creatorendpoint: Full API endpoint URL for running the agentusage_count: Initial count (0)last_used: Last usage timestamp (null for new agents)performance_metrics: Performance statisticssystem_prompt: Agent instructionsuncertainty_threshold: Temperature setting for response generationconversation_saving_enabled: Whether conversations are savedErrors:
400: Requested model is not available to the user’s organization401: User is not found or unauthorizedExample Request:
POST /api/v3/agents/create
Headers: {"Authorization": "Bearer <api_key>"}
{
"agent_name": "Customer Support Bot",
"agent_description": "Handles customer inquiries with empathy",
"model": "nugen-flash-instruct",
"max_token": 2000,
"temperature": 0.7,
"instructions": "You are a helpful customer support agent. Be empathetic and solution-oriented.",
"demonstrations": [
{
"input": "How do I reset my password?",
"output": "I'd be happy to help you reset your password..."
}
]
}
Example Response:
{
"data": {
"id": "agent-abc123",
"name": "customer_support_bot",
"description": "Handles customer inquiries with empathy",
"base_model": "nugen-flash-instruct",
"base_model_name": "Nugen Flash Instruct",
"created_date": "2024-01-15T10:30:00Z",
"status": "Active",
"creator": "user@example.com",
"endpoint": "https://api.nugen.in/api/v3/agents/run-agents/customer_support_bot/run",
"usage_count": 0,
"last_used": null,
"performance_metrics": {
"total_requests": 0,
"average_response_time": 0,
"success_rate": 0
},
"system_prompt": "You are a helpful customer support agent. Be empathetic and solution-oriented.",
"uncertainty_threshold": 0.7,
"conversation_saving_enabled": false
}
}
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Name of the agent
"Customer Support Agent"
Description of the agent
"An agent designed to handle customer support queries"
Base model identifier
"nugen-flash-instruct"
Max tokens for inference request
1000
Temperature for model responses
0.7
System prompt for the agent
"You are a helpful customer support assistant."
Training demonstrations
Returns the details of the newly created agent including its unique identifier, configuration, usage statistics, and endpoint URL for execution
Response model for agent creation endpoint.