> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Java SDK

> Build Java voice apps with the Vobiz SDK - outbound calls, SIP trunks, CDR, and call recording across 130+ countries including India.

The official Java SDK for the Vobiz Voice API. Make calls, manage SIP trunks, handle CDR, record calls, configure phone numbers, and more - natively from your Java or JVM backend, with a fully typed builder API.

**Source code:** [vobiz-ai/Vobiz-Java-SDK](https://github.com/vobiz-ai/Vobiz-Java-SDK)

## Installation

Add the dependency once it is published to Maven Central (coordinates `ai.vobiz:vobiz-java`):

```groovy theme={null}
// Gradle
implementation 'ai.vobiz:vobiz-java:1.0.0'
```

```xml theme={null}
<!-- Maven -->
<dependency>
    <groupId>ai.vobiz</groupId>
    <artifactId>vobiz-java</artifactId>
    <version>1.0.0</version>
</dependency>
```

Or build from source:

```bash theme={null}
git clone https://github.com/vobiz-ai/Vobiz-Java-SDK.git
cd Vobiz-Java-SDK
gradle build
```

## Authentication

All API calls require your **Auth ID** and **Auth Token**, available in the [Vobiz Console](https://console.vobiz.ai). Pass your Auth ID to `.apiKey()` and your Auth Token to `.authToken()` - the SDK sends them as the `X-Auth-ID` and `X-Auth-Token` headers.

```java theme={null}
import com.vobiz.api.VobizApiClient;

VobizApiClient client = VobizApiClient
    .builder()
    .apiKey(System.getenv("VOBIZ_AUTH_ID"))
    .authToken(System.getenv("VOBIZ_AUTH_TOKEN"))
    .build();
```

## Quick start

Make an outbound call:

```java theme={null}
import com.vobiz.api.VobizApiClient;
import com.vobiz.api.resources.calls.requests.MakeCallRequest;

public class Example {
    public static void main(String[] args) {
        VobizApiClient client = VobizApiClient
            .builder()
            .apiKey(System.getenv("VOBIZ_AUTH_ID"))
            .authToken(System.getenv("VOBIZ_AUTH_TOKEN"))
            .build();

        client.calls().makeCall(
            "MA_XXXXXX",                       // your account Auth ID
            MakeCallRequest
                .builder()
                .from("14155551234")           // Vobiz-enabled number or SIP URI
                .to("+919876543210")           // destination in E.164 format
                .answerUrl("https://example.com/answer")  // webhook returning VobizXML
                .answerMethod("POST")
                .build()
        );
        System.out.println("Call initiated successfully!");
    }
}
```

## VobizXML

The SDK handles REST interactions only. When a call is answered, Vobiz fetches **VobizXML** from your `answerUrl` webhook to control the call:

```xml theme={null}
<Response>
  <Speak voice="WOMAN" language="en-US">Thank you for calling.</Speak>
</Response>
```

## Resources

* [GitHub repository](https://github.com/vobiz-ai/Vobiz-Java-SDK)
* [Vobiz Console](https://console.vobiz.ai)
* [API documentation](/introduction)
* [VobizXML reference](/xml/response)
