Loading...
Loading...
Programmatic access to SOURCE for M2M integrations, AI agents, and automation.
SOURCE uses Bearer tokens for API authentication. Include your token in theAuthorization header.
Authorization: Bearer source_abc123...Access Token: Generated after purchasing a package. Used to download packages you've purchased.
CLI Token: Created in Settings → Tokens. Used for publishing packages and API access.
For AI Agents: Create a dedicated CLI token with read scope for downloading packages. Store it securely in your environment variables.
https://source.software/apihttps://registry.source.software| Method | Endpoint | Auth |
|---|---|---|
| GET | /api/packages | Optional |
| GET | /api/packages/{scope}/{name} | Optional |
| GET | /@{scope}/{name} | Bearer Token |
| GET | /@{scope}/{name}/-/{name}-{version}.tgz | Bearer Token |
| GET | /api/auth/cli/tokens | Session |
| POST | /api/auth/cli/tokens | Session |
| DELETE | /api/auth/cli/tokens | Session |
The registry proxy at registry.source.software implements the npm registry protocol. It validates access tokens before serving package data.
/@{scope}/{name}curl -H "Authorization: Bearer source_YOUR_TOKEN" \
https://registry.source.software/@source/secure-auth/@{scope}/{name}/-/{name}-{version}.tgzcurl -H "Authorization: Bearer source_YOUR_TOKEN" \
-o package.tgz \
https://registry.source.software/@source/secure-auth/-/secure-auth-1.0.0.tgzIf your token doesn't have access, you'll receive a 402 response with purchase information:
{
"error": "payment_required",
"message": "Access to @source/secure-auth requires payment",
"purchase_url": "https://source.software/packages/source/secure-auth",
"price": "$29/mo"
}Version-Locked Access: If your purchase was locked to a specific version, attempting to download a different version returns 403 Forbidden.
/api/packagesQuery parameters:
| scope | Filter by scope (e.g., "source", "expert") |
| pricing_model | Filter by pricing: "subscription", "ppv", "ai_license" |
| certified | Filter certified packages: "true" |
| limit | Results per page (default: 20, max: 100) |
| offset | Pagination offset (default: 0) |
{
"packages": [
{
"id": "uuid",
"name": "secure-auth",
"scope": "source",
"fullName": "@source/secure-auth",
"description": "Enterprise authentication library",
"isCertified": true,
"pricingModel": "subscription",
"priceMonthly": 29,
"owner": "johndoe",
"createdAt": "2026-01-01T00:00:00Z"
}
],
"total": 42,
"limit": 20,
"offset": 0
}/api/packages/{scope}/{name}curl https://source.software/api/packages/source/secure-auth{
"id": "uuid",
"fullName": "@source/secure-auth",
"versions": [
{ "id": "uuid", "version": "1.2.0", "downloads": 1500, "createdAt": "..." },
{ "id": "uuid", "version": "1.1.0", "downloads": 3200, "createdAt": "..." }
],
"latestVersion": "1.2.0",
"hasAccess": false,
...
}Manage CLI tokens programmatically. Requires session authentication (web login).
/api/auth/cli/tokensRequest body:
{
"name": "CI/CD Pipeline",
"scopes": ["read", "publish"],
"expiresInDays": 90
}Scopes: publish (upload packages),read (download packages),admin (full access)
{
"token": "source_abc123...", // Only returned once!
"id": "uuid",
"expiresAt": "2026-04-10T00:00:00Z"
}Important: The raw token is only returned once upon creation. Store it securely immediately.
Errors follow RFC 7807 (Problem Details).
{
"type": "unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "You must be logged in to view CLI tokens"
}| Endpoint | Limit |
|---|---|
| Package downloads | 1000/hour |
| API requests | 100/minute |
| Token creation | 10/hour |
| Package uploads | 10/hour |
Rate limit headers are included in responses:X-RateLimit-Remaining
const SOURCE_TOKEN = process.env.SOURCE_TOKEN;
// List available packages
const response = await fetch('https://source.software/api/packages?certified=true');
const { packages } = await response.json();
// Download a package (via npm)
// Configure npm first: npm config set @source:registry https://registry.source.software
// Then: npm install @source/secure-auth
// Or fetch directly
const tarball = await fetch(
'https://registry.source.software/@source/secure-auth/-/secure-auth-1.0.0.tgz',
{ headers: { Authorization: `Bearer ${SOURCE_TOKEN}` } }
);import os
import requests
SOURCE_TOKEN = os.environ.get('SOURCE_TOKEN')
# List packages
response = requests.get('https://source.software/api/packages', params={
'scope': 'source',
'certified': 'true'
})
packages = response.json()['packages']
# Download tarball
headers = {'Authorization': f'Bearer {SOURCE_TOKEN}'}
tarball = requests.get(
'https://registry.source.software/@source/secure-auth/-/secure-auth-1.0.0.tgz',
headers=headers
)
with open('package.tgz', 'wb') as f:
f.write(tarball.content)# Set your token
export SOURCE_TOKEN="source_abc123..."
# List packages
curl "https://source.software/api/packages?limit=10"
# Get package details
curl "https://source.software/api/packages/source/secure-auth"
# Download package
curl -H "Authorization: Bearer $SOURCE_TOKEN" \
-o package.tgz \
"https://registry.source.software/@source/secure-auth/-/secure-auth-1.0.0.tgz"