---
updatedAt: 2026-04-16T10:33:54.000Z
agentTools:
  projectIndex: https://developers.laratranslate.com/llms.txt
---

# Initialization Guide

The Translator class is the core component of the Lara SDK

The Translator class serves as the primary interface for all translation services, including text, document, audio and image processing. To use any Lara feature, you must first initialize this class with your authentication credentials.

## Authentication

Before instantiating the class, you need your `LARA_ACCESS_KEY_ID` and `LARA_ACCESS_KEY_SECRET`, which can be generated in the <Anchor label="API Credentials section" target="_blank" href="https://app.laratranslate.com/account/credentials">API Credentials section</Anchor> of your Lara Account

## Initialization

The SDK is designed to be idiomatic across different programming languages. Below are the standard initialization patterns for our supported environments:

```python
from lara_sdk import Translator, Credentials

LARA_ACCESS_KEY_ID = "your-access-key-id"
LARA_ACCESS_KEY_SECRET = "your-access-key-secret"

# Initialization of the Translator class
credentials = Credentials(access_key_id=LARA_ACCESS_KEY_ID, access_key_secret=LARA_ACCESS_KEY_SECRET)
lara = Translator(credentials)
```
```typescript
import {Credentials, Translator} from "@translated/lara";

const LARA_ACCESS_KEY_ID: string = "your-access-key-id";
const LARA_ACCESS_KEY_SECRET: string = "your-access-key-secret";

// Initialization of the Translator class
const credentials = new Credentials(LARA_ACCESS_KEY_ID, LARA_ACCESS_KEY_SECRET)
const lara: Translator = new Translator(credentials);
```
```java
import com.translated.lara.Credentials;
import com.translated.lara.translator.Translator;

private static final String LARA_ACCESS_KEY_ID = "your-access-key-id";
private static final String LARA_ACCESS_KEY_SECRET = "your-access-key-secret";

// Initialization of the Translator class
Credentials credentials = new Credentials(LARA_ACCESS_KEY_ID, LARA_ACCESS_KEY_SECRET);
Translator lara = new Translator(credentials);
```
```php
<?php

require 'vendor/autoload.php';

use Lara\Translator;
use Lara\LaraCredentials;

$LARA_ACCESS_KEY_ID = "your-access-key-id";
$LARA_ACCESS_KEY_SECRET = "your-access-key-secret";

// Initialization of the Translator class
$credentials = new LaraCredentials($LARA_ACCESS_KEY_ID, $LARA_ACCESS_KEY_SECRET);
$lara = new Translator($credentials);
```
```go
import (
	lara_sdk "github.com/translated/lara-go/lara"  // alias "lara_sdk", can be changed or removed
)

const (
	LARA_ACCESS_KEY_ID     = "your-access-key-id"
	LARA_ACCESS_KEY_SECRET = "your-access-key-secret"
)

credentials := lara_sdk.NewCredentials(LARA_ACCESS_KEY_ID, LARA_ACCESS_KEY_SECRET)
lara := lara_sdk.NewTranslator(credentials, nil)

```
```kotlin
import com.translated.lara.Credentials
import com.translated.lara.translator.Translator

private const val LARA_ACCESS_KEY_ID = "your-access-key-id"
private const val LARA_ACCESS_KEY_SECRET = "your-access-key-secret"

// Initialization of the Translator class
val credentials = Credentials(LARA_ACCESS_KEY_ID, LARA_ACCESS_KEY_SECRET)
val lara = Translator(credentials)
```
```csharp
string accessKeyId = "your-access-key-id";
string accessKeySecret = "your-access-key-secret";

var credentials = new Credentials(accessKeyId, accessKeySecret);
var lara = new Translator(credentials);
```
```swift
let LARA_ACCESS_KEY_ID = "your-access-key-id"
let LARA_ACCESS_KEY_SECRET = "your-access-key-secret"

// Initialization of the Translator class
let credentials = Credentials(accessKeyId: LARA_ACCESS_KEY_ID, accessKeySecret: LARA_ACCESS_KEY_SECRET)
let lara = Translator(credentials: credentials)
```

<br />

**Pro Tip**: We recommend instantiating the Translator class once and reusing the instance across your application to optimize performance and connection handling.

## Next Step

Once initialized, the Lara instance provides access to a suite of specialized namespaces:

* `.text`: For high-speed, context-aware text translations. [Explore Text Translation → ](https://developers.laratranslate.com/docs/translate-text)
* `.documents`: For processing complex file formats. [Preserve layouts with Document Translation →](https://developers.laratranslate.com/docs/translate-document)
* `.images`: For translating text within images using various fidelity levels. [Translate your first Image →](https://developers.laratranslate.com/docs/translate-image)
* `.audio`: For translate your audio files from one language to another. [Start translating Audio files →](https://developers.laratranslate.com/docs/translate-audio)