API-Direct Documentation
Infrastructure for the AI Agent Economy. Deploy production APIs in 2 minutes with zero configuration.
AI Agent Ready
API-Direct is specifically designed for AI agent automation with non-interactive flags, structured error codes, and machine-readable JSON output.
What is API-Direct?
API-Direct is the only platform where AI agents can autonomously deploy production APIs with built-in monetization, scaling, and marketplace distribution. Choose between our zero-config hosted infrastructure or bring-your-own-AWS (BYOA) for enterprise control.
Key Features
AI Agent Automation
Non-interactive CLI flags, structured errors, and JSON output perfect for AI agents.
Dual Deployment
Choose hosted (2-min deploy) or BYOA (enterprise control) deployment models.
Production Templates
AI-optimized templates for GPT wrappers, sentiment analysis, and more.
Built-in Monetization
Automatic billing, marketplace listing, and revenue sharing.
Installation
Install the CLI
# macOS/Linux
curl -fsSL https://cli.api-direct.io/install.sh | sh
# Windows
iwr -useb https://cli.api-direct.io/install.ps1 | iex
# npm
npm install -g @api-direct/cli
# Go
go install github.com/api-direct/cli@latest
Verify Installation
apidirect --version
# Output: apidirect version 1.0.0
Quick Start
Deploy your first API in under 3 minutes.
1. Login to API-Direct
apidirect login
2. Create a New API
apidirect init my-sentiment-api --template sentiment-analyzer
cd my-sentiment-api
3. Deploy to Hosted Infrastructure
apidirect deploy --hosted
Success!
Your API is now live at https://my-sentiment-api-abc123.api-direct.io
4. Test Your API
curl -X POST https://my-sentiment-api-abc123.api-direct.io/analyze \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key" \
-d '{"text": "This is amazing!"}'
5. Publish to Marketplace
apidirect publish --price 0.05
AI Agent Guide
API-Direct is specifically designed for AI agent automation. This guide shows how AI agents can deploy and manage APIs autonomously.
Non-Interactive Automation
All commands support --yes
and
--force
flags to skip confirmation prompts:
# Deploy without any prompts
apidirect deploy --hosted --yes --force
# Publish without confirmation
apidirect publish --price 0.05 --yes
# Delete API without "Are you sure?"
apidirect delete my-api --yes
Machine-Readable Output
Use --output json
for structured data that AI agents can parse:
apidirect deploy --hosted --output json
Returns:
{
"success": true,
"api_url": "https://my-api-abc123.api-direct.io",
"deployment_id": "deploy-1703123456",
"api_name": "my-api",
"status": "success",
"deployment_type": "hosted",
"features": ["auto-scaling", "ssl", "monitoring"],
"endpoints": ["POST /analyze", "GET /health"]
}
Structured Error Handling
All errors include specific error codes for programmatic handling:
{
"success": false,
"error": {
"error_code": "QUOTA_EXCEEDED",
"message": "You have reached your plan limit of 5 APIs",
"suggestion": "Upgrade your plan at https://console.api-direct.io/billing",
"recoverable": true
}
}
Complete AI Agent Workflow
# AI agent executes this workflow autonomously:
# 1. Check authentication status
apidirect auth status --output json
# 2. Create and deploy API
apidirect init sentiment-api --template sentiment-analyzer
cd sentiment-api
apidirect deploy --hosted --yes --output json
# 3. Test the deployed API
curl -X POST $API_URL/analyze \
-H "Content-Type: application/json" \
-d '{"text": "Test message"}'
# 4. Publish to marketplace
apidirect publish --price 0.05 --yes --output json
# 5. Monitor and scale
apidirect logs sentiment-api --tail
apidirect scale sentiment-api --replicas 3
apidirect deploy
Deploy your API to hosted infrastructure or your own AWS account.
Usage
apidirect deploy [api-name] [flags]
Flags
Flag | Description | Default |
---|---|---|
--hosted | Deploy to API-Direct hosted infrastructure | true |
--yes | Skip all confirmation prompts | false |
--force | Force deployment even if API exists | false |
--output | Output format (json) | text |
Examples
Basic hosted deployment:
apidirect deploy
AI agent deployment (non-interactive):
apidirect deploy --hosted --yes --force --output json
BYOA deployment:
apidirect deploy --byoa