Quickstart
This guide will get you from zero to traced AI calls in under 5 minutes.Prerequisites
- A Foil account (sign up here)
- An API key from the Foil dashboard
- Node.js 18+ or Python 3.8+
Step 1: Install the SDK
- JavaScript
- Python
Step 2: Initialize the Client
- JavaScript
- Python
Step 3: Trace Your First Call
- JavaScript
- Python
Step 4: View Your Trace
- Go to the Foil Dashboard
- Navigate to Traces
- Click on your trace to see the full span details
- The input and output of your LLM call
- Token usage breakdown
- Latency metrics
- Any errors or warnings
What’s Next?
Auto-Instrument OpenAI
Use our OpenAI wrapper for zero-code instrumentation
Add Tool Calls
Track tool executions within your traces
Set Up Alerts
Get notified when issues occur
Record Feedback
Capture user feedback on your AI outputs
Using the OpenAI Wrapper (Easier!)
For the simplest setup, use our OpenAI wrapper which automatically traces all calls:- JavaScript
- Python