curl -X POST https://app.tracia.io/api/v1/prompts \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Email",
"description": "A welcome email template",
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
]
}'
const prompt = await tracia.prompts.create({
name: 'Welcome Email',
description: 'A welcome email template',
content: [
{ id: 'msg_1', role: 'system', content: 'You are a helpful assistant.' },
{ id: 'msg_2', role: 'user', content: 'Write a welcome email for {{name}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Welcome Email",
"description": "A welcome email template",
"provider": null,
"model": null,
"temperature": null,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 1,
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
],
"variables": ["name"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
{
"code": "INVALID_REQUEST",
"message": "Missing required field: name"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Prompts
Create Prompt
Create a new prompt
POST
/
prompts
curl -X POST https://app.tracia.io/api/v1/prompts \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Email",
"description": "A welcome email template",
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
]
}'
const prompt = await tracia.prompts.create({
name: 'Welcome Email',
description: 'A welcome email template',
content: [
{ id: 'msg_1', role: 'system', content: 'You are a helpful assistant.' },
{ id: 'msg_2', role: 'user', content: 'Write a welcome email for {{name}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Welcome Email",
"description": "A welcome email template",
"provider": null,
"model": null,
"temperature": null,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 1,
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
],
"variables": ["name"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
{
"code": "INVALID_REQUEST",
"message": "Missing required field: name"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Request
string
required
Bearer token with your API key:
Bearer tr_your_api_keystring
required
Display name for the prompt
string
URL-friendly identifier. Auto-generated from name if not provided.
string
Description of the prompt
array
required
Array of prompt messages. Each message must have:
id(string): Unique identifierrole(string):system,user, orassistantcontent(string): Message content
Response
Returns the created prompt object.curl -X POST https://app.tracia.io/api/v1/prompts \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Email",
"description": "A welcome email template",
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
]
}'
const prompt = await tracia.prompts.create({
name: 'Welcome Email',
description: 'A welcome email template',
content: [
{ id: 'msg_1', role: 'system', content: 'You are a helpful assistant.' },
{ id: 'msg_2', role: 'user', content: 'Write a welcome email for {{name}}.' },
],
});
{
"id": "clx1abc123",
"slug": "welcome-email",
"name": "Welcome Email",
"description": "A welcome email template",
"provider": null,
"model": null,
"temperature": null,
"topP": null,
"maxOutputTokens": null,
"currentVersion": 1,
"content": [
{
"id": "msg_1",
"role": "system",
"content": "You are a helpful assistant."
},
{
"id": "msg_2",
"role": "user",
"content": "Write a welcome email for {{name}}."
}
],
"variables": ["name"],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
{
"code": "INVALID_REQUEST",
"message": "Missing required field: name"
}
{
"code": "CONFLICT",
"message": "A prompt with this slug already exists"
}
Authorizations
API key starting with tr_
Body
application/json
Response
Prompt created
Unique identifier for the prompt
URL-friendly identifier
Display name of the prompt
Description of the prompt
Model provider
Available options:
OPENAI, ANTHROPIC, GOOGLE, AMAZON_BEDROCK Default model for this prompt
Temperature setting for the model (0-2)
Top-p (nucleus) sampling setting (0-1)
Maximum output tokens limit
Current version number
Array of prompt messages
Show child attributes
Show child attributes
List of template variables extracted from content
ISO 8601 timestamp of creation
ISO 8601 timestamp of last update

