#Quick Start
This guide will help you integrate the Creatoria Agent API in 5 minutes.
#Prerequisites
- A Creatoria platform account
- A valid API Key
- At least one Project
#Step 1: Obtain an API Key
After logging in to the Creatoria platform, go to Settings > API Keys to create a new API Key.
The API Key is only displayed once upon creation. Please save it securely.
#Step 2: Send Your First Request
Use the API Key to list all your Agents:
bashcurl -X GET "https://your-domain.com/v1/agents" \
-H "X-API-Key: sk_your_api_key_here" \
-H "X-Project-Id: your-project-id"
Successful response:
json{
"data": [
{
"id": "agent_abc123",
"name": "Customer Service Assistant",
"model": "zhipu/glm-4",
"status": "active",
"createdAt": "2026-01-15T08:00:00Z"
}
],
"meta": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}
#Step 3: Create an Agent
bashcurl -X POST "https://your-domain.com/v1/agents" \
-H "X-API-Key: sk_your_api_key_here" \
-H "X-Project-Id: your-project-id" \
-H "Content-Type: application/json" \
-d '{
"name": "My Assistant",
"systemPrompt": "You are a friendly AI assistant.",
"model": "zhipu/glm-4"
}'
#Step 4: Chat with an Agent
#Non-Streaming Chat
bashcurl -X POST "https://your-domain.com/v1/agents/agent_abc123/chat" \
-H "X-API-Key: sk_your_api_key_here" \
-H "X-Project-Id: your-project-id" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, please introduce yourself",
"stream": false
}'
#Streaming Chat
bashcurl -X POST "https://your-domain.com/v1/agents/agent_abc123/chat" \
-H "X-API-Key: sk_your_api_key_here" \
-H "X-Project-Id: your-project-id" \
-H "Content-Type: application/json" \
-d '{
"message": "Hello, please introduce yourself",
"stream": true
}'
Streaming responses use the SSE (Server-Sent Events) format:
data: {"sessionId":"sess_xxx","delta":{"content":"Hello"}}
data: {"sessionId":"sess_xxx","delta":{"content":"! I am"}}
data: {"sessionId":"sess_xxx","done":true,"usage":{"inputTokens":50,"outputTokens":30,"totalTokens":80}}
data: [DONE]
#Step 5: Manage Chat History
The system automatically creates a session for each new conversation. Use the same sessionId to continue the conversation in subsequent messages:
bashcurl -X POST "https://your-domain.com/v1/agents/agent_abc123/chat" \
-H "X-API-Key: sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_xxx",
"message": "Please continue the previous topic",
"stream": true
}'
#Next Steps
- Learn about the detailed Authentication and Permissions mechanism
- View the complete endpoint list for the Agents API
- Explore the advanced features of Agentic Streaming