📚 Developer Docs
v1.0

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/v1

Key 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_KEY

Example 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

POST/api/v1/roadmap

Generate an AI-powered product roadmap based on your product description. Returns a structured roadmap with phases, milestones, and timeline.

Request Body

FieldTypeRequiredDescription
productNamestringYesName of your product
productDescriptionstringYesDetailed description of your product (50-2000 chars)
timeframestringNoRoadmap timeframe: '3-months', '6-months', '12-months'
focusstringNoFocus 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"
  }'
POST/api/v1/prd

Generate a comprehensive Product Requirements Document (PRD) with features, user stories, technical requirements, and success metrics.

Request Body

FieldTypeRequiredDescription
productNamestringYesName of your product
productDescriptionstringYesDetailed description of your product
targetAudiencestringNoDescription of target users
problemStatementstringNoThe problem your product solves
includeUserStoriesbooleanNoInclude user stories (default: true)
includeTechSpecsbooleanNoInclude 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
  }'
GET/api/v1/user/credits

Get 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"
GET/api/v1/generations

List all your previous generations with pagination. Retrieve roadmaps, PRDs, and other generated content.

Request Body

FieldTypeRequiredDescription
typestringNoFilter by type: 'roadmap', 'prd', 'all'
limitnumberNoNumber of results (default: 10, max: 50)
offsetnumberNoPagination 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.

PlanRequests/MinuteDaily Limit
Free10 requests/minute100 requests/day
Starter30 requests/minute1,000 requests/day
Pro60 requests/minute5,000 requests/day
Unlimited120 requests/minuteUnlimited

Rate Limit Headers

Every response includes rate limit information:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1709312400

Error 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

400

Bad Request

Invalid request parameters. Check the request body.

401

Unauthorized

Missing or invalid API key. Check your Authorization header.

403

Forbidden

API access not enabled for your plan or insufficient credits.

404

Not Found

The requested resource doesn't exist.

429

Too Many Requests

Rate limit exceeded. Wait before retrying.

500

Internal Server Error

Something went wrong on our end. Try again later.

503

Service Unavailable

Service temporarily unavailable. Try again in a few minutes.

Common Error Codes

CodeDescription
INVALID_API_KEYThe API key is malformed or doesn't exist
INSUFFICIENT_CREDITSNot enough credits to complete the request
API_NOT_ENABLEDAPI access not available on your plan
RATE_LIMIT_EXCEEDEDToo many requests, slow down
VALIDATION_ERRORRequest body validation failed

Ready to start building?

Get your API key and start integrating 1Labs tools into your applications.

Get Started →