The Tracia API is a RESTful API that allows you to manage prompts and run them programmatically.
Base URL
https://app.tracia.io/api/v1
Authentication
All API requests require authentication using a Bearer token. Include your API key in the Authorization header:
Authorization: Bearer tr_your_api_key
Getting an API Key
- Log in to tracia.io
- Navigate to Settings > API Keys
- Click Create API Key
- Copy your key (starts with
tr_)
Keep your API key secure. It provides full access to your Tracia account.
All request bodies should be JSON with the Content-Type: application/json header.
curl -X POST https://app.tracia.io/api/v1/prompts \
-H "Authorization: Bearer tr_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "My Prompt", "content": [...]}'
All responses are JSON. Successful responses return the requested data:
{
"id": "abc123",
"slug": "my-prompt",
"name": "My Prompt",
...
}
Error Responses
Error responses include a code and message:
{
"code": "NOT_FOUND",
"message": "Prompt not found: my-prompt"
}
Error Codes
| Code | HTTP Status | Description |
|---|
UNAUTHORIZED | 401 | Invalid or missing API key |
NOT_FOUND | 404 | Resource not found |
CONFLICT | 409 | Resource already exists |
INVALID_REQUEST | 400 | Invalid request format |
MISSING_VARIABLES | 400 | Missing required template variables |
MISSING_PROVIDER_KEY | 400 | No LLM provider key configured |
PROVIDER_ERROR | 500 | Error from the LLM provider |
Endpoints
Prompts
| Method | Endpoint | Description |
|---|
GET | /prompts | List all prompts |
GET | /prompts/:slug | Get a prompt |
POST | /prompts | Create a prompt |
PUT | /prompts/:slug | Update a prompt |
DELETE | /prompts/:slug | Delete a prompt |
POST | /prompts/:slug/run | Run a prompt |
Rate Limits
The API has rate limits to ensure fair usage. If you exceed the rate limit, you’ll receive a 429 Too Many Requests response.
SDK
We recommend using the official TypeScript SDK for easier integration:
import { Tracia } from 'tracia';
const tracia = new Tracia({ apiKey: process.env.TRACIA_API_KEY });
const result = await tracia.prompts.run('welcome-email', { name: 'Alice' });