Skip to main content

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:

  1. DeepSeek - Large language model API endpoints powered by DeepSeek

    • Real-time conversation interfaces
    • Context-aware responses
    • Stream response support
  2. Runway - AI video generation endpoints using Runway's generative video models

    • Text-to-video generation
    • Image-to-video transformation
    • Callback notifications
  3. 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:

  1. Visit API Key Management Page
  2. Generate your personal API key
  3. 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

Learn more about Chat API →

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

Learn more about Runway API →

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

Learn more about Credits →

Error Handling

Our APIs use standard HTTP status codes along with detailed error messages:

CodeDescription
100Executed - To be executed
200Success - The request was successful
300Answering
401Unauthorized - Authentication is required or failed
402Exhausted Times - The number of times has been used up
404Not Found - Invalid request method or path
422Incorrect Parameters - Wrong Parameter Code
429Insufficient Credits - Account has insufficient credits
500Server Error - Internal server error occurred
505Chat Disabled - Chat Disable Error Code

Best Practices

  1. Authentication

    • Store your API key securely
    • Rotate keys periodically for enhanced security
    • Implement proper error handling for authentication failures
  2. DeepSeek Chat

    • Set appropriate temperature values based on your creativity needs
    • Use streaming for responsive user interfaces
    • Leverage system messages to guide model behavior
  3. Runway Video Generation

    • Implement robust callback handling for asynchronous results
    • Store taskIds for status checking
    • Prepare for 14-day video expiration in your applications
  4. 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:

Language Support

This documentation is available in both English and Chinese. You can switch languages using the language selector in the navigation bar.