LLM API
GuidesCoding Assistants

Augment Code Integration

Connect Augment Code to LLM API for AI-powered capabilities

Augment Code provides a Context Engine SDK for indexing and searching codebases with AI. It enables developers to build semantic search over code repositories and integrate the results with external LLMs for context-aware code assistance.

Augment's SDK is designed to work alongside external LLM APIs. By using LLM API as your model provider, you can combine Augment's code context with any supported model.

Prerequisites

  • An LLM API account with an API key
  • Augment Code installed or accessible

Setup

Get Your LLM API Key

  1. Log in to your LLM API dashboard
  2. Click Create Key to Start
  3. Copy your new API key immediately — it will only be shown once
  4. Store the key securely (e.g., in a password manager or .env file)

LLM API is an OpenAI-compatible gateway that gives you access to dozens of AI models through a single API key and endpoint.

Use LLM API with Augment Code SDK

  1. Set up the Augment Context Engine SDK in your project.
  2. Use Augment's search() to retrieve code context, then pass it to LLM API:
import openai from "openai";
const client = new openai.OpenAI({
apiKey: "your-llm-api-key-here",
baseURL: "https://api.llmapi.ai/v1"
});
// Get code context from Augment
const codeContext = await context.search("your query");
// Send to LLM API with context
const response = await client.chat.completions.create({
model: "openai/gpt-4o",
messages: [{
role: "user",
content: \`\${codeContext}\\n\\nYour question here\`
}]
});
  1. Deploy your application --- it will use Augment for code search and LLM API for AI responses.

Test the Integration

Verify that Augment Code can successfully communicate with LLM API by sending a test request. All requests will now be routed through LLM API.

Combining Augment's deep codebase context with LLM API's model flexibility gives you a powerful custom coding assistant.

Benefits of Using LLM API with Augment Code

  • Multi-Provider Access: Use models from OpenAI, Anthropic, Google, and more through a single API
  • Cost Control: Track and limit your AI spending with detailed usage analytics
  • Unified Billing: One account for all providers instead of managing multiple API keys
  • Caching: Reduce costs with response caching for repeated requests

View all available models on the models page.

How is this guide?