Skip to main content

Install with AI

Copy the Voker setup prompt into your coding agent.

  # 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>
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.
Voker does not currently support Audio, Video, or Image modalities.
1

Install the package

Install voker using your preferred package manager.
pip install voker
2

Set your API key

Create a .env file:
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.
3

Swap your LLM import

Replace the standard LLM provider import with the Voker-wrapped version. No other changes to your code are needed.
from openai import OpenAI 
from voker.ai.provider_openai import OpenAI 

client = OpenAI()

client.chat.completions.create(
    voker_agent="customer-support-agent",  # required
    voker_session="user-session-1",        # required
    model="gpt-4.1-mini",
    messages=[
        {
            "role": "user",
            "content": "Hello, world!",
        }
    ],
)
Pass voker_agent to identify which agent handled the event, and voker_session to group events by session.

Next steps

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

OpenAI

Chat Completions and Responses API support

Anthropic

Messages API support with Claude models

Gemini

Gemini Generate Content and Interactions API support

AI SDK

Vercel AI SDK integration with wrapAiSdk()