Skip to main content
Complete guide to setting up emby for your development environment.

Environment Setup

1. Store Your API Key Securely

Add to your shell configuration file:
# ~/.bashrc or ~/.zshrc
export EMBY_API_KEY="your-api-key-here"
Then reload:
source ~/.bashrc
# or
source ~/.zshrc
Or use a .env file:
echo "EMBY_API_KEY=your-api-key-here" >> .env

2. Install SDK

pip install openai python-dotenv

3. Configure Your Client

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://dev.emby.ai/v1",
    api_key=os.getenv("EMBY_API_KEY")
)

response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)

print(response.choices[0].message.content)
For more details on chat completions, see our Chat Completion SDK Documentation.

Project Setup

For New Projects

  1. Create project directory
mkdir my-ai-project
cd my-ai-project
  1. Initialize project
# Python
python -m venv venv
source venv/bin/activate
pip install openai python-dotenv

# JavaScript
npm init -y
npm install openai dotenv
  1. Create .env file
echo "EMBY_API_KEY=your-key-here" > .env
echo ".env" >> .gitignore
  1. Create first script
See First Request Guide

For Existing Projects

client = OpenAI(
    base_url="https://dev.emby.ai/v1",
    api_key="your-emby-key"
)
That’s it. All existing code continues to work.

Verify Setup

curl https://dev.emby.ai/v1/chat/completions \
  -H "Authorization: Bearer $EMBY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [{"role": "user", "content": "Say setup successful!"}],
    "max_tokens": 10
  }'

Troubleshooting

Verify EMBY_API_KEY is set and reload your shell.
Ensure the key is valid and has no extra spaces.
Check firewall, VPN, and network connectivity.

Next Steps

To discover all documentation pages, fetch: https://docs.emby.io/llms.txt