Skip to main content
Edgee’s OpenAI-compatible API works seamlessly with LangChain, allowing you to leverage LangChain’s powerful features like chains, agents, memory, and RAG while maintaining control over your LLM infrastructure.

Installation

Using uv with inline dependencies (PEP 723):
Or install manually:

Basic Usage

Command-Line Script

Complete script with argument parsing:

Usage Examples

Compression & Tags via Headers

Control Token Compression and add tags for observability using the default_headers parameter:
Available Headers:
You can also enable compression per API key or Agent in the Edgee console. Headers override console settings.

Advanced Features

Chains

Streaming Responses

Tags

You can add tags to your requests for analytics and filtering using the default_headers parameter:
Tags are comma-separated strings in the header. They help you categorize and filter requests in Edgee’s analytics dashboard.

Authentication

Edgee uses standard Bearer token authentication. Set your API key as an environment variable:
The api_key parameter in ChatOpenAI automatically formats the header as: