API Documentation
Welcome to the Kie.ai API documentation. This guide will help you understand how to use our API services effectively.
API Services Overview
We currently offer the following API services:
-
DeepSeek - Large language model API endpoints powered by DeepSeek
- Real-time conversation interfaces
- Context-aware responses
- Stream response support
-
Runway - AI video generation endpoints using Runway's generative video models
- Text-to-video generation
- Image-to-video transformation
- Callback notifications
-
Suno - AI audio generation services for creating music and vocal content
- Music generation with or without lyrics
- Lyrics creation with timestamped support
- WAV format high-quality audio
- Vocal removal and track separation
- MP4 video generation from audio tracks
-
Account - Endpoints for managing account information, credit balances, and usage quotas
- Credit balance checking
- Usage tracking
Basic Information
- API Server:
https://kieai.erweima.ai
- API Version: 1.0.0
- Technical Support: [email protected]
Authentication
All APIs require Bearer Token authentication:
Authorization: Bearer YOUR_API_KEY
To get your API key:
- Visit API Key Management Page
- Generate your personal API key
- Use it in all API requests
Important:
- Keep your API key secure
- Never share your API key
- Reset immediately if compromised
API Services
DeepSeek Chat
The DeepSeek Chat API provides advanced natural language processing capabilities:
- Real-time conversation interface via
/api/v1/chat/completions
- Support for various parameters like temperature, max_tokens, and top_p
- Stream response for immediate feedback
- Function calling capability
- JSON output format support
Runway Video Generation
The Runway API enables AI-powered video generation:
- Create videos from text prompts via
/api/v1/runway/generate
- Transform images into videos with textual guidance
- Support for different aspect ratios (16:9 or 9:16)
- Webhook callbacks for asynchronous processing
- Query generation status via
/api/v1/runway/record-detail
Key features:
- Generated videos are stored for 14 days
- Video generation is asynchronous with callbacks
- Both text-only and image-based generation supported
Suno Audio Generation
The Suno API provides AI-powered audio and music generation capabilities:
Audio Generation
- Create music tracks from text prompts via
/api/v1/generate
- Support for both instrumental and vocal music
- Custom and non-custom generation modes
- Audio extension capabilities for existing tracks
- Timestamped lyrics support
Key features:
- Generated audio files are stored for 14 days
- Asynchronous processing with callback notifications
- Multiple model versions (V3.5 and V4) support
Lyrics Generation
- Generate song lyrics based on text prompts
- Create structured lyrical content for music tracks
- Query and retrieve lyrics generation task details
WAV Format Audio
- Generate high-quality WAV format audio files
- Ideal for professional audio production workflows
- Enhanced audio quality compared to standard formats
Vocal Removal
- Separate vocals from instrumental tracks
- Extract vocal and instrumental components from audio files
- Process existing audio to create isolated tracks
MP4 Generation
- Generate MP4 videos from audio tracks via
/api/v1/mp4/generate
- Create visual music videos from generated songs
- Query MP4 generation task details via
/api/v1/mp4/record-info
- Asynchronous processing with task status tracking
Credits Management
Monitor and manage your API usage through the credits system:
- Check remaining credits via
/api/v1/chat/credit
- Track usage history
- Set up usage alerts
Error Handling
Our APIs use standard HTTP status codes along with detailed error messages:
Code | Description |
---|---|
100 | Executed - To be executed |
200 | Success - The request was successful |
300 | Answering |
401 | Unauthorized - Authentication is required or failed |
402 | Exhausted Times - The number of times has been used up |
404 | Not Found - Invalid request method or path |
422 | Incorrect Parameters - Wrong Parameter Code |
429 | Insufficient Credits - Account has insufficient credits |
500 | Server Error - Internal server error occurred |
505 | Chat Disabled - Chat Disable Error Code |
Best Practices
-
Authentication
- Store your API key securely
- Rotate keys periodically for enhanced security
- Implement proper error handling for authentication failures
-
DeepSeek Chat
- Set appropriate temperature values based on your creativity needs
- Use streaming for responsive user interfaces
- Leverage system messages to guide model behavior
-
Runway Video Generation
- Implement robust callback handling for asynchronous results
- Store taskIds for status checking
- Prepare for 14-day video expiration in your applications
-
Suno Audio Generation
- Choose appropriate model versions based on your quality requirements
- Use custom mode for more control over music generation
- Implement proper callback handling for all generation stages
- Consider using WAV format for professional audio applications
- Leverage vocal removal for audio processing workflows
- Use MP4 generation to create visual content from your audio tracks
-
Credits Management
- Monitor credit usage regularly
- Implement fallback mechanisms for depleted credits
- Consider caching responses where appropriate
Need Help?
If you encounter any issues or have questions, please contact us through:
- 📧 Email: [email protected]
- 💬 Live Support: Dashboard
- 📚 API Reference: Full Documentation
This documentation is available in both English and Chinese. You can switch languages using the language selector in the navigation bar.