Documentation

Everything you need to deploy production APIs with AI agents

Getting Started

API-Direct is the fastest way to deploy production APIs. Built specifically for AI agents, our platform handles all the infrastructure, billing, and scaling automatically.

Quick Start

# Install the CLI
npm install -g apidirect

# Initialize a new API
apidirect init my-api --template sentiment-analyzer

# Deploy to production
apidirect deploy --hosted

Installation

System Requirements

  • Node.js 16.x or higher
  • npm or yarn package manager
  • Git (for version control)

Install via npm

npm install -g apidirect

Install via yarn

yarn global add apidirect

Verify Installation

apidirect --version

CLI Reference

apidirect init

Initialize a new API project

apidirect init <project-name> [options]

Options:
  --template <name>    Use a specific template
  --yes               Skip interactive prompts
  --force             Overwrite existing directory

apidirect deploy

Deploy your API to production

apidirect deploy [options]

Options:
  --hosted            Deploy to API-Direct infrastructure
  --byoa             Deploy to your own AWS account
  --yes              Skip confirmation prompts
  --output json      Return deployment info as JSON

apidirect list

List all deployed APIs

apidirect list [options]

Options:
  --output json      Output as JSON
  --filter <status>  Filter by status (active, paused)

apidirect logs

View API logs in real-time

apidirect logs <api-name> [options]

Options:
  --tail <n>         Show last n lines
  --follow          Stream logs in real-time
  --filter <term>   Filter log entries

API Reference

Base URL

https://api.apidirect.dev/v1

Authentication

All API requests require authentication via API key:

Authorization: Bearer YOUR_API_KEY

Endpoints

POST /apis

Create a new API

{
  "name": "sentiment-api",
  "template": "sentiment-analyzer",
  "config": {
    "pricing": {
      "pricePerCall": 0.001
    }
  }
}

GET /apis/{id}

Get API details

GET /apis/api_abc123

Response:
{
  "id": "api_abc123",
  "name": "sentiment-api",
  "status": "active",
  "endpoint": "https://sentiment-api.apidirect.dev",
  "requests": 145289,
  "revenue": "$145.29"
}

Examples

Deploy a Sentiment Analysis API

# Initialize project
apidirect init sentiment-api --template sentiment-analyzer

# Configure pricing
cd sentiment-api
echo "PRICE_PER_CALL=0.001" >> .env

# Deploy to production
apidirect deploy --hosted --yes

# Output:
# ✓ API deployed successfully!
# Endpoint: https://sentiment-api-abc123.apidirect.dev
# API Key: key_xyz789...

Using the Deployed API

# Make a request
curl -X POST https://sentiment-api-abc123.apidirect.dev/analyze \
  -H "Authorization: Bearer key_xyz789..." \
  -H "Content-Type: application/json" \
  -d '{
    "text": "I love this product! It works perfectly."
  }'

# Response:
{
  "sentiment": "positive",
  "confidence": 0.98,
  "emotions": ["joy", "satisfaction"]
}

Available Templates

sentiment-analyzer

Multi-language sentiment analysis with emotion detection

apidirect init my-api --template sentiment-analyzer

gpt-wrapper

Production-ready OpenAI wrapper with caching

apidirect init my-api --template gpt-wrapper

data-enrichment

Enrich company data with multiple sources

apidirect init my-api --template data-enrichment

web-scraper

Headless browser scraping with proxy rotation

apidirect init my-api --template web-scraper

View all 50+ templates →