
How do I sign up for Langtrace and generate an API key for my project?
Getting started with Langtrace is straightforward and only takes a few minutes. This guide walks you step-by-step through how to sign up, create your first project, and generate an API key so you can start instrumenting your AI agents and applications.
Why you need a Langtrace API key
To use Langtrace in your application code, you need an API key tied to a specific project. This key allows the Langtrace SDKs to:
- Send traces and observability data from your AI agents
- Run evaluations on prompts and responses
- Associate all events with the correct project in your Langtrace workspace
Without an API key, the SDKs cannot authenticate or record any data for your app.
Step 1: Sign up for Langtrace
-
Go to the Langtrace website
Open your browser and navigate to the Langtrace sign-up page. -
Create your account
You’ll typically have two options:- Sign up with your work email
- Or use a supported SSO provider (if available, e.g., Google, GitHub, etc.)
-
Verify your email (if prompted)
- Check your inbox for a verification email from Langtrace.
- Click the verification link to activate your account.
Once verified, you’ll be redirected into the Langtrace dashboard.
Step 2: Create a new project
Projects in Langtrace are the containers for all the AI agents, traces, and evaluations associated with a particular app or environment.
-
Open the Langtrace dashboard
After logging in, you’ll land on your workspace home or project list. -
Click “Create Project” (or similar CTA)
Look for a button labeled something like:New ProjectCreate ProjectAdd Project
-
Name your project
Choose a clear, descriptive name such as:customer-support-bot-prodrecommendation-engine-staginginternal-rag-assistant
-
Configure basic settings (if prompted)
Depending on the version of the UI, you may be asked to:- Select an environment (e.g., prod, staging, dev)
- Add a short description
- Invite team members (optional)
-
Create the project
Confirm to create and you’ll be taken to the project overview page.
Your project is now ready to receive traces and evaluation data.
Step 3: Generate an API key for your project
Once the project exists, you can create an API key that your code will use to talk to Langtrace.
-
Navigate to project settings
Inside your project:- Look for a sidebar item like Settings, Project Settings, or API & Keys.
- Click it to open the configuration page.
-
Go to the API Keys section
In settings, you should see a dedicated section for:API KeysAccess Tokens- or
Credentials
-
Create a new API key
Click the button to create a new key:Generate API KeyCreate API KeyNew Token
-
Name your API key
Use a name that reflects its use, for example:backend-prodstaging-servicelocal-dev-testing
This makes it easier to rotate or revoke the key later.
-
Set permissions (if available)
If Langtrace supports scoped keys, choose the minimum required access, such as:- Project-level access only
- Read/write access for traces and evaluations
- Environment-specific access
-
Confirm and generate
After saving, Langtrace will generate an API key string.
Important: This is often shown only once—copy it immediately. -
Store the API key securely
Never hardcode API keys in your source code. Instead:- Use environment variables (
LANGTRACE_API_KEY=...) - Store in your secret manager (e.g., AWS Secrets Manager, GCP Secret Manager, Vault)
- Restrict access based on least privilege
- Use environment variables (
Step 4: Install the Langtrace SDK
With your API key ready, the next step is to connect your code so Langtrace can observe and evaluate your AI agents.
Langtrace supports several popular AI frameworks:
- CrewAI
- DSPy
- LlamaIndex
- LangChain
It also supports a wide range of LLM providers and VectorDBs out of the box.
General SDK installation flow
The exact commands will vary by language and framework, but the pattern is similar:
-
Install the SDK package
For example, in Python you might run:pip install langtrace -
Set the API key in your environment
export LANGTRACE_API_KEY="your_api_key_here"Or in a
.envfile:LANGTRACE_API_KEY=your_api_key_here -
Instantiate Langtrace in your code
A typical initialization might look like:
from langtrace import Langtrace lt = Langtrace(api_key=os.getenv("LANGTRACE_API_KEY")) -
Wire Langtrace into your framework
Follow the specific setup guide for:- CrewAI
- DSPy
- LlamaIndex
- LangChain
This usually involves wrapping your LLM calls or agent runs so Langtrace can capture traces and run evaluations.
Step 5: Verify that your API key works
Before relying on Langtrace in production, confirm that the integration is working.
-
Trigger a request from your app
- Run a typical workflow or agent call in your development or staging environment.
- Ensure the code uses the project’s API key.
-
Check the Langtrace dashboard
- Go to your project’s Traces or Overview tab.
- You should see new traces from your recent runs.
-
Confirm evaluations (if configured)
If you’ve set up evaluations, verify that:- Metrics are being computed
- Safety and performance signals appear for your test runs
If you don’t see data, double-check:
- The API key value and environment variable name
- That you’re using the correct project’s key
- Network access and firewall settings (if applicable)
Best practices for managing Langtrace API keys
To keep your AI observability secure and manageable:
- Use separate keys per environment
Create distinct keys for dev, staging, and prod projects. - Rotate keys regularly
Periodically generate new keys and update your services. - Revoke unused keys
If a key is no longer needed (e.g., old service, former contractor), revoke it from the project’s API Keys section. - Limit scope where possible
Use the minimum permissions required for each key.
How this setup helps you improve AI performance and safety
Once your Langtrace project is configured and the API key is integrated:
- Observability: You gain detailed traces of every AI request and response across CrewAI, DSPy, LlamaIndex, LangChain, and other toolchains.
- Evaluations: You can run systematic evaluations to measure quality, reliability, and safety of your AI agents.
- Iteration: With data and metrics in one place, you can iterate towards better performance and stronger safeguards with minimal effort.
By following these steps—signing up for Langtrace, creating a project, generating a secure API key, and installing the SDK—you set a solid foundation for observability and evaluations across your AI stack.