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

# Make Your First Request

> This guide walks you through your first chat request to Agumbe AI Gateway using an OpenAI-compatible SDK.

#### Agumbe AI Gateway base URL:

```text theme={null}
https://api.agumbe.ai/api/v1/llm
```

### Step 1: Create an API key

Create a gateway API key from the Agumbe Console. Use this key from your backend service, worker, or local development environment.

#### Set it as an environment variable:

```shellscript theme={null}
export AGUMBE_API_KEY="your_agumbe_gateway_api_key"
```

### Step 2: Install the SDK

Agumbe AI Gateway is compatible with every major LLM provider out there, but for this example we will use the official OpenAI SDK.

#### For Node.js:

```shellscript theme={null}
npm install openai
```

#### For Python:

```shellscript theme={null}
pip install openai
```

### Step 3: Send a chat request

<Tabs>
  <Tab title="cURL">
    ```shellscript theme={null}
    curl https://api.agumbe.ai/api/v1/llm/chat/completions \
      -H "Authorization: Bearer $AGUMBE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-5.2",
        "messages": [
          {
            "role": "system",
            "content": "You are a concise assistant."
          },
          {
            "role": "user",
            "content": "Explain what an AI Gateway does in one sentence."
          }
        ],
        "max_completion_tokens": 200
      }'

    ```
  </Tab>

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

    const client = new OpenAI({
      apiKey: process.env.AGUMBE_API_KEY,
      baseURL: "https://api.agumbe.ai/api/v1/llm",
    });

    const response = await client.chat.completions.create({
      model: "gpt-5.2",
      messages: [
        {
          role: "system",
          content: "You are a concise assistant.",
        },
        {
          role: "user",
          content: "Explain what an AI Gateway does in one sentence.",
        },
      ],
      max_completion_tokens: 200,
    });

    console.log(response.choices[0]?.message?.content);

    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os
    from openai import OpenAI

    client = OpenAI(
        api_key=os.environ["AGUMBE_API_KEY"],
        base_url="https://api.agumbe.ai/api/v1/llm",
    )

    response = client.chat.completions.create(
        model="gpt-5.2",
        messages=[
            {
                "role": "system",
                "content": "You are a concise assistant.",
            },
            {
                "role": "user",
                "content": "Explain what an AI Gateway does in one sentence.",
            },
        ],
        max_completion_tokens=200,
    )

    print(response.choices[0].message.content)

    ```
  </Tab>
</Tabs>

### Step 5: Choose a model

You can use a supported model ID or an Agumbe alias.

Examples:

```text theme={null}
gpt-5.2
smart-default
cheap-fast
reasoning
```

<Tip>
  Use `smart-default` when you want Agumbe to choose the default general-purpose model for your application.
</Tip>

### Step 6: Add guardrails when needed

If your API key is tenant-scoped, you can choose which app’s guardrails apply by passing `agumbe_guardrails_app_id`.

```typescript theme={null}
const response = await client.chat.completions.create({
  model: "smart-default",
  messages: [
    {
      role: "user",
      content: "Draft a safe response to this customer message.",
    },
  ],
  max_completion_tokens: 200,
  agumbe_guardrails_app_id: "app_support",
} as any);
```

If your API key is app-scoped, the gateway applies the bound app’s guardrails automatically.

***

That’s it. Your application is now sending LLM traffic through Agumbe AI Gateway, with one endpoint for model access, policy enforcement, usage tracking, and observability.
