Get Started
Async Logging
Testing
Metadata
Workflows
Datasets
Caching
Playground
Bot Evaluation
Prompts
Guardrails
Custom Errors
Custom LLM Tracing
CLI
API Keys
Setting API Key In Code
How to set your API Key in your code directly
This is not reccomended but you can explicilty set the API key in your code.
In Javascript:
Copy
import { LytixCreds, MetricCollector } from "@lytix/client";
/**
* First set the API key
*/
LytixCreds.setAPIKey("sk-1234");
/**
* Then you can use Lytix normally
*/
await MetricCollector.increment("testMetric");
In Python:
Copy
from lytix_py import MetricCollector, LytixCreds
"""
First set the API key
"""
LytixCreds.setAPIKey("sk-1234")
"""
Then you can use Lytix normally
"""
MetricCollector.increment("testMetric");
Assistant
Responses are generated using AI and may contain mistakes.