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

# Welcome to Edgee

> The Agent Gateway for Claude Code, Codex, OpenCode, and any coding agent. Compress, Route, Observe.

Edgee is an **Agent Gateway**, the infrastructure layer between your coding agent (Claude Code, Codex, OpenCode, Cursor) and the LLM provider APIs (Anthropic, OpenAI, GLM, others). It applies three things to every request: **compression of context**, **intelligent routing across providers**, and **observability of token consumption**.

<img className="block dark:hidden" src="https://mintcdn.com/edgee/r4XDW2y-MOC54AI_/images/ai-gateway-horizontal-light.png?fit=max&auto=format&n=r4XDW2y-MOC54AI_&q=85&s=a6b8cfa8d16c0ea76ee9d4344ed1c19e" alt="Edgee Agent Gateway" width="1997" height="807" data-path="images/ai-gateway-horizontal-light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/edgee/r4XDW2y-MOC54AI_/images/ai-gateway-horizontal-dark.png?fit=max&auto=format&n=r4XDW2y-MOC54AI_&q=85&s=75c41adc4fc11a8a8c159befe87f94cf" alt="Edgee Agent Gateway" width="1997" height="807" data-path="images/ai-gateway-horizontal-dark.png" />

## The three pillars

<CardGroup cols={3}>
  <Card title="Compress" icon="archive" iconType="duotone" href="/introduction/why-edgee#compress">
    Surgical removal of redundancy from what enters and leaves the model. Two layers: **Input** (\~99% of token volume) and **Output** (\~1%, high ROI).
  </Card>

  <Card title="Route" icon="route" iconType="duotone" href="/introduction/why-edgee#route">
    Per-request fallback on provider 5xx and timeouts. Plan-cap continuity for Claude Pro/Max users when quota is hit. Configurable provider chain.
  </Card>

  <Card title="Observe" icon="chart-line" iconType="duotone" href="/introduction/why-edgee#observe">
    Every request, every compression event, every cost delta — at session level locally and at team level in the managed console.
  </Card>
</CardGroup>

## Coding agents, start in seconds

<Steps>
  <Step title="Install the CLI">
    <Tabs>
      <Tab title="macOS / Linux">
        ```bash theme={"dark"}
        curl -fsSL https://install.edgee.ai | bash
        ```
      </Tab>

      <Tab title="Homebrew (macOS)">
        ```bash theme={"dark"}
        brew install edgee-ai/tap/edgee
        ```
      </Tab>

      <Tab title="Windows (PowerShell)">
        ```powershell theme={"dark"}
        irm https://install.edgee.ai/install.ps1 | iex
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Launch your coding agent">
    <Tabs>
      <Tab title="Claude Code">
        ```bash theme={"dark"}
        edgee launch claude
        ```
      </Tab>

      <Tab title="Codex">
        ```bash theme={"dark"}
        edgee launch codex
        ```
      </Tab>

      <Tab title="OpenCode">
        ```bash theme={"dark"}
        edgee launch opencode
        ```
      </Tab>
    </Tabs>
  </Step>
</Steps>

Your coding agent now runs through Edgee with compression, routing, and metering active. The CLI prints a session-analytics link on exit.

## Use the API directly

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={"dark"}
    import Edgee from 'edgee';

    const edgee = new Edgee("your-api-key");

    const response = await edgee.send({
      model: 'gpt-5.2',
      input: 'What is the capital of France?',
    });

    console.log(response.text);
    if (response.compression) {
      console.log(`Tokens saved: ${response.compression.saved_tokens}`);
    }
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={"dark"}
    from edgee import Edgee

    edgee = Edgee("your-api-key")

    response = edgee.send(
        model="gpt-5.2",
        input="What is the capital of France?"
    )

    print(response.text)
    if response.compression:
        print(f"Tokens saved: {response.compression.saved_tokens}")
    ```
  </Tab>

  <Tab title="Go">
    ```go theme={"dark"}
    package main

    import (
        "fmt"
        "log"
        "github.com/edgee-ai/go-sdk/edgee"
    )

    func main() {
        client, _ := edgee.NewClient("your-api-key")

        response, err := client.Send("gpt-5.2", "What is the capital of France?")
        if err != nil {
            log.Fatal(err)
        }

        fmt.Println(response.Text())
        if response.Compression != nil {
            fmt.Printf("Tokens saved: %d\n", response.Compression.SavedTokens)
        }
    }
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={"dark"}
    use edgee::Edgee;

    let client = Edgee::with_api_key("your-api-key");
    let response = client.send("gpt-5.2", "What is the capital of France?").await.unwrap();

    println!("{}", response.text().unwrap_or(""));
    if let Some(compression) = &response.compression {
        println!("Tokens saved: {}", compression.saved_tokens);
    }
    ```
  </Tab>

  <Tab title="OpenAI SDK">
    ```typescript theme={"dark"}
    import OpenAI from "openai";

    const openai = new OpenAI({
      baseURL: "https://api.edgee.ai/v1",
      apiKey: process.env.EDGEE_API_KEY,
    });

    const completion = await openai.chat.completions.create({
      model: "gpt-5.2",
      messages: [
        { role: "user", content: "What is the capital of France?" }
      ],
    });

    console.log(completion.choices[0].message.content);
    ```
  </Tab>

  <Tab title="Anthropic SDK">
    ```typescript theme={"dark"}
    import Anthropic from '@anthropic-ai/sdk';

    const client = new Anthropic({
      baseURL: 'https://api.edgee.ai',
      apiKey: process.env.EDGEE_API_KEY,
    });

    const message = await client.messages.create({
      model: 'claude-sonnet-4.5',
      max_tokens: 1024,
      messages: [
        { role: 'user', content: 'What is the capital of France?' }
      ]
    });

    console.log(message.content);
    ```
  </Tab>

  <Tab title="LangChain">
    ```python theme={"dark"}
    from langchain_openai import ChatOpenAI
    from langchain_core.messages import HumanMessage
    import os

    llm = ChatOpenAI(
        base_url="https://api.edgee.ai/v1",
        api_key=os.getenv("EDGEE_API_KEY"),
        model="gpt-5.2",
    )

    response = llm.invoke([HumanMessage(content="What is the capital of France?")])
    print(response.content)
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={"dark"}
    curl https://api.edgee.ai/v1/chat/completions \
      -H "Authorization: Bearer $EDGEE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"gpt-5.2","messages":[{"role":"user","content":"What is the capital of France?"}]}'
    ```
  </Tab>
</Tabs>

Edgee works with any OpenAI or Anthropic-compatible client by setting `baseURL` to `https://api.edgee.ai`.

## Next steps

<CardGroup cols={2}>
  <Card title="Why Edgee" icon="lightbulb" iconType="duotone" href="/introduction/why-edgee">
    The longer pitch — three pillars, OSS ecosystem, all the receipts.
  </Card>

  <Card title="Book a call" icon="phone" iconType="duotone" href="https://www.edgee.ai/contact">
    Talk to us about the managed Edgee console for teams.
  </Card>
</CardGroup>
