Skip to main content

Documentation Index

Fetch the complete documentation index at: https://agumbe.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Agumbe AI Gateway base URL:

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:

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:

npm install openai

For Python:

pip install openai

Step 3: Send a chat request

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
  }'

Step 5: Choose a model

You can use a supported model ID or an Agumbe alias. Examples:
gpt-5.2
smart-default
cheap-fast
reasoning
Use smart-default when you want Agumbe to choose the default general-purpose model for your application.

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.
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.