Pipelex API Documentation
Welcome to the Pipelex API documentation. The API provides programmatic access to the Pipelex system.
What the API Offers
The API currently allows you to:
- Create a Pipelex pipeline from natural language descriptions
- Run any Pipelex pipeline with flexible inputs
- Validate any Pipelex pipeline to ensure correctness
Deployment
The Pipelex API is currently available for local deployment only. You can deploy it yourself using our Docker image: pipelex/pipelex-api
1. Configure Environment
Create a .env file with your API keys:
# Required: API key to authenticate requests to this API server
API_KEY=your-api-key-here
# Required: Pipelex Gateway API key to access all LLMs
PIPELEX_GATEWAY_API_KEY=your-pipelex-gateway-api-key
You can get a free Pipelex Gateway API key ($20 of free credits) here https://app.pipelex.com
For complete API key configuration, see the API Key Configuration section in the main Pipelex repository.
2. Run with Docker
Option A: Using Docker Run (Recommended)
docker run --name pipelex-api -p 8081:8081 \
-e API_KEY=your-api-key-here \
-e PIPELEX_GATEWAY_API_KEY=your-pipelex-gateway-api-key \
pipelex/pipelex-api:latest
Option B: Using Docker Compose
docker-compose up
Option C: Build Locally
docker build -t pipelex-api .
docker run --name pipelex-api -p 8081:8081 \
-e API_KEY=your-api-key-here \
-e PIPELEX_GATEWAY_API_KEY=your-pipelex-gateway-api-key \
pipelex-api
3. Verify
curl http://localhost:8081/health
Base URL
Once deployed locally, the API is available at:
http://localhost:8081/api/v1
Authentication
The API supports two authentication methods:
API Key Authentication (Default)
By default, the API uses static API key authentication. Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
The API key is configured via the API_KEY environment variable when deploying the server.
JWT Authentication (Optional)
For production deployments requiring user-specific tokens, JWT authentication is available.
To enable JWT authentication:
- Set the
USE_JWT=trueenvironment variable - Set the
JWT_SECRET_KEYenvironment variable with your secret key
docker run --name pipelex-api -p 8081:8081 \
-e USE_JWT=true \
-e JWT_SECRET_KEY=your-jwt-secret-key \
-e PIPELEX_GATEWAY_API_KEY=your-pipelex-gateway-api-key \
pipelex/pipelex-api:latest
JWT Requirements:
- Tokens must be signed with the HS256 algorithm
- Tokens must contain an
emailfield in the payload - Pass the JWT in the Authorization header:
Authorization: Bearer YOUR_JWT_TOKEN
API Endpoints
The Pipelex API provides three main capabilities:
1. Pipe Builder
Generate pipelines from natural language descriptions and create executable Python code.
- Build Pipeline - Generate PLX content from a brief description
- Generate Runner Code - Create Python code to execute a pipeline
2. Pipe Run
Execute pipelines with flexible input formats, either synchronously or asynchronously.
- Execute Pipeline - Run a pipeline and wait for completion
- Start Pipeline - Start a pipeline execution without waiting
3. Pipe Validate
Validate PLX content to ensure pipelines are correctly defined before execution.
- Validate PLX - Parse, validate, and dry-run pipelines