Skip to main content
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

  1. Log in to tracia.io
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Copy your key (starts with tr_)
Keep your API key secure. It provides full access to your Tracia account.

Request Format

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": [...]}'

Response Format

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

CodeHTTP StatusDescription
UNAUTHORIZED401Invalid or missing API key
NOT_FOUND404Resource not found
CONFLICT409Resource already exists
INVALID_REQUEST400Invalid request format
MISSING_VARIABLES400Missing required template variables
MISSING_PROVIDER_KEY400No LLM provider key configured
PROVIDER_ERROR500Error from the LLM provider

Endpoints

Prompts

MethodEndpointDescription
GET/promptsList all prompts
GET/prompts/:slugGet a prompt
POST/promptsCreate a prompt
PUT/prompts/:slugUpdate a prompt
DELETE/prompts/:slugDelete a prompt
POST/prompts/:slug/runRun 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' });