Installation
Install the AMP SDK in your preferred language.
Prerequisites
Before installing AMP, ensure you have:
- Node.js 16+ (for TypeScript/JavaScript)
- Python 3.8+ (for Python)
- An AMP API key (sign up at amp-protocol.dev)
TypeScript / JavaScript
Install the official TypeScript SDK using npm or yarn:
npm install @amp-protocol/clientOr with yarn:
yarn add @amp-protocol/clientOr with pnpm:
pnpm add @amp-protocol/clientVerification
Verify the installation by importing the client:
import { AMP } from '@amp-protocol/client';
const amp = new AMP({
apiKey: process.env.AMP_API_KEY,
});
console.log('AMP client initialised successfully');Python
Install the official Python SDK using pip:
pip install amp-protocolOr with poetry:
poetry add amp-protocolVerification
Verify the installation:
from amp_protocol import AMP
amp = AMP(api_key=os.environ.get("AMP_API_KEY"))
print("AMP client initialised successfully")Direct REST API
If you prefer to use the REST API directly without an SDK, you can make HTTP requests to:
https://api.amp-protocol.dev/v1All requests require an Authorization header with your API key:
curl https://api.amp-protocol.dev/v1/context \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_123",
"task": "build a login page"
}'See the REST API documentation for full details.
Framework-Specific Guides
Next.js
Works seamlessly with App Router and Pages Router.
// app/api/agent/route.ts
import { AMP } from '@amp-protocol/client';
const amp = new AMP({
apiKey: process.env.AMP_API_KEY,
});Express.js
Integrate into your Express middleware or routes.
import { AMP } from '@amp-protocol/client';
import express from 'express';
const amp = new AMP({
apiKey: process.env.AMP_API_KEY,
});FastAPI
Perfect for Python-based AI agent backends.
from amp_protocol import AMP
from fastapi import FastAPI
amp = AMP(api_key=os.getenv("AMP_API_KEY"))LangChain
Integrate AMP into your LangChain agents.
from amp_protocol import AMP
from langchain.agents import Agent
amp = AMP(api_key=os.getenv("AMP_API_KEY"))Environment Variables
Store your API key securely using environment variables. Create a .env file:
AMP_API_KEY=amp_sk_your_secret_key_here⚠️ Security Warning: Never commit your API key to version control. Add .env to your .gitignore file.
Next Steps
Now that you've installed AMP, learn how to: