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
-
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
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
-
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.