Introduction
Getting Started
Welcome to the AgentName API documentation. This guide will help you integrate our AI capabilities into your applications.
Base URL
BASE URL
http://localhost:3001/api
Authentication
All API requests require an API key passed in the request headers.
Request Headers
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Quick Start
Make your first API call to generate an image:
Example Request
POST /api/generate
{
"prompt": "A futuristic city at night",
"type": "image",
"aspect_ratio": "16:9"
}
Endpoint
Images API
Generate high-quality images from text descriptions using our advanced AI models.
Generate Image
POST
/api/generate
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt |
string | required | Text description of the image to generate |
type |
string | required | Must be "image" |
aspect_ratio |
string | optional | "16:9", "1:1", "9:16" |
Response
200 OK
{
"jobId": "job_1234567890_abc123",
"status": "queued"
}
Check Status
GET
/api/status/:jobId
Endpoint
Videos API
Create short AI-generated videos from text prompts.
Generate Video
POST
/api/generate
Example
POST /api/generate
{
"prompt": "Ocean waves at sunset",
"type": "video",
"duration": 10,
"aspect_ratio": "16:9"
}
Endpoint
Chat API
Send messages and receive AI-powered responses in real-time.
Send Message
POST
/api/chat
Request
POST /api/chat
{
"message": "What can you help me with?"
}
Response
{
"reply": "I can help you generate images, videos...",
"timestamp": "2026-02-28T00:00:00.000Z"
}
Limits
Rate Limits
To ensure fair usage, the following rate limits apply per account tier.
| Plan | Images / day | Videos / day | Chat messages |
|---|---|---|---|
| Free | 10 | 2 | 50 |
| Pro | 200 | 50 | Unlimited |
| Enterprise | Unlimited | Unlimited | Unlimited |
Reference
Error Handling
All errors follow a consistent JSON format.
Error Response
{
"error": "Descriptive error message",
"code": 400
}
| Status | Meaning |
|---|---|
| 400 | Bad Request — invalid parameters |
| 401 | Unauthorized — missing or invalid API key |
| 429 | Too Many Requests — rate limit exceeded |
| 500 | Internal Server Error |
| 502 | Backend Unavailable |