The easiest way to use Index in production is via the serverless API. Index API manages remote browser sessions, agent infrastructure and browser observability.
Getting Started
Installation
First, install the Laminar TypeScript SDK:
npm install @lmnr-ai/lmnr
Initialize Laminar with your project API key and create a client instance. You can also set the LMNR_PROJECT_API_KEY
environment variable instead of passing it directly.
import { Laminar, LaminarClient } from '@lmnr-ai/lmnr';
// Initialize Laminar with your project API key
Laminar.initialize({ projectApiKey: "YOUR_PROJECT_API_KEY" });
// Create a client instance
const client = new LaminarClient({
projectApiKey: "YOUR_PROJECT_API_KEY",
});
Installation
First, install the Laminar TypeScript SDK:
npm install @lmnr-ai/lmnr
Initialize Laminar with your project API key and create a client instance. You can also set the LMNR_PROJECT_API_KEY
environment variable instead of passing it directly.
import { Laminar, LaminarClient } from '@lmnr-ai/lmnr';
// Initialize Laminar with your project API key
Laminar.initialize({ projectApiKey: "YOUR_PROJECT_API_KEY" });
// Create a client instance
const client = new LaminarClient({
projectApiKey: "YOUR_PROJECT_API_KEY",
});
Installation
First, install the Laminar Python SDK with the required dependencies:
Initialize Laminar with your project API key and create a client instance. You can also set the LMNR_PROJECT_API_KEY
environment variable instead of passing it directly.
from lmnr import Laminar, LaminarClient
# Initialize Laminar with your project API key
Laminar.initialize(project_api_key="YOUR_PROJECT_API_KEY")
# Create a client instance
client = LaminarClient(project_api_key="YOUR_PROJECT_API_KEY")
Using Index Browser Agent
Basic Usage
To run a browser agent that performs tasks based on your prompt:
import { LaminarClient } from '@lmnr-ai/lmnr';
const client = new LaminarClient({
projectApiKey: "YOUR_PROJECT_API_KEY",
});
// Execute a browser agent task
async function runBrowserAgent() {
const response = await client.agent.run({
prompt: "Search for the latest news about AI, " +
"find the most recent article, and summarize it.",
modelProvider: "gemini",
model: "gemini-2.5-pro-preview-03-25",
});
// Print the final result
console.log(response.result.content);
}
runBrowserAgent();
Basic Usage
To run a browser agent that performs tasks based on your prompt:
import { LaminarClient } from '@lmnr-ai/lmnr';
const client = new LaminarClient({
projectApiKey: "YOUR_PROJECT_API_KEY",
});
// Execute a browser agent task
async function runBrowserAgent() {
const response = await client.agent.run({
prompt: "Search for the latest news about AI, " +
"find the most recent article, and summarize it.",
modelProvider: "gemini",
model: "gemini-2.5-pro-preview-03-25",
});
// Print the final result
console.log(response.result.content);
}
runBrowserAgent();
Basic Usage
To run a browser agent that performs tasks based on your prompt:
Synchronous
from lmnr import LaminarClient
client = LaminarClient(project_api_key="YOUR_PROJECT_API_KEY")
# Execute a browser agent task
response = client.agent.run(
prompt="Search for the latest news about AI, " +
"find the most recent article, and summarize it.",
model_provider="gemini",
model="gemini-2.5-pro-preview-03-25",
)
# Print the final result
print(response.result.content)
Asynchronous
import asyncio
from lmnr import AsyncLaminarClient
async def run_agent():
client = AsyncLaminarClient(project_api_key="YOUR_PROJECT_API_KEY")
# Execute a browser agent task asynchronously
response = await client.agent.run(
prompt="Search for the latest news about AI, " +
"find the most recent article, and summarize it.",
model_provider="gemini",
model="gemini-2.5-pro-preview-03-25",
)
print(response.result.content)
# Run the async function
asyncio.run(run_agent())
Next Steps