API Documentation

Everything you need to integrate AI-powered content generation into your applications.

Getting Started

Welcome to the AI Content Generator API. Our REST API allows you to integrate AI-powered content generation into your applications, websites, or services. All endpoints return JSON responses and require authentication.

Base URL

https://api.aicontentgen.com/v1

Quick Example

const response = await fetch('https://api.aicontentgen.com/v1/generate', {method:'POST',headers:{'Authorization':'Bearer YOUR_API_KEY','Content-Type':'application/json'},body:JSON.stringify({prompt:'Write a product description',type:'product',tone:'professional'})});

Authentication

All API requests require authentication using a Bearer token. Include your API key in the Authorization header of every request.

Authorization: Bearer your_api_key_here

You can obtain your API key by contacting our team or through the dashboard once you have an active subscription.

API Endpoints

POST/v1/generate

Generate content based on a text prompt. This is the primary endpoint for all content generation tasks.

GET/v1/models

List available AI models and their capabilities.

GET/v1/usage

Get your current API usage statistics and remaining quota.

Generate Content

Request Body

ParameterTypeDescription
promptstringThe content description or instruction
typestringContent type: blog, social, email, script, product
tonestringTone: professional, casual, friendly, formal
max_tokensintegerMaximum length (default: 500, max: 3000)

Response Format

{"success":true,"data":{"content":"Generated content text here...","model":"ai-content-v3","tokens_used":342,"processing_time_ms":1250}}

Error Codes

CodeMeaning
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
429Rate limit exceeded
500Server error - Try again later

SDKs & Libraries

Official SDKs are available for popular programming languages:

# Python
pip install aicontentgen
# Node.js
npm install aicontentgen-sdk
# Ruby
gem install aicontentgen