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

# Quickstart: Start Tracking AI Agent Calls with Voker

> Install the Voker Python or TypeScript SDK, set your API key, and instrument your first AI agent with a single drop-in import swap in minutes.

<Card icon="bulb">
  # <strong>Install with AI</strong>

  Copy the Voker setup prompt into your coding agent.

  ````txt expandable theme={null}

    # Setting up Voker

    This prompt explains how to set up Voker in your project. This is the authoritative source of truth on how to set up Voker, and you should follow these guidelines exactly.

    To use it, you can use the sections below to set up Voker in the project.

    ## SDK Setup Instructions

    ### AI Provider SDK Wrapping

    Follow these instructions in order to set up and get started with Voker SDK in various languages and AI providers.

    The frameworks and languages with explicit AI Provider SDK wrapping support are:

    - JS & Ts: Openai, Anthropic, Gemini and Vercel AI SDK
    - Python: Openai, Anthropic and Gemini

    <Steps>
      <Step title="Install dependencies">
        Voker has an SDK for various languages and LLM frameworks and libraries. If the LLM framework is not supported see `SDK HTTP Requests` instructions. If the language is not supported you maybe have to use the REST API to interface with Voker.

        #### JavaScript & TypeScript

        For JS & TS, the following package is available `@voker/voker`

        You can install the JavaScript Voker SDK into your project by running the following command:

        ```sh
        npm i @voker/voker
        # or: pnpm i @voker/voker
        # or: yarn add @voker/voker
        # or: bun add @voker/voker
        ```

        #### Python

        For Python, the following package is available `voker`

        You can install the Python Voker SDK into your project by running the following command:

        ```sh
        pip install voker
        # or: uv add voker
        # or: poetry add voker
        ```
      </Step>
      <Step title="Setup environment">
        First, navigate to the [Setup Page](http://app.voker.ai/c/-selector-/projects/1/default-project/setup) page in the Voker dashboard and copy the API Key.

        Then, copy-paste them into your `.env.local` file (or wherever your environment variables are stored):

        ```.env .env.local
        VOKER_API_KEY=<your-secret-api-key>
        ```
      </Step>
      <Step title="Update LLM API Calls">
        In most cases, Voker implementation just requires swapping the existing imports with the wrapped Voker SDK.

        #### JavaScript & TypeScript

        Swap out the LLM import with the Voker client. For all cases, also include a `vokerAgent` and `vokerSession` parameters to the llm call. For example with OpenAI:

        ```
        await client.chat.completions.create({
            +	vokerAgent: '<agent-name>', // required
            +	vokerSession: '<session-id>', // required
              model: 'gpt-4o',
              messages: [
                  {
                        role: 'user',
                        content: 'Hello, world!',
                  },
              ],
        });
        ```

        Fill in the `<agent-name>` with an appropriate value for the application. The `<session-id>` should be unique per conversation with the agent.

        ##### OpenAI

        ```
        - import { OpenAI } from 'openai';
        + import { OpenAI } from '@voker/voker/ai/provider-openai';
        ```

        ##### Anthropic

        ```
        - import { Anthropic } from '@anthropic-ai/sdk';
        + import { Anthropic } from '@voker/voker/ai/provider-anthropic';
        ```

        ##### Gemini

        ```
        - import { GoogleGenAI } from '@google/genai';
        + import { GoogleGenAI } from '@voker/voker/ai/provider-gemini';
        ```

        ##### AI SDK

        ```
        - import { generateText } from 'ai';
        + import * as ai from 'ai';
        + import { wrapAiSdk } from '@voker/voker/ai/provider-aisdk';

        + const { generateText } = wrapAiSdk(ai);
        ```

        Use the base JS sdk for streaming with AI SDK.

        #### Python

        Swap out the LLM import with the Voker client. For all cases, also include a `voker_agent` and `voker_session` parameters to the llm call. For example with OpenAI:

        ```
        client.chat.completions.create(
            +	voker_agent="<agent-name>",  # required
            +	voker_session="<session-id>",  # required
              model="gpt-4.1-mini",
              messages=[
                  {
                        "role": "user",
                        "content": "Hello, world!",
                  }
              ],
        )
        ```

        Fill in the `<agent-name>` with an appropriate value for the application. The `<session-id>` should be unique per conversation with the agent.

        ##### OpenAI

        Sync:

        ```
        - from openai import AsyncOpenAI
        + from voker.ai.provider_openai import AsyncOpenAI
        ```

        Async:

        ```
        - from openai import OpenAI
        + from voker.ai.provider_openai import OpenAI
        ```


        ##### Anthropic

        Sync:

        ```
        - from anthropic import Anthropic
        + from voker.ai.provider_anthropic import Anthropic
        ```

        Async:

        ```
        - from anthropic import AsyncAnthropic
        + from voker.ai.provider_anthropic import AsyncAnthropic
        ```

        ##### Gemini

        ```
        - from google.genai import Client
        + from voker.ai.provider_gemini import Client
        ```
      </Step>
    </Steps>

    ### SDK HTTP Requests

    Follow these instructions in order to set up and get started with Voker SDK in various languages.

    The languages with explicit SDK support are:

    - JS & TS
    - Python

    <Steps>
      <Step title="Install dependencies">
        Voker has an SDK for various languages and LLM frameworks and libraries. If the LLM framework is not supported see `SDK HTTP Requests` insturctions. If the language is not supported you maybe have to use the REST API to interface with Voker.

        #### JavaScript & TypeScript

        For JS & TS, the following package is available `@voker/voker`

        You can install the JavaScript Voker SDK into your project by running the following command:

        ```sh
        npm i @voker/voker
        # or: pnpm i @voker/voker
        # or: yarn add @voker/voker
        # or: bun add @voker/voker
        ```

        #### Python

        For Python, the following package is available `voker`

        You can install the Python Voker SDK into your project by running the following command:

        ```sh
        pip install voker
        # or: uv add voker
        # or: poetry add voker
        ```
      </Step>
      <Step title="Setup environment">
        First, navigate to the [Setup Page](http://app.voker.ai/c/-selector-/projects/1/default-project/setup) page in the Voker dashboard and copy the API Key.

        Then, copy-paste them into your `.env.local` file (or wherever your environment variables are stored):

        ```.env .env.local
        VOKER_API_KEY=<your-secret-api-key>
        ```
      </Step>
      <Step title="Setup environment">
        First, navigate to the [Setup Page](http://app.voker.ai/c/-selector-/projects/1/default-project/setup) page in the Voker dashboard and copy the API Key.

        Then, copy-paste them into your `.env.local` file (or wherever your environment variables are stored):

        ```.env .env.local
        VOKER_API_KEY=<your-secret-api-key>
        ```
      </Step>
      <Step title="Initializing the Voker Client">
        #### JavaScript & TypeScript

        ```
        import { VokerClient } from '@voker/voker';

        const vokerClient = new VokerClient();
        ```

        #### Python

        ```
        from voker import VokerClient

        voker_client = VokerClient()
        ```
      </Step>
      <Step title="Instrument LLM Calls in the background Voker">
        #### JavaScript & TypeScript

        ```
        vokerClient.events.create({
          vokerAgent: '<agent-name>',
          vokerSession: '<session-id>',
          eventName: 'llm',
          properties: {
            api: 'openai-chat-completions',
            inputs: {
              model: '...',
              messages: ...,
            },
            output: llmResponse,
          },
        })
        ```

        #### Python

        ```
        voker_client.events.create(
          voker_agent="<agent-name>",
          voker_session="<session-id>",
          event_name="llm",
          properties={
            "api": "openai-chat-completions",
            "inputs": {
              "model": "...",
              "messages": ...,
            },
            "output": llm_response
          },
        )
        ```
      </Step>
    </Steps>
  ````
</Card>

This guide walks you through installing Voker, configuring your API key, and making your first tracked LLM call. By the end, you'll have a working integration that captures every request your agent makes - no extra code required beyond swapping the import.

<Note>the SDK does not currently support Audio, Video or Image modalities.</Note>

<Tabs>
  <Tab title="Python">
    <Steps>
      <Step title="Install the package">
        Install `voker` using your preferred package manager.

        <CodeGroup>
          ```bash pip theme={null}
          pip install voker
          ```

          ```bash uv theme={null}
          uv add voker
          ```

          ```bash poetry theme={null}
          poetry add voker
          ```
        </CodeGroup>
      </Step>

      <Step title="Set your API key">
        Create a `.env` file:

        ```bash theme={null}
        VOKER_API_KEY=your_api_key_here
        ```

        You can find your API key in the Voker dashboard. Setting it as an environment variable keeps it out of your source code.
      </Step>

      <Step title="Swap your LLM import">
        Replace the standard LLM provider import with the Voker-wrapped version. No other changes to your code are needed.

        <Tabs>
          <Tab title="OpenAI">
            ```python theme={null}
            from openai import OpenAI # [!code --]
            from voker.ai.provider_openai import OpenAI # [!code ++]

            client = OpenAI()

            client.chat.completions.create(
                voker_agent="customer-support-agent",  # required [!code ++]
                voker_session="user-session-1",        # required [!code ++]
                model="gpt-4.1-mini",
                messages=[
                    {
                        "role": "user",
                        "content": "Hello, world!",
                    }
                ],
            )
            ```
          </Tab>

          <Tab title="Anthropic">
            ```python theme={null}
            from anthropic import Anthropic  # [!code --]
            from voker.ai.provider_anthropic import Anthropic  # [!code ++]

            client = Anthropic()

            client.messages.create(
                voker_agent="customer-support-agent",  # required [!code ++]
                voker_session="user-session-1",        # required [!code ++]
                model="claude-haiku-4-5",
                messages=[
                    {
                        "role": "user",
                        "content": "Hello, world!",
                    }
                ],
                max_tokens=1024,
            )
            ```
          </Tab>

          <Tab title="Gemini">
            ```python theme={null}
            from google.genai import Client  # [!code --]
            from voker.ai.provider_gemini import Client  # [!code ++]

            client = Client()

            client.models.generate_content(
                voker_agent="customer-support-agent",  # required [!code ++]
                voker_session="user-session-1",        # required [!code ++]
                model="gemini-2.5-flash",
                contents="Hello, world!",
            )
            ```
          </Tab>
        </Tabs>

        Pass `voker_agent` to identify which agent handled the event, and `voker_session` to group events by session.
      </Step>
    </Steps>
  </Tab>

  <Tab title="TypeScript">
    <Steps>
      <Step title="Install the package">
        Install `@voker/voker` using your preferred package manager.

        <CodeGroup>
          ```bash npm theme={null}
          npm install @voker/voker
          ```

          ```bash pnpm theme={null}
          pnpm add @voker/voker
          ```

          ```bash bun theme={null}
          bun add @voker/voker
          ```

          ```bash yarn theme={null}
          yarn add @voker/voker
          ```
        </CodeGroup>
      </Step>

      <Step title="Set your API key">
        Create a `.env` file:

        ```bash theme={null}
        VOKER_API_KEY=your_api_key_here
        ```

        You can find your API key in the Voker dashboard. Setting it as an environment variable keeps it out of your source code.
      </Step>

      <Step title="Swap your LLM import">
        Replace the standard LLM provider import with the Voker-wrapped version. No other changes to your code are needed.

        <Tabs>
          <Tab title="OpenAI">
            ```typescript theme={null}
            import { OpenAI } from 'openai'; // [!code --]
            import { OpenAI } from '@voker/voker/ai/provider-openai'; // [!code ++]

            const client = new OpenAI();

            await client.chat.completions.create({
                vokerAgent: 'customer-support-agent', // required [!code ++]
                vokerSession: 'user-session-1',       // required [!code ++]
                model: 'gpt-4o',
                messages: [
                    {
                        role: 'user',
                        content: 'Hello, world!',
                    },
                ],
            });
            ```
          </Tab>

          <Tab title="Anthropic">
            ```typescript theme={null}
            import Anthropic from '@anthropic-ai/sdk'; // [!code --]
            import { Anthropic } from '@voker/voker/ai/provider-anthropic'; // [!code ++]

            const client = new Anthropic();

            await client.messages.create({
                vokerAgent: 'customer-support-agent', // required [!code ++]
                vokerSession: 'user-session-1',       // required [!code ++]
                model: 'claude-haiku-4-5',
                messages: [
                    {
                        role: 'user',
                        content: 'Hello, world!',
                    },
                ],
                max_tokens: 1024,
            });
            ```
          </Tab>

          <Tab title="Gemini">
            ```typescript theme={null}
            import { GoogleGenAI } from '@google/genai'; // [!code --]
            import { GoogleGenAI } from '@voker/voker/ai/provider-gemini'; // [!code ++]

            const client = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY! });

            await client.models.generateContent({
                vokerAgent: 'customer-support-agent', // required [!code ++]
                vokerSession: 'user-session-1',       // required [!code ++]
                model: 'gemini-2.5-flash',
                contents: 'Hello, world!',
            });
            ```
          </Tab>

          <Tab title="AI SDK">
            ```typescript theme={null}
            import { generateText } from 'ai'; // [!code --]
            import * as ai from 'ai'; // [!code ++]
            import { wrapAiSdk } from '@voker/voker/ai/provider-aisdk'; // [!code ++]

            const { generateText } = wrapAiSdk(ai);

            await generateText({
                vokerAgent: 'customer-support-agent', // required [!code ++]
                vokerSession: 'user-session-1',       // required [!code ++]
                model: 'anthropic/claude-haiku-4-5',
                prompt: 'Hello, world!',
            });
            ```
          </Tab>
        </Tabs>

        Pass `vokerAgent` to identify which agent handled the event, and `vokerSession` to group events by session.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## Next steps

Once you're tracking calls, explore provider-specific features and configuration options:

<CardGroup cols={2}>
  <Card title="OpenAI" icon="https://mintcdn.com/voker/Vy47_-QoUzvilAkD/assets/icons/openai.svg?fit=max&auto=format&n=Vy47_-QoUzvilAkD&q=85&s=a1531f193614bd143a922582ff321da7" href="/providers/openai" width="800" height="800" data-path="assets/icons/openai.svg">
    Chat Completions and Responses API support
  </Card>

  <Card title="Anthropic" icon="https://mintcdn.com/voker/Vy47_-QoUzvilAkD/assets/icons/anthropic.svg?fit=max&auto=format&n=Vy47_-QoUzvilAkD&q=85&s=3332c23efee94877aa8941d341a87cb8" href="/providers/anthropic" width="92" height="65" data-path="assets/icons/anthropic.svg">
    Messages API support with Claude models
  </Card>

  <Card title="Gemini" icon="https://mintcdn.com/voker/Vy47_-QoUzvilAkD/assets/icons/gemini.svg?fit=max&auto=format&n=Vy47_-QoUzvilAkD&q=85&s=ec6b6a62fd2d278caa9306abe5b2fdd9" href="/providers/gemini" width="65" height="65" data-path="assets/icons/gemini.svg">
    Gemini Generate Content and Interactions API support
  </Card>

  <Card title="AI SDK" icon="https://mintcdn.com/voker/Vy47_-QoUzvilAkD/assets/icons/aisdk.svg?fit=max&auto=format&n=Vy47_-QoUzvilAkD&q=85&s=1a3e94cbebbef47a6642d6fa1e8b333c" href="/providers/ai-sdk" width="800" height="800" data-path="assets/icons/aisdk.svg">
    Vercel AI SDK integration with `wrapAiSdk()`
  </Card>
</CardGroup>
