Skip to main content

Prerequisites

  • A Tracia account (sign up)
  • Node.js 18 or later
  • An API key from a supported LLM provider (OpenAI, Anthropic, Google, Amazon Bedrock)

Step 1: Get Your 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_)
Store your API key securely. It provides full access to your Tracia account.

Step 2: Install the SDK

Step 3: Configure Your LLM Provider

  1. Go to Settings > Providers in the Tracia dashboard
  2. Add your OpenAI, Anthropic, Google, or Amazon Bedrock provider API key
  3. Tracia encrypts and stores your key securely

Step 4: Create Your First Prompt

  1. Go to Prompts in the dashboard
  2. Click New Prompt
  3. Enter a name (e.g., “Welcome Email”)
  4. Add your prompt messages:
  1. Click Save
Use {{variable}} syntax to create dynamic prompts. Variables are replaced at runtime.

Step 5: Run Your Prompt

Step 6: View Spans

After running your prompt:
  1. Go to Spans in the dashboard
  2. See the full execution details including:
    • Input/output content
    • Token usage and cost
    • Latency metrics
    • Variables used

Next Steps

Prompts SDK

Learn all prompt operations: list, get, create, update, delete

Error Handling

Handle errors gracefully in your application