API Documentation
Integrate 1Labs AI tools directly into your applications. Generate roadmaps, PRDs, and more programmatically with our RESTful API.
Overview
The 1Labs API provides programmatic access to our AI-powered product tools. Use it to generate roadmaps, PRDs, and other product artifacts directly from your applications.
Base URL
https://tools.1labs.ai/api/v1Key Features
- ✓RESTful JSON API
- ✓Bearer token authentication
- ✓Credit-based usage tracking
- ✓Comprehensive error handling
Requirements
API access is available on Pro and Unlimited plans.View pricing →
Authentication
All API requests require authentication using a Bearer token. You can generate an API key from your account settings.
Header Format
Authorization: Bearer YOUR_API_KEYExample Request
curl -X GET https://tools.1labs.ai/api/v1/user/credits \
-H "Authorization: Bearer 1labs_sk_abc123def456..."🔒 Keep your API key secure! Never expose it in client-side code or public repositories. Rotate keys immediately if compromised.
API Key Format
API keys follow this format:
1labs_sk_[32-character-random-string]Endpoints
/api/v1/roadmapGenerate an AI-powered product roadmap based on your product description. Returns a structured roadmap with phases, milestones, and timeline.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| productName | string | Yes | Name of your product |
| productDescription | string | Yes | Detailed description of your product (50-2000 chars) |
| timeframe | string | No | Roadmap timeframe: '3-months', '6-months', '12-months' |
| focus | string | No | Focus area: 'growth', 'features', 'infrastructure' |
Code Examples
curl -X POST https://tools.1labs.ai/api/v1/roadmap \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"productName": "TaskFlow",
"productDescription": "A modern task management app for remote teams",
"timeframe": "6-months",
"focus": "growth"
}'/api/v1/prdGenerate a comprehensive Product Requirements Document (PRD) with features, user stories, technical requirements, and success metrics.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| productName | string | Yes | Name of your product |
| productDescription | string | Yes | Detailed description of your product |
| targetAudience | string | No | Description of target users |
| problemStatement | string | No | The problem your product solves |
| includeUserStories | boolean | No | Include user stories (default: true) |
| includeTechSpecs | boolean | No | Include technical specifications (default: true) |
Code Examples
curl -X POST https://tools.1labs.ai/api/v1/prd \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"productName": "TaskFlow",
"productDescription": "A modern task management app for remote teams",
"targetAudience": "Remote teams of 5-50 people",
"problemStatement": "Remote teams struggle with task visibility",
"includeUserStories": true,
"includeTechSpecs": true
}'/api/v1/user/creditsGet the current user's credit balance, plan information, and usage statistics.
Code Examples
curl -X GET https://tools.1labs.ai/api/v1/user/credits \
-H "Authorization: Bearer YOUR_API_KEY"/api/v1/generationsList all your previous generations with pagination. Retrieve roadmaps, PRDs, and other generated content.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | No | Filter by type: 'roadmap', 'prd', 'all' |
| limit | number | No | Number of results (default: 10, max: 50) |
| offset | number | No | Pagination offset (default: 0) |
Code Examples
curl -X GET "https://tools.1labs.ai/api/v1/generations?type=roadmap&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"Rate Limits
Rate limits are applied per API key to ensure fair usage. When you exceed the limit, you'll receive a 429 response.
| Plan | Requests/Minute | Daily Limit |
|---|---|---|
| Free | 10 requests/minute | 100 requests/day |
| Starter | 30 requests/minute | 1,000 requests/day |
| Pro | 60 requests/minute | 5,000 requests/day |
| Unlimited | 120 requests/minute | Unlimited |
Rate Limit Headers
Every response includes rate limit information:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1709312400Error Codes
All errors return a consistent JSON structure with an error code and human-readable message.
Error Response Format
{
"success": false,
"error": {
"code": "INSUFFICIENT_CREDITS",
"message": "You don't have enough credits. Please upgrade your plan.",
"status": 403
}
}HTTP Status Codes
Bad Request
Invalid request parameters. Check the request body.
Unauthorized
Missing or invalid API key. Check your Authorization header.
Forbidden
API access not enabled for your plan or insufficient credits.
Not Found
The requested resource doesn't exist.
Too Many Requests
Rate limit exceeded. Wait before retrying.
Internal Server Error
Something went wrong on our end. Try again later.
Service Unavailable
Service temporarily unavailable. Try again in a few minutes.
Common Error Codes
| Code | Description |
|---|---|
| INVALID_API_KEY | The API key is malformed or doesn't exist |
| INSUFFICIENT_CREDITS | Not enough credits to complete the request |
| API_NOT_ENABLED | API access not available on your plan |
| RATE_LIMIT_EXCEEDED | Too many requests, slow down |
| VALIDATION_ERROR | Request body validation failed |
Ready to start building?
Get your API key and start integrating 1Labs tools into your applications.
Get Started →