DevelopersAPI Docs
Quick Start
Welcome to the XiHe AI API! This guide will help you get started and begin using our AI creative capabilities in minutes.
2. Install SDK
Install the SDK using your preferred package manager:
npm install @xihe/sdk3. Make Your First Request
Use the following code to generate your first AI image:
import { XiheClient } from '@xihe/sdk';
const client = new XiheClient({
apiKey: process.env.XIHE_API_KEY
});
const image = await client.images.generate({
prompt: 'A cute cat in watercolor style',
model: 'xihe-xl',
size: '1024x1024'
});
console.log(image.url);Authentication
All API requests require Bearer Token authentication. Add your API Key to the request header:
Authorization: Bearer YOUR_API_KEY
API Endpoints
Here are the available API endpoints:
POST
Generate new images/v1/images/generatePOST
Edit existing images/v1/images/editPOST
Generate story content/v1/stories/generatePOST
Chat with Agent/v1/agents/chatRate Limits
The API has the following rate limits:
| Plan | Requests per minute | Requests per day |
|---|---|---|
| Free | 20 | 1,000 |
| Pro | 100 | 10,000 |
| Enterprise | Unlimited | Unlimited |
Need Help?
Check out more code examples, or contact our developer support team