Skip to main content
{
  "slug": "<string>",
  "agent": {}
}
Create a new AI agent with customizable LLM settings, system prompts, and knowledge base integration.

Examples

import requests

url = "https://labs.chonkie.ai/api/v1/agents"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

data = {
    "name": "Documentation Assistant",
    "description": "Helps users navigate product documentation",
    "model": "gpt-4o-mini",
    "systemPrompt": "You are a helpful documentation assistant. Answer questions clearly and concisely.",
    "temperature": 0.3,
    "maxContextChunks": 5,
    "useContext": True,
    "knowledge": "product-documentation"
}

response = requests.post(url, headers=headers, json=data)
result = response.json()

print(f"Created agent: {result['agent']['name']}")
print(f"Slug: {result['slug']}")

Request

Parameters

name
string
required
Agent name (3-100 characters).
description
string
Description of the agent’s purpose and capabilities.
model
string
default:"gpt-5-mini"
LLM model to use. We support OpenAI models.
systemPrompt
string
System prompt that defines the agent’s behavior and personality.
maxContextChunks
integer
default:"5"
Maximum number of knowledge base chunks to include in context.
useContext
boolean
default:"false"
Whether to inject knowledge base context into conversations.
knowledge
string
Knowledge base slug to use for context (required if useContext is true).

Response

Returns

slug
string
Unique slug for the agent (used in API calls).
agent
object
Complete agent configuration object.
Each agent object contains the following fields Basic Information
id
string
Unique agent identifier.
slug
string
URL-friendly unique identifier for the agent.
name
string
Display name of the agent.
description
string
Description of the agent’s purpose and capabilities.
status
string
Agent status (active, inactive, etc.).
Model Configuration
model
string
The LLM model used by the agent.
systemPrompt
string
System prompt that defines the agent’s behavior and personality.
temperature
float
Temperature setting for response randomness (0.0-2.0).
Knowledge Integration
useContext
boolean
Whether knowledge base context injection is enabled.
knowledge
string
Slug of the connected knowledge base (if any).
maxContextChunks
integer
Maximum number of knowledge base chunks to include in context.
Metadata
organizationSlug
string
Organization that owns this agent.
metadata
object
Additional custom metadata.
createdAt
string
Timestamp when the agent was created.
updatedAt
string
Timestamp when the agent was last updated.
I